{"id":1435,"date":"2015-12-14T21:15:05","date_gmt":"2015-12-14T21:15:05","guid":{"rendered":"http:\/\/www.sydneysmith.com\/wordpress\/?p=1435"},"modified":"2017-05-14T00:42:40","modified_gmt":"2017-05-14T00:42:40","slug":"hp65-microcode-rs-infinite-loop","status":"publish","type":"post","link":"https:\/\/www.sydneysmith.com\/wordpress\/1435\/hp65-microcode-rs-infinite-loop\/","title":{"rendered":"HP65 Microcode R\/S Infinite Loop"},"content":{"rendered":"<p>As discussed in <a href=\"http:\/\/www.sydneysmith.com\/wordpress\/1428\/hp-65-rs\/\">HP-65 R\/S<\/a>, the commonly available microcode for the HP-65 calculator goes into an (almost?) infinite loop if you press the [R\/S] key. Here&#8217;s what it looks like: <!--more--><\/p>\n<pre>\r\n00763 rom 2\r\n01364 buffer -&gt; rom address\r\n01365 goto 01000\r\n01042 goto 01101\r\n01101 0 -> c[m]\r\n01102 delayed select group 1\r\n01103 c &lt;-&gt; m            ; C= 01000000000001 M =10000000000221\r\n01104 c -&gt; stack         ; D= 01000000000001\r\n01105 goto 01237\r\n05237 a + b -&gt; a[ms]     ; A= 00999999990000\r\n05240 c + 1 -&gt; c[x]      ; C= 01000000000002\r\n05241 a -&gt; b[m]          ; B= 00999999990000\r\n05242 a &lt;-&gt; b[x]\r\n05243 c -&gt; a[m]          ; A= 01000000000000\r\n05244 p - 1 -&gt; p         ; P= 11\r\n05245 goto 05156\r\n05156 if a[x] &gt;= 1\r\n05157 goto 05001\r\n05160 a &lt;-&gt; b[m]         ; A= 00999999990000 B= 01000000000000\r\n05161 goto 05151\r\n05151 a - 1 -&gt; a[m]      ; A= 00999999989000\r\n05152 goto 05150\r\n05150 c + 1 -&gt; c[p]      ; C= 01100000000002\r\n05151 a - 1 -&gt; a[m]      ; A= 00999999988000\r\n05152 goto 05150\r\n05150 c + 1 -&gt; c[p]      ; C= 01200000000002\r\n05151 a - 1 -&gt; a[m]      ; A= 00999999987000\r\n05152 goto 05150\r\n05150 c + 1 -&gt; c[p]      ; C= 01300000000002\r\n05151 a - 1 -&gt; a[m]      ; A= 00999999986000\r\n05152 goto 05150\r\n05150 c + 1 -&gt; c[p]      ; C= 01400000000002\r\n05151 a - 1 -&gt; a[m]      ; A= 00999999985000\r\n05152 goto 05150\r\n<\/pre>\n<p>Eventually a[m] will get to 0 and the loop above (05150 &#8211; 05152) will exit. That is because the &#8220;goto&#8221; has an implied &#8220;if no carry&#8221;. It&#8217;s just the way it works.<\/p>\n<p>05153 does a &#8220;rom 1&#8221; instruction so, after 10 billion (actual number involved) loops through the above with a blank display, we&#8217;d arrive at 00554 and something might happen.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>As discussed in HP-65 R\/S, the commonly available microcode for the HP-65 calculator goes into an (almost?) infinite loop if you press the [R\/S] key. Here&#8217;s what it looks like:<\/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\/1435"}],"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=1435"}],"version-history":[{"count":2,"href":"https:\/\/www.sydneysmith.com\/wordpress\/wp-json\/wp\/v2\/posts\/1435\/revisions"}],"predecessor-version":[{"id":1437,"href":"https:\/\/www.sydneysmith.com\/wordpress\/wp-json\/wp\/v2\/posts\/1435\/revisions\/1437"}],"wp:attachment":[{"href":"https:\/\/www.sydneysmith.com\/wordpress\/wp-json\/wp\/v2\/media?parent=1435"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sydneysmith.com\/wordpress\/wp-json\/wp\/v2\/categories?post=1435"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sydneysmith.com\/wordpress\/wp-json\/wp\/v2\/tags?post=1435"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}