HP-65 – Pressing the [A] key

When you press the [A] key the HP-65 calculator starts looking for a “LBL A” in program memory and then runs it. Unlike the HP-67 which has a “(use) default functions” flag, the HP-65 fires up with its default functions entered into program memory. This simplifies the ’65 processing for [A].

Here’s what happens:

HP65 Logging started.
; A= 00000000000999 B= 02009999999999
; S= 0........... P= 1 M =00000000000221
00726 if s9 = 0
00727 goto 00622
00622 12 -> p            ; P= 12
00623 if s0 = 0
00624 goto 00452
...
00627 goto 00625
00630 0 -> s0            ; S= ............
00631 if s10 = 0
00632 goto 00641
00641 if s5 = 0
00642 goto 00734
00734 if s8 = 0
00735 goto 00710
00710 jsb 00675
00675 12 -> p
00676 1 -> f3
00677 dispoff
00700 c <-> m            ; C= 00000000000221 M =00000000000000
00701 shiftl a[w]        ; A= 00000000009990
00702 return
00711 1 -> f7
00712 if s3 = 0
00713 goto 00715
00715 rom 2
01316 key -> rom         ; 036= [A]

01036 goto 01351         ; FCN40

; FCN40: Do [A]-[E]
01351 rom 4
02352 0 -> f5            ; S= ...........b
02353 if c[m] = 0
02354 goto 02371
02371 0 -> c[ms]
02372 if s8 = 0
02373 goto 02102
02102 if s9 = 0
02103 goto 02302
;---
02302 search for label
;---
02303 goto 02106
02106 c + 1 -> c[s]      ; C= 10000000000221
; c[s] is probably subroutine depth 1=main, 2=sub, 3=too far, ...
02107 clearstatus        ; S= ............
02110 1 -> s10           ; S= ..........a.
02111 jsb 02376
02376 1 -> s8            ; S= ........8.a.
02377 goto 02260
02260 jsb 02127
;
; MCIRC0:
; wait for prgm mem ready (to "circulate" - M CIRC)
; then clear the flag for next time
; clearing should be redundant as test does that
; but maybe some timings cause glitches
; so they clear it again
02127 0 -> s11
02130 0 -> f5
02131 if s11 = 0
02132 goto 02130
02130 0 -> f5            ; S= ........8.ab
02131 if s11 = 0
02132 goto 02130
02133 0 -> f5
02134 return
;
02261 goto 02360
02360 0 -> c[m]          ; clear prefixes
02361 c <-> m            ; C= 00000000000000 M =10000000000221
02362 goto 02045
02045 rom 0
00046 if s8 = 0
00047 goto 00216         ; would 1 -> s10
00050 goto 00217
00217 rom 1
;
00620 if s8 = 0          ; if not running
00621 goto 00531         ; skip this
00622 12 -> p
00623 if s0 = 0          ; if no key press (no interrupt)
00624 goto 00452         ; proceed
; else would loop 16 times (for h/w to settle?)
; then if s10=1 goto 00622 to wait for finger off the key
; if s10=0 then (interrupt routine?) at 00641

00452 0 -> s10           ; S= ........8..b
00453 if s5 = 0
00454 goto 00750
00750 if s8 = 0
00751 goto 00441

; get an instruction from prgm mem
00752 pointer advance
00753 disptoggle
00754 c <-> m            ; C= 10000000000221 M =00000000000000
...

It looks like s10 is a “don’t interrupt” flag for the current instruction. It might be used to cause a SST of a subroutine to complete in a single step (?). It might just be a “let me complete this one step properly, then I’ll stop” flag.

The main things above are:
02302 search for label
02106 c + 1 -> c[s]
02376 1 -> s8 ; set running
00750 … ; if running get next step from prgm mem

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 *