{"id":1288,"date":"2015-11-19T23:58:13","date_gmt":"2015-11-19T23:58:13","guid":{"rendered":"http:\/\/www.sydneysmith.com\/wordpress\/?p=1288"},"modified":"2017-05-14T01:28:07","modified_gmt":"2017-05-14T01:28:07","slug":"hp67-microcode-dsp-0","status":"publish","type":"post","link":"https:\/\/www.sydneysmith.com\/wordpress\/1288\/hp67-microcode-dsp-0\/","title":{"rendered":"HP67 Microcode &#8211; DSP 0"},"content":{"rendered":"<p>As you probably know, DSP n where n is one of the digit keys [0] to [9] sets the display precision. E.g. DSP 2 in FIXed mode gives you &#8220;0.00&#8221;, DSP 3 gives &#8220;0.000&#8221;.<\/p>\n<p>Here&#8217;s how the internals do that <!--more--><\/p>\n<p>Pressing [DSP] gives<\/p>\n<pre>\r\n00214 ...\r\n00217 keys to a                          ; A= 0000fffffff920 (scanrow=9 scancol=2)\r\n00256 a -&gt; rom address                   ; 5*9+2=47 =057\r\n01457 if n\/c go to 01510                 ; part of a \"jump table\".\r\n\r\n; do [DSP]:\r\n; set s 13 and M1[x]=060\r\n01510 jsb 01740                          ; [DSP] is a prefix key, clear prefix state\r\n01511 load constant 6                    ; C= 00000000000060 P= 0\r\n00451 1 -&gt; s 13                          ; S= .........9...d.f\r\n00144 m1 exch c                          ; C= 03000000000400 M1=00000000000060\r\n... (update display and back into wait loop)\r\n<\/pre>\n<p>Pressing [0] gives<\/p>\n<pre>\r\n00214 ...\r\n00217 keys to a                          ; A= 0000fffffff720 (row 7 col 2)\r\n00256 a -&gt; rom address                   ; 5*7+2=37 =045, C= 00000000000060 P= 1\r\n01445 if n\/c go to 01613\r\n\r\n; do [0]:\r\n01613 if 1 = s 4 : 01614 then go to 01654\r\n01615 if 0 = s 6 : 01616 then go to 01643\r\n01643 if 0 = s 8 : 01644 then go to 01654\r\n01654 if c[p] # 0\r\n01655 then go to 01566\r\n01566 delayed rom 01\r\n01567 if n\/c go to 0437\r\n\r\n00437 ...; A= 00000000000060 M1=00000000000060 S= .........9.....f C= 00000000000000 P= 12\r\n06027 a -&gt; rom address                   ; A[2,1]= 0x06 = 0000 0110 = 00 000 110 = 006\r\n06006 if n\/c go to 06040\r\n\r\n; do [DSP] n (or the other 0x6[a-f] hex codes)\r\n; check n &lt; 10 else go elsewhere\r\n; get display info etc from ram[62]\r\n; shift A left by 6 so A[0] lines up with dsp nibble in ram[62]\r\n; put n in the dsp nibble then save back to ram[62]\r\n06040 ... ; S= ......6..9.....f A= 00000000000060 C= 0000000000000a P= 0\r\n07460 if a &gt;= c[p]                       ; check n &lt; 10 (A= 0...6n)\r\n07461 then go to 07413\r\n07462 jsb 07706                          ; select ram bank 3, P= 0 C= 00000000000000\r\n07463 data register -&gt; c 14              ; ram[62] -&gt; C= 00000012220000\r\n; shift A left by 6\r\n07464 p &lt;- 6                             ; P= 6\r\n07465 load constant 5                    ; C= 00000015220000 P= 5\r\n07466 p &lt;- 6                             ; P= 6\r\n07467 shift left a[w]                    ; A= 00000000000600\r\n07470 c - 1 -&gt; c[p]                      ; C= 00000014220000\r\n07471 if n\/c go to 07467\r\n; A= 00000000006000 C= 00000013220000\r\n; A= 00000000060000 C= 00000012220000\r\n; A= 00000000600000 C= 00000011220000\r\n; A= 00000006000000 C= 00000010220000\r\n; A= 00000060000000 C= 0000001f220000\r\n07471 if n\/c go to 07467\r\n; put n in the dsp nibble\r\n07472 a exchange c[p]                    ; A= 0000006f000000 C= 00000010220000\r\n; save the updated DSP setting\r\n07473 c -&gt; data register 14              ; c= 00000010220000 -&gt; ram[62] \r\n07474 delayed rom 00\r\n07475 if n\/c go to 0114\r\n... (update display and back into wait loop) ; \"0.\"\r\n<\/pre>\n<p>The same for [DSP] [3] ends like this:<\/p>\n<pre>\r\n; [3] pressed\r\n00214 ...\r\n00217 keys to a                          ; A= 00fffffffff600\r\n00256 a -&gt; rom address                   ; 5*6+0=30 = 036, A= 00fffffffff1e0 P= 1 C= 00000000000060 M1=03000000000400\r\n\r\n; [0] was to 01445 then 01613 - gave C=0...060\r\n01436 c + 1 -&gt; c[x]                      ; C= 00000000000061\r\n01437 c + 1 -&gt; c[x]                      ; C= 00000000000062\r\n01440 if n\/c go to 01612\r\n\r\n01612 c + 1 -&gt; c[x]                      ; C= 00000000000063\r\n; now have C=0...060 - 0...069 for DSP 0-9. This is the hex code for DSP 0-9\r\n01613 if 1 = s 4 : 01614 then go to 01654\r\n01615 if 0 = s 6 : 01616 then go to 01643\r\n01643 if 0 = s 8 : 01644 then go to 01654\r\n01654 if c[p] # 0\r\n01655 then go to 01566\r\n01566 delayed rom 01\r\n01567 if n\/c go to 0437\r\n00437 ...  ; A= 00000000000063 M1=00000000000063 S= .........9.....f C= 00000000000000 P= 12\r\n06027 a -&gt; rom address                   ; A[2,1]= 0x06 = 0000 0110 = 00 000 110 = 006\r\n06006 if n\/c go to 06040                 ; all of the 0x60-0x6f hex codes go here.\r\n\r\n; do [DSP] n (or the other 0x6[a-f] hex codes)\r\n06040 ...                                ; S= ......6..9.....f\r\n07463 data register -&gt; c 14              ; ram[62] -&gt; C= 00000010220000\r\n; shift A[0] left 6 positions so it lines up with the DSP nibble in C[6]\r\n07464 ...\r\n; A= 00000000000630 C= 00000014220000\r\n; A= 00000000006300 C= 00000013220000\r\n; A= 00000000063000 C= 00000012220000\r\n; A= 00000000630000 C= 00000011220000\r\n; A= 00000006300000 C= 00000010220000\r\n; A= 00000063000000 C= 0000001f220000\r\n07471 if n\/c go to 07467\r\n; put the new DSP n value into C\r\n07472 a exchange c[p]                    ; A= 0000006f000000 C= 00000013220000\r\n; save the updated value\r\n07473 c -&gt; data register 14              ; C (=00000013220000) -&gt; ram[62] \r\n07474 delayed rom 00\r\n07475 if n\/c go to 0114\r\n... (update display and back into wait loop) ; \"0.000\"\r\n<\/pre>\n<p>More info is in <a href=\"http:\/\/www.sydneysmith.com\/products\/gss-hp67u\/downloads\/67-dsp-0.txt\" target=\"_blank\">67-dsp-0.txt<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>As you probably know, DSP n where n is one of the digit keys [0] to [9] sets the display precision. E.g. DSP 2 in FIXed mode gives you &#8220;0.00&#8221;, DSP 3 gives &#8220;0.000&#8221;. Here&#8217;s how the internals do that<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[16,5,3],"tags":[30,32],"_links":{"self":[{"href":"https:\/\/www.sydneysmith.com\/wordpress\/wp-json\/wp\/v2\/posts\/1288"}],"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=1288"}],"version-history":[{"count":7,"href":"https:\/\/www.sydneysmith.com\/wordpress\/wp-json\/wp\/v2\/posts\/1288\/revisions"}],"predecessor-version":[{"id":1345,"href":"https:\/\/www.sydneysmith.com\/wordpress\/wp-json\/wp\/v2\/posts\/1288\/revisions\/1345"}],"wp:attachment":[{"href":"https:\/\/www.sydneysmith.com\/wordpress\/wp-json\/wp\/v2\/media?parent=1288"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sydneysmith.com\/wordpress\/wp-json\/wp\/v2\/categories?post=1288"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sydneysmith.com\/wordpress\/wp-json\/wp\/v2\/tags?post=1288"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}