HP-29C Wait Loop

Calculators often sit in loops waiting for their person to do something. The HP-29C is no exception. Here’s what happens.

A=0000FFFFFFFF00 D=00000000000000 M1=00000000000000 P=12
B=29000000000000 E=00000000000000 M2=00000000000000
C=00000000000000 F=00000000000000 S =...3.5...9......
00152: 0 -> s 1

A=0000FFFFFFFF00 D=00000000000000 M1=00000000000000 P=12
B=29000000000000 E=00000000000000 M2=00000000000000
C=00000000000000 F=00000000000000 S =...3.5...9......
00153: 0 -> s 3

A=0000FFFFFFFF00 D=00000000000000 M1=00000000000000 P=12
B=29000000000000 E=00000000000000 M2=00000000000000
C=00000000000000 F=00000000000000 S =...3.5...9......
00154: if 0 = s 3 then goto 00163

A=0000FFFFFFFF00 D=00000000000000 M1=00000000000000 P=12
B=29000000000000 E=00000000000000 M2=00000000000000
C=00000000000000 F=00000000000000 S =...3.5...9......
00156: if 0 = s 11 then goto 00165

A=0000FFFFFFFF00 D=00000000000000 M1=00000000000000 P=12
B=29000000000000 E=00000000000000 M2=00000000000000
C=00000000000000 F=00000000000000 S =...3.5...9......
00165: 0 -> s 5

A=0000FFFFFFFF00 D=00000000000000 M1=00000000000000 P=12
B=29000000000000 E=00000000000000 M2=00000000000000
C=00000000000000 F=00000000000000 S =...3.5...9......
00166: if 1 = s 5 then goto 00173

A=0000FFFFFFFF00 D=00000000000000 M1=00000000000000 P=12
B=29000000000000 E=00000000000000 M2=00000000000000
C=00000000000000 F=00000000000000 S =...3.5...9......
00173: if 0 = s 15 then goto 00152

A=0000FFFFFFFF00 D=00000000000000 M1=00000000000000 P=12
B=29000000000000 E=00000000000000 M2=00000000000000
C=00000000000000 F=00000000000000 S =...3.5...9......
00152: ...

It loops from 00152 to 00173, with some steps skipped in between.

s3 is connected to the PRGM-RUN switch so 00153 and 00154 check that. If it’s in RUN mode it goes to 00165.

s5, you’ll see in a later article, is also connected up to some hardware. It is the low power warning flag so 00165 and 00166 check for power. If all is okay, it goes to 00173.

s15 is the keypress flag. If a button was pressed, s15 gets set. 00173 checks that and, if there’s nothing to do, it goes back to the start (00152).

The loop could be summarised as:

loop:
00153: if PRGM go elsewhere
       ...
00165: if not Low Power go 00173
       ...
00173: if no keypress go loop

There are fairly obvious branches to explore – the PRGM mode one, the Low Power one, and the keypress one.

There is also an “if 0 = s 11” in there which leaves one wondering, when doesn’t it? Best guess so far, based on what I’ve seen with other calculators, it’s an error flag and that suggests (if the guess is correct) that 00157 will be, or goto, an error routine. We’ll need to look further into that.

One also has to wonder why s 1 is being set to 0. The obvious question is what’s s 1 used for?

This is part of the HP29 topic.

It's only fair to share...Share on FacebookTweet about this on TwitterShare on Google+Share on LinkedInShare on StumbleUponDigg thisPin on PinterestEmail this to someone

Leave a Reply

Your email address will not be published. Required fields are marked *