HP65 s5 – Memory Full

s5 is used to record “memory full”. Here’s an example:

                                         ; A= 02009999999999 
05552 1 -> s5                            ; S= .....5.....b
05553 memory full -> a                   ; A= 02009999999990
05554 0 -> p
05555 if a[p] >= 1
05556 goto 05560
05557 0 -> s5                            ; S= ...........b
05560 0 -> a[w]                          ; A= 00000000000000

Initially, program memory starts with instructions for the [A] to [E] keys and then is padded out with NOPs. You see these as key code “35 01″ if you SST far enough in W/PRGM mode.

The ‘memory full -> a” microinstruction checks the end of program memory. If it contains a 0 (the program code for a NOP), A[0] gets set to zero. If not, you get something non-zero.

The “0 -> p” and “if a[p] >= 1” check this. If A[0]=0 step 05557 happens and s5 “memory full” gets cleared. If A[0] isn’t 0, that step is skipped over and s5 stays set.

Interestingly, if the program pointer (code 075) is in step 101, ie current step is step 100, this also results in A[0] being non-zero. This effect is used to show the “at step 100” leading and trailing minus signs.

NOTE: s5 only has the “memory full” meaning when you are in W/PRGM mode. In run mode, the same flag is used for error. It never confuses the two because, unlike modern interrupt-driven systems, the microcode polls the RUN-W/PRGM switch. This allows it to switch contexts when it is safe to do so (after the current activity has completed).

You can see the s5 code and the subsequent display activity for a range of circumstances in 65-wprgm-wait-loop.txt.

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 *