HP-65 Display Program Step

How does the HP-65 display a program step? If you run the HP-65 emulator with logging turned on and flick the switch to W/PRGM you’ll see. Here’s the details:

The HP-65 wait loop goes from 00726 – 00777. That’s the main starting point for everything other than “power up”. The wait loop jumps around a lot in the process of getting to 00777 and, in the course of that, it goes through:

; S= ............ P= 1 C= 00000000000221 M =00000000000000

00537 if s3 = 0                     ; if RUN
00540 goto 00552                    ; NOTE: W/PRGM overrides s3. s3 appears 0 but goto doesn't happen
;
; display current prgm step
;
00541 if s11 = 0
00542 goto 00721
00721 if c[p] >= 1
00722 goto 00742
00742 c - 1 -> c[p]                 ; C= 00000000000211
00743 c - 1 -> c[p]                 ; C= 00000000000201
00744 if c[p] >= 1                  ; see 00746 if c[p] gets set to 3, skip all this
00745 goto 00774
;
; work out what to display
;
00746 load 3                        ; C= 00000000000231 P= 0 (skip this next time)
00747 goto 00724
00724 0 -> c[m]
00725 jsb 00543
.00543 c <-> m                       ; C= 00000000000000 M =00000000000231
.00544 delayed select group 1        ; 1*04000
.00545 rom 3                         ; 3*00400
.05546 dispoff                       ; 05546= 04000+01400+0146
.05547 0 -> f2                       ; S= ...........b
.05550 c -> a[w]                     ; A= 00000000000000
.05551 a <-> b[w]                    ; A= 02009999999999 B= 00000000000000
.05552 1 -> s5                       ; S= .....5.....b (s5=mem full)
.05553 memory full -> a              ; A= 02009999999990
.05554 0 -> p
.05555 if a[p] >= 1                  ; if prog[100] != nop
.05556 goto 05560
.05557 0 -> s5                       ; S= ...........b (wasn't full)
.05560 0 -> a[w]                     ; A= 00000000000000
.05561 a - 1 -> a[w]                 ; A= 99999999999999
.05562 shiftl a[m]                   ; A= 99999999990999
.05563 shiftl a[m]                   ; A= 99999999900999
.05564 0 -> c[w]
.05565 4 -> p                        ; P= 4
.05566 0 -> s4
.05567 buffer -> rom address         ; setup for computed goto (in this case with 077)
.05570 goto 05400                    ; to 077 = start marker, show "00 00"
;
.05477 1 -> s4                       ; S= ....4......b
.05500 jsb 05744                     ; but only 1 level jsb supported
.05744 if s4 = 0
.05745 goto 05711
.05746 0 -> s4                       ; S= ...........b
.05747 a <-> c[w]                    ; A= 00000000000000 C= 99999999900999
.05750 shiftl a[m]
.05751 shiftl a[m]
.05752 shiftl a[m]
.05753 7 -> p                        ; P= 7
.05754 load 0                        ; C= 99999909900999 P= 6
.05755 load 0                        ; C= 99999900900999 P= 5
.05756 a <-> c[w]                    ; A= 99999900900999 C= 00000000000000
.05757 4 -> p                        ; P= 4
.05760 return
05501 goto 05744
05744 if s4 = 0
05745 goto 05711
;
05711 if s5 = 0                     ; if not mem full, skip next bit
05712 goto 05723
05723 a <-> c[w]                    ; A= 00000000000000 C= 99999900900999
05724 b <-> c[w]                    ; B= 99999900900999 C= 00000000000000
05725 clearstatus                   ; S= ............
05726 delayed select group 0        ; 0*04000
05727 rom 1                         ; 1*00400
00730 0 -> s9                       ; 00730=00000+00400+0330
00731 1 -> s10                      ; S= ..........a.
00732 disptoggle                    ; ="      00 00   "
00733 goto 00622
;
00622 ...                           ; (back into the wait loop)
00745 goto 00774
;
; if already done, skips to here
;
00774 c + 1 -> c[p]                 ; C= 00000000000221
00775 c + 1 -> c[p]                 ; C= 00000000000231
00776 c <-> m                       ; C= 00000000000000 M =00000000000231
00777 goto 00726

If the current program step is other than 077 (top of program marker) then “05570 goto 05400” will goto a microcode step appropriate for the program step and the display will show something other than “00 00”.

See also:
HP-65 Display X in fixed mode

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 *