HP-29C Error Routine

Here’s how “Error” gets displayed by the HP-29C.

Using the hp29w:

;
; doing [g] [1/x] (15 74)
; S=...3.5...9.....F
;
03003: if c[m] = 0 then goto 01034           ; Divide by zero
03034: delayed rom 2                         ;
03035: if n/c goto 0374                      ;
01374: if n/c goto 0231                      ;

error:
01231: 0 -> a[w]                             ; A=00000000000000
01232: 0 -> c[w]                             ;
01233: 0 -> s 1                              ;
01234: 0 -> s 2                              ;
01235: p <- 13                               ; P=13
01236: load constant 14                      ; C=E0000000000000 P=12
01237: load constant 10                      ; C=EA000000000000 P=11
01240: load constant 10                      ; C=EAA00000000000 P=10
01241: load constant 12                      ; C=EAAC0000000000 P= 9
01242: load constant 10                      ; C=EAACA000000000 P= 8 "Error"
01243: binary                                ;
01244: c - 1 -> c[wp]                        ; C=EAACAFFFFFFFFF
01245: a exchange c[w]                       ; A=EAACAFFFFFFFFF C=00000000000000
01246: b exchange c[w]                       ;
01247: display off                           ;
01250: display toggle                        ; "Error       "
;
; for i=0x400 to -1 step -1
01251: p <- 2                                ; P= 2
01252: load constant 4                       ; C=00000000000400 P= 1
01253: c - 1 -> c[x]                         ; C=000000000003FF
01254: if n/c goto 0253                      ;
01253: c - 1 -> c[x]                         ; C=000000000003FE
01254: if n/c goto 0253                      ;
...
01253: c - 1 -> c[x]                         ; C=00000000000001
01254: if n/c goto 0253                      ;
01253: c - 1 -> c[x]                         ; C=00000000000000
01254: if n/c goto 0253                      ;
01253: c - 1 -> c[x]                         ; C=00000000000FFF
01254: if n/c goto 0253                      ;
; next i
;
01255: display toggle                        ; (display off) 
;
; for i=255 to -1 step -1
01256: c - 1 -> c[wp]                        ; C=00000000000FFE
01257: if n/c goto 0256                      ;
01256: c - 1 -> c[wp]                        ; C=00000000000FFD
01257: if n/c goto 0256                      ;
01256: c - 1 -> c[wp]                        ; C=00000000000FFC
01257: if n/c goto 0256                      ;
...
01256: c - 1 -> c[wp]                        ; C=00000000000F01
01257: if n/c goto 0256                      ;
01256: c - 1 -> c[wp]                        ; C=00000000000F00
01257: if n/c goto 0256                      ;
01256: c - 1 -> c[wp]                        ; C=00000000000FFF
01257: if n/c goto 0256                      ;
; next i
;
01260: display toggle                        ; display on again
;
01261: 0 -> s 15                             ; S=...3.5...9......
01262: if 1 = s 15 then goto 01261           ; if key down, wait for up
;
01264: 0 -> s 3                              ; if RUN mode
01265: if 1 = s 3 then goto 01271            ;
;
; while RUN mode and not key press
01271: if 1 = s 15 then goto 01276           ;
01273: 0 -> s 3                              ;
01274: if 1 = s 3 then goto 01271            ;
; endwhile
;

It displays Error for 4 time periods, blanks the display for 1 time period – to get your attention, and then sits there with Error displayed.

Both loops use up 2 opcodes. Per the HP Journal article on the HP-67, there are about 3000 woodstock opcodes per second. The 0x400 loop is 1024×2 opcodes, about 2/3 of a second. The blanked out period is a quarter of that, just 1/6 of a second.

You have to let go of the key that you pressed. Then you can press a key to clear the Error display, or switch to PRGM mode.

Here’s what happens next (on pressing a key, so s 15 gets set):


; S=...3.5...9.....F
01274: if 1 = s 3 then goto 01271            ;
01271: if 1 = s 15 then goto 01276           ;
01276: display toggle                        ;
01277: delayed rom 0                         ;
01300: if n/c goto 0062                      ;
00062: 0 -> s 12                             ;
00063: jsb 0323                              ;
00323: p <- 1                                ;
00324: load constant 2                       ; C=00000000000F2F P= 0
00325: c -> addr                             ;
00326: data register -> c 15                 ; C=00000000000000
00327: b exchange c[w]                       ;
00330: return                                ;
00064: if n/c goto 0114                      ;
00114: jsb 0315                              ;
00315: if 1 = s 2 then goto 00321            ;
00317: if 0 = s 1 then goto 00322            ;
00322: return                                ;
00115: binary                                ;
00116: delayed rom 2                         ;
00117: jsb 0167                              ;
01167: ...                                   ; 0 -> s 0,4,6-8,10,13,14
01177: return                                ;
00120: b -> c[w]                             ;
00121: if 1 = s 2 then goto 00223            ;
00123: 0 -> s 1                              ;
00124: 0 -> s 11                             ;
00125: 0 -> c[s]                             ;
00126: m1 exch c                             ; C=0000000000006B M1=00000000000000
00127: b -> c[w]                             ; C=00000000000000
00130: 0 -> s 3                              ;
00131: if 0 = s 3 then goto 00232            ;
00133: if 0 = s 12 then goto 00140           ;
00140: delayed rom 4                         ;
00141: jsb 0000                              ;
02000: ...                                   ; get last x
02172: return                                ;
00142: delayed rom 2                         ;
00143: jsb 0371                              ;
01371: ...                                   ; format x in A and B
01107: return                                ; A=0000FFFFFFFF00 B=29000000000000
00144: cpu woodstock                         ;
00145: display off                           ;
00146: display toggle                        ; "0.00"
00147: 0 -> s 15                             ; S=...3.5...9......
00150: if 1 = s 15 then goto 00147           ;
00152: 0 -> s 1                              ;
00153: 0 -> s 3                              ;
00154: if 0 = s 3 then goto 00163            ;
00156: if 0 = s 11 then goto 00165           ;
00165: 0 -> s 5                              ;
00166: if 1 = s 5 then goto 00173            ;
00173: if 0 = s 15 then goto 00152           ;
00152: ...

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 *