{"id":1406,"date":"2015-12-12T02:10:25","date_gmt":"2015-12-12T02:10:25","guid":{"rendered":"http:\/\/www.sydneysmith.com\/wordpress\/?p=1406"},"modified":"2017-05-14T00:44:23","modified_gmt":"2017-05-14T00:44:23","slug":"hp-65-display-x-in-fixed-mode","status":"publish","type":"post","link":"https:\/\/www.sydneysmith.com\/wordpress\/1406\/hp-65-display-x-in-fixed-mode\/","title":{"rendered":"HP-65 Display X in FIXed mode"},"content":{"rendered":"<p>Here&#8217;s how we get X displayed when we&#8217;re in FIXed display mode.<!--more--><\/p>\n<p>The process summarizes to:<br \/>\nif A &#038; B aren&#8217;t already valid from last time (f3)<br \/>\n&#8211; if (w\/prgm) do something else (s3)<br \/>\n&#8211; if (SCI mode) do something else too (M[1])<br \/>\n&#8211; 04164 Display X in FIX mode<br \/>\n&#8211; create mask in B (29999999999999)<br \/>\n&#8211; move it right by exponent digits (eg 0002999999999)<br \/>\n&#8211; round X in A to precision (M[2])<br \/>\n&#8211; add holes in mask to rhs of &#8220;.&#8221; to precision<br \/>\n&#8211; blank out the exponent &#8217;cause this is FIXed mode<br \/>\n&#8211; turn the display on<br \/>\nend if<\/p>\n<p>if f3 is 0 and A &#038; B are already valid, the display must still be on because it jumps to after that point.<\/p>\n<p>The microcode looks like:<\/p>\n<pre>\r\n00531 0 -&gt; s3\r\n00532 1 -&gt; f2\r\n00533 1 -&gt; p                             ; P= 1\r\n00534 c &lt;-&gt; m                            ; C= 00000000000221 M =05432100000004\r\n00535 0 -&gt; s11\r\n00536 0 -&gt; f3                            ; S= ...........b\r\n;\r\n00537 if s3 = 0                          ; if in RUN mode\r\n00540 goto 00552\r\n; else see \"display program step\" instead\r\n\r\n00552 if s11 = 0                         ; if f3 was clear before now\r\n00553 goto 00764                         ; we can skip the following (A & B already valid)\r\n\r\n; setup A & B for display\r\n00554 if c[p] = 0\r\n00555 goto 00616                         ; display X in SCI notation\r\n00556 c - 1 -&gt; c[p]                      ; C= 00000000000211\r\n00557 if c[p] = 0\r\n00560 goto 00616                         ; display X in SCI notation\r\n00561 load 2                             ; C= 00000000000221 P= 0\r\n00562 delayed select group 1\r\n00563 rom 0\r\n\r\n; display X in FIX notation\r\n04164 jsb 04101                          ; create mask in B with \"2\" where \".\" should be\r\n.04101 dispoff\r\n.04102 c -&gt; a[x]                         ; A= 98000000000221 (precision,mode,ang)\r\n.04103 c &lt;-&gt; m                           ; C= 05432100000004 M =00000000000221\r\n.04104 shiftr a[x]                       ; A= 98000000000022\r\n.04105 shiftr a[x]                       ; A= 98000000000002 (precision)\r\n.04106 0 -&gt; p\r\n.04107 if c[m] &gt;= 1                      ; if mantissa=0 04111 would set exp=0 too\r\n.04110 goto 04112\r\n.04112 b &lt;-&gt; c[w]                        ; B= 05432100000004 C= 00000000000000\r\n.04113 0 -&gt; c[w]\r\n.04114 c - 1 -&gt; c[w]                     ; C= 99999999999999 (mask)\r\n.04115 c + 1 -&gt; c[s]                     ; C= 09999999999999\r\n.04116 c + 1 -&gt; c[s]                     ; C= 19999999999999\r\n.04117 c + 1 -&gt; c[s]                     ; C= 29999999999999 (2 mask)\r\n.04120 b &lt;-&gt; c[w]                        ; B= 29999999999999 C= 05432100000004\r\n.04121 0 -&gt; f2\r\n.04122 return\r\n04165 a + c -&gt; a[x]                      ; A= 98000000000006 =precision+exponent\r\n04166 jsb 04266\r\n.04266 a + 1 -&gt; a[x]                     ; A= 98000000000007 =precision+exponent+1 = digits\r\n.04267 12 -&gt; p                           ; P= 12\r\n.04270 goto 04124\r\n.04124 a - 1 -&gt; a[x]                     ; A= 98000000000006\r\n.04125 goto 04206\r\n.04206 if p # 2\r\n.04207 goto 04123\r\n.04123 p - 1 -&gt; p                        ; P= 11\r\n.04124 a - 1 -&gt; a[x]                     ; A= 98000000000005\r\n.04125 goto 04206\r\n; P= 10 A= 98000000000004\r\n; P= 9  A= 98000000000003\r\n; P= 8  A= 98000000000002\r\n; P= 7  A= 98000000000001\r\n; P= 6  A= 98000000000000\r\n; P= 5  A= 98000000000999\r\n.04125 goto 04206\r\n; P = digits blanked on the right \r\n.04126 0 -&gt; a[w]                         ; A= 00000000000000\r\n; copy the blanked frac to A, & the exponent\r\n.04127 c -&gt; a[wp]                        ; A= 00000000000004\r\n; round the value (2*undisplayed frac adds 1 if &gt;=0.5)\r\n.04130 a + c -&gt; a[m]                     ; A= 05432100000004\r\n.04131 goto 04135\r\n.04135 a -&gt; b[x]                         ; B= 29999999999004\r\n.04136 return\r\n04167 if a[xs] &gt;= 1                      ; if exp sign negative\r\n04170 goto 04364\r\n; about to shift decimal point to the right by exp places\r\n04171 13 -&gt; p                            ; P= 13\r\n04172 p - 1 -&gt; p                         ; P= 12\r\n04173 shiftr b[ms]                       ; B= 02999999999004\r\n04174 a - 1 -&gt; a[x]                      ; A= 05432100000003\r\n04175 goto 04361\r\n04361 if p # 3                           ; but if going into exponent area\r\n04362 goto 04172                         ; do s\/thing else\r\n; P= 11 B= 00299999999004 A= 05432100000002\r\n; P= 10 B= 00029999999004 A= 05432100000001\r\n; P= 9  B= 00002999999004 A= 05432100000000\r\n; P= 8  B= 00000299999004 A= 05432100000999\r\n04175 goto 04361\r\n04176 jsb 04272                          ; get prec,mode,ang to a[x]\r\n.04272 c &lt;-&gt; m                           ; C= 00000000000221 M =05432100000004\r\n.04273 c -&gt; a[x]                         ; A= 05432100000221\r\n.04274 c &lt;-&gt; m                           ; C= 05432100000004 M =00000000000221\r\n.04275 return\r\n04177 goto 04151\r\n04151 if a[xs] &gt;= 1                      ; if DSP . 1 or more\r\n04152 goto 04231\r\n; about to open mask holes for digits on rhs of decimal\r\n; a[xs]= precision\r\n; p points to the \".\" in B\r\n; so code below is \"for (; a[xs]&gt;0; a[xs]--) b[p--]=0\"\r\n04231 p - 1 -&gt; p                         ; P= 7\r\n04232 if p # 2                           ; but still check not in exp area\r\n04233 goto 04147\r\n04147 0 -&gt; b[p]                          ; B= 00000209999004\r\n04150 a - 1 -&gt; a[xs]                     ; A= 05432100000121\r\n04151 if a[xs] &gt;= 1\r\n04152 goto 04231\r\n04231 p - 1 -&gt; p                         ; P= 6\r\n04232 if p # 2\r\n04233 goto 04147\r\n04147 0 -&gt; b[p]                          ; B= 00000200999004\r\n04150 a - 1 -&gt; a[xs]                     ; A= 05432100000021\r\n04151 if a[xs] &gt;= 1\r\n04152 goto 04231\r\n; always blank out the exponent in FIX mode\r\n04153 0 -&gt; a[x]                          ; A= 05432100000000\r\n04154 a - 1 -&gt; a[x]                      ; A= 05432100000999\r\n04155 a -&gt; b[x]                          ; B= 00000200999999\r\n04156 goto 04321\r\n; put sign of X in a[13]\r\n04321 c -&gt; a[s]\r\n;\r\n04322 if s5 = 0\r\n04323 goto 04331\r\n; wrap up\r\n04331 clearstatus                        ; S= ............\r\n04332 goto 04326\r\n04326 delayed select group 0\r\n04327 rom 1\r\n00730 0 -&gt; s9\r\n00731 1 -&gt; s10                           ; S= ..........a.\r\n; display\r\n00732 disptoggle                         ; =\" 5432.10\"\r\n00733 goto 00622\r\n\r\nwaitloop2:\r\n00622 ...\r\n\r\nwaitloop3:\r\n00764 ...\r\n\r\nwaitloop4:\r\n00774 ...\r\n00777 goto 00726\r\n<\/pre>\n<p>Anything that gets to 00531 is up to the display routine and about to go back into the wait loop.<\/p>\n<p>See also:<br \/>\n<a href=\"http:\/\/www.sydneysmith.com\/wordpress\/1379\/hp-65-display-program-step\/\">HP-65 Display program step<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Here&#8217;s how we get X displayed when we&#8217;re in FIXed display mode.<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[16,5,39],"tags":[37,32],"_links":{"self":[{"href":"https:\/\/www.sydneysmith.com\/wordpress\/wp-json\/wp\/v2\/posts\/1406"}],"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=1406"}],"version-history":[{"count":4,"href":"https:\/\/www.sydneysmith.com\/wordpress\/wp-json\/wp\/v2\/posts\/1406\/revisions"}],"predecessor-version":[{"id":1410,"href":"https:\/\/www.sydneysmith.com\/wordpress\/wp-json\/wp\/v2\/posts\/1406\/revisions\/1410"}],"wp:attachment":[{"href":"https:\/\/www.sydneysmith.com\/wordpress\/wp-json\/wp\/v2\/media?parent=1406"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sydneysmith.com\/wordpress\/wp-json\/wp\/v2\/categories?post=1406"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sydneysmith.com\/wordpress\/wp-json\/wp\/v2\/tags?post=1406"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}