{"id":1327,"date":"2015-12-02T20:49:52","date_gmt":"2015-12-02T20:49:52","guid":{"rendered":"http:\/\/www.sydneysmith.com\/wordpress\/?p=1327"},"modified":"2017-05-14T00:47:15","modified_gmt":"2017-05-14T00:47:15","slug":"the-hp65-wait-loop","status":"publish","type":"post","link":"https:\/\/www.sydneysmith.com\/wordpress\/1327\/the-hp65-wait-loop\/","title":{"rendered":"The HP65 Wait Loop"},"content":{"rendered":"<p>When the HP-65 calculator is sitting idle, waiting for you to get it to do something, what is it thinking? What&#8217;s going through its head? <!--more--><\/p>\n<p>Whilst seemingly idle, the HP-65 and any HP65 microcode emulator is busily spinning through a &#8220;wait loop&#8221; checking to see if you need it to do something. It looks like this:<\/p>\n<pre>\r\nwaitloop1:\r\n00726 if s9 = 0          ; S= 0...........\r\n00727 goto 00622\r\n\r\nwaitloop2:\r\n00622 12 -&gt; p            ; P= 12\r\n00623 if s0 = 0\r\n00624 goto 00452\r\n00452 0 -&gt; s10\r\n00453 if s5 = 0\r\n00454 goto 00750\r\n00750 if s8 = 0\r\n00751 goto 00441\r\n00441 0 -&gt; s11\r\n00442 0 -&gt; f0\r\n00443 if s11 = 0\r\n00444 goto 00620\r\n00620 if s8 = 0\r\n00621 goto 00531\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 =04820000000001\r\n00535 0 -&gt; s11\r\n00536 0 -&gt; f3\r\n00537 if s3 = 0\r\n00540 goto 00552\r\n00552 if s11 = 0\r\n00553 goto 00764\r\n\r\nwaitloop3:\r\n00764 if c[p] = 0\r\n00765 goto 00776\r\n00766 c - 1 -&gt; c[p]     ; C= 00000000000211\r\n00767 if c[p] = 0\r\n00770 goto 00717\r\n00771 c - 1 -&gt; c[p]     ; C= 00000000000201\r\n00772 if c[p] &gt;= 1\r\n00773 goto 00611\r\n\r\nwaitloop4:\r\n00774 c + 1 -&gt; c[p]     ; C= 00000000000211\r\n00775 c + 1 -&gt; c[p]     ; C= 00000000000221\r\n00776 c &lt;-&gt; m           ; C= 04820000000001 M =00000000000221\r\n00777 goto 00726\r\n<\/pre>\n<p>If you press a key, S0 gets set to 1 so the sequence<\/p>\n<pre>\r\n00623 if s0 = 0\r\n00624 goto 00452<\/pre>\n<p>proceeds to 00625.<\/p>\n<p>There&#8217;s more here which I&#8217;ll explore and cover shortly.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>When the HP-65 calculator is sitting idle, waiting for you to get it to do something, what is it thinking? What&#8217;s going through its head?<\/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\/1327"}],"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=1327"}],"version-history":[{"count":10,"href":"https:\/\/www.sydneysmith.com\/wordpress\/wp-json\/wp\/v2\/posts\/1327\/revisions"}],"predecessor-version":[{"id":1413,"href":"https:\/\/www.sydneysmith.com\/wordpress\/wp-json\/wp\/v2\/posts\/1327\/revisions\/1413"}],"wp:attachment":[{"href":"https:\/\/www.sydneysmith.com\/wordpress\/wp-json\/wp\/v2\/media?parent=1327"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sydneysmith.com\/wordpress\/wp-json\/wp\/v2\/categories?post=1327"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sydneysmith.com\/wordpress\/wp-json\/wp\/v2\/tags?post=1327"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}