{"id":1932,"date":"2018-02-22T21:11:12","date_gmt":"2018-02-22T21:11:12","guid":{"rendered":"http:\/\/www.sydneysmith.com\/wordpress\/?p=1932"},"modified":"2018-02-24T21:55:29","modified_gmt":"2018-02-24T21:55:29","slug":"hp-29c-error-routine","status":"publish","type":"post","link":"https:\/\/www.sydneysmith.com\/wordpress\/1932\/hp-29c-error-routine\/","title":{"rendered":"HP-29C Error Routine"},"content":{"rendered":"<p>Here&#8217;s how &#8220;Error&#8221; gets displayed by the HP-29C. <!--more--><\/p>\n<p>Using the <a href=\"http:\/\/www.sydneysmith.com\/wordpress\/hp29w\/\">hp29w<\/a>:<br \/>\n<code><\/p>\n<pre>\r\n;\r\n; doing [g] [1\/x] (15 74)\r\n; S=...3.5...9.....F\r\n;\r\n03003: if c[m] = 0 then goto 01034           ; Divide by zero\r\n03034: delayed rom 2                         ;\r\n03035: if n\/c goto 0374                      ;\r\n01374: if n\/c goto 0231                      ;\r\n\r\nerror:\r\n01231: 0 -> a[w]                             ; A=00000000000000\r\n01232: 0 -> c[w]                             ;\r\n01233: 0 -> s 1                              ;\r\n01234: 0 -> s 2                              ;\r\n01235: p <- 13                               ; P=13\r\n01236: load constant 14                      ; C=E0000000000000 P=12\r\n01237: load constant 10                      ; C=EA000000000000 P=11\r\n01240: load constant 10                      ; C=EAA00000000000 P=10\r\n01241: load constant 12                      ; C=EAAC0000000000 P= 9\r\n01242: load constant 10                      ; C=EAACA000000000 P= 8 \"Error\"\r\n01243: binary                                ;\r\n01244: c - 1 -> c[wp]                        ; C=EAACAFFFFFFFFF\r\n01245: a exchange c[w]                       ; A=EAACAFFFFFFFFF C=00000000000000\r\n01246: b exchange c[w]                       ;\r\n01247: display off                           ;\r\n01250: display toggle                        ; \"Error       \"\r\n;\r\n; for i=0x400 to -1 step -1\r\n01251: p <- 2                                ; P= 2\r\n01252: load constant 4                       ; C=00000000000400 P= 1\r\n01253: c - 1 -> c[x]                         ; C=000000000003FF\r\n01254: if n\/c goto 0253                      ;\r\n01253: c - 1 -> c[x]                         ; C=000000000003FE\r\n01254: if n\/c goto 0253                      ;\r\n...\r\n01253: c - 1 -> c[x]                         ; C=00000000000001\r\n01254: if n\/c goto 0253                      ;\r\n01253: c - 1 -> c[x]                         ; C=00000000000000\r\n01254: if n\/c goto 0253                      ;\r\n01253: c - 1 -> c[x]                         ; C=00000000000FFF\r\n01254: if n\/c goto 0253                      ;\r\n; next i\r\n;\r\n01255: display toggle                        ; (display off) \r\n;\r\n; for i=255 to -1 step -1\r\n01256: c - 1 -> c[wp]                        ; C=00000000000FFE\r\n01257: if n\/c goto 0256                      ;\r\n01256: c - 1 -> c[wp]                        ; C=00000000000FFD\r\n01257: if n\/c goto 0256                      ;\r\n01256: c - 1 -> c[wp]                        ; C=00000000000FFC\r\n01257: if n\/c goto 0256                      ;\r\n...\r\n01256: c - 1 -> c[wp]                        ; C=00000000000F01\r\n01257: if n\/c goto 0256                      ;\r\n01256: c - 1 -> c[wp]                        ; C=00000000000F00\r\n01257: if n\/c goto 0256                      ;\r\n01256: c - 1 -> c[wp]                        ; C=00000000000FFF\r\n01257: if n\/c goto 0256                      ;\r\n; next i\r\n;\r\n01260: display toggle                        ; display on again\r\n;\r\n01261: 0 -> s 15                             ; S=...3.5...9......\r\n01262: if 1 = s 15 then goto 01261           ; if key down, wait for up\r\n;\r\n01264: 0 -> s 3                              ; if RUN mode\r\n01265: if 1 = s 3 then goto 01271            ;\r\n;\r\n; while RUN mode and not key press\r\n01271: if 1 = s 15 then goto 01276           ;\r\n01273: 0 -> s 3                              ;\r\n01274: if 1 = s 3 then goto 01271            ;\r\n; endwhile\r\n;\r\n<\/pre>\n<p><\/code><\/p>\n<p>It displays Error for 4 time periods, blanks the display for 1 time period &#8211; to get your attention, and then sits there with Error displayed.<\/p>\n<p>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&#215;2 opcodes, about 2\/3 of a second. The blanked out period is a quarter of that, just 1\/6 of a second.<\/p>\n<p>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.<\/p>\n<p>Here&#8217;s what happens next (on pressing a key, so s 15 gets set):<br \/>\n<code><\/p>\n<pre>\r\n\r\n; S=...3.5...9.....F\r\n01274: if 1 = s 3 then goto 01271            ;\r\n01271: if 1 = s 15 then goto 01276           ;\r\n01276: display toggle                        ;\r\n01277: delayed rom 0                         ;\r\n01300: if n\/c goto 0062                      ;\r\n00062: 0 -> s 12                             ;\r\n00063: jsb 0323                              ;\r\n00323: p <- 1                                ;\r\n00324: load constant 2                       ; C=00000000000F2F P= 0\r\n00325: c -> addr                             ;\r\n00326: data register -> c 15                 ; C=00000000000000\r\n00327: b exchange c[w]                       ;\r\n00330: return                                ;\r\n00064: if n\/c goto 0114                      ;\r\n00114: jsb 0315                              ;\r\n00315: if 1 = s 2 then goto 00321            ;\r\n00317: if 0 = s 1 then goto 00322            ;\r\n00322: return                                ;\r\n00115: binary                                ;\r\n00116: delayed rom 2                         ;\r\n00117: jsb 0167                              ;\r\n01167: ...                                   ; 0 -> s 0,4,6-8,10,13,14\r\n01177: return                                ;\r\n00120: b -> c[w]                             ;\r\n00121: if 1 = s 2 then goto 00223            ;\r\n00123: 0 -> s 1                              ;\r\n00124: 0 -> s 11                             ;\r\n00125: 0 -> c[s]                             ;\r\n00126: m1 exch c                             ; C=0000000000006B M1=00000000000000\r\n00127: b -> c[w]                             ; C=00000000000000\r\n00130: 0 -> s 3                              ;\r\n00131: if 0 = s 3 then goto 00232            ;\r\n00133: if 0 = s 12 then goto 00140           ;\r\n00140: delayed rom 4                         ;\r\n00141: jsb 0000                              ;\r\n02000: ...                                   ; get last x\r\n02172: return                                ;\r\n00142: delayed rom 2                         ;\r\n00143: jsb 0371                              ;\r\n01371: ...                                   ; format x in A and B\r\n01107: return                                ; A=0000FFFFFFFF00 B=29000000000000\r\n00144: cpu woodstock                         ;\r\n00145: display off                           ;\r\n00146: display toggle                        ; \"0.00\"\r\n00147: 0 -> s 15                             ; S=...3.5...9......\r\n00150: if 1 = s 15 then goto 00147           ;\r\n00152: 0 -> s 1                              ;\r\n00153: 0 -> s 3                              ;\r\n00154: if 0 = s 3 then goto 00163            ;\r\n00156: if 0 = s 11 then goto 00165           ;\r\n00165: 0 -> s 5                              ;\r\n00166: if 1 = s 5 then goto 00173            ;\r\n00173: if 0 = s 15 then goto 00152           ;\r\n00152: ...\r\n<\/pre>\n<p><\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Here&#8217;s how &#8220;Error&#8221; gets displayed by the HP-29C.<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[16,5,66],"tags":[32],"_links":{"self":[{"href":"https:\/\/www.sydneysmith.com\/wordpress\/wp-json\/wp\/v2\/posts\/1932"}],"collection":[{"href":"https:\/\/www.sydneysmith.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sydneysmith.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sydneysmith.com\/wordpress\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sydneysmith.com\/wordpress\/wp-json\/wp\/v2\/comments?post=1932"}],"version-history":[{"count":8,"href":"https:\/\/www.sydneysmith.com\/wordpress\/wp-json\/wp\/v2\/posts\/1932\/revisions"}],"predecessor-version":[{"id":1949,"href":"https:\/\/www.sydneysmith.com\/wordpress\/wp-json\/wp\/v2\/posts\/1932\/revisions\/1949"}],"wp:attachment":[{"href":"https:\/\/www.sydneysmith.com\/wordpress\/wp-json\/wp\/v2\/media?parent=1932"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sydneysmith.com\/wordpress\/wp-json\/wp\/v2\/categories?post=1932"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sydneysmith.com\/wordpress\/wp-json\/wp\/v2\/tags?post=1932"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}