{"id":1366,"date":"2015-12-06T04:19:33","date_gmt":"2015-12-06T04:19:33","guid":{"rendered":"http:\/\/www.sydneysmith.com\/wordpress\/?p=1366"},"modified":"2017-05-14T00:46:54","modified_gmt":"2017-05-14T00:46:54","slug":"hp65-s5","status":"publish","type":"post","link":"https:\/\/www.sydneysmith.com\/wordpress\/1366\/hp65-s5\/","title":{"rendered":"HP65 s5 &#8211; Memory Full"},"content":{"rendered":"<p>s5 is used to record &#8220;memory full&#8221;. Here&#8217;s an example:<!--more--><\/p>\n<pre>\r\n                                         ; A= 02009999999999 \r\n05552 1 -&gt; s5                            ; S= .....5.....b\r\n05553 memory full -&gt; a                   ; A= 02009999999990\r\n05554 0 -&gt; p\r\n05555 if a[p] &gt;= 1\r\n05556 goto 05560\r\n05557 0 -&gt; s5                            ; S= ...........b\r\n05560 0 -&gt; a[w]                          ; A= 00000000000000\r\n<\/pre>\n<p>Initially, program memory starts with instructions for the [A] to [E] keys and then is padded out with NOPs. You see these as key code &#8220;35 01&#8243; if you SST far enough in W\/PRGM mode.<\/p>\n<p>The &#8216;memory full -&gt; a&#8221; microinstruction checks the end of program memory. If it contains a 0 (the program code for a NOP), A[0] gets set to zero. If not, you get something non-zero.<\/p>\n<p>The &#8220;0 -&gt; p&#8221; and &#8220;if a[p] &gt;= 1&#8221; check this. If A[0]=0 step 05557 happens and s5 &#8220;memory full&#8221; gets cleared. If A[0] isn&#8217;t 0, that step is skipped over and s5 stays set.<\/p>\n<p>Interestingly, if the program pointer (code 075) is in step 101, ie current step is step 100, this also results in A[0] being non-zero. This effect is used to show the &#8220;at step 100&#8221; leading and trailing minus signs.<\/p>\n<p>NOTE: s5 only has the &#8220;memory full&#8221; meaning when you are in W\/PRGM mode. In run mode, the same flag is used for <a href=\"http:\/\/www.sydneysmith.com\/wordpress\/1464\/hp-65-error-display\/\">error<\/a>. It never confuses the two because, unlike modern interrupt-driven systems, the microcode polls the RUN-W\/PRGM switch. This allows it to switch contexts when it is safe to do so (after the current activity has completed).<\/p>\n<p>You can see the s5 code and the subsequent display activity for a range of circumstances in <a href=\"http:\/\/www.sydneysmith.com\/products\/gss-hp65\/downloads\/65-wprgm-wait-loop.txt\" target=\"_blank\">65-wprgm-wait-loop.txt<\/a>. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>s5 is used to record &#8220;memory full&#8221;. Here&#8217;s an example:<\/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\/1366"}],"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=1366"}],"version-history":[{"count":5,"href":"https:\/\/www.sydneysmith.com\/wordpress\/wp-json\/wp\/v2\/posts\/1366\/revisions"}],"predecessor-version":[{"id":1476,"href":"https:\/\/www.sydneysmith.com\/wordpress\/wp-json\/wp\/v2\/posts\/1366\/revisions\/1476"}],"wp:attachment":[{"href":"https:\/\/www.sydneysmith.com\/wordpress\/wp-json\/wp\/v2\/media?parent=1366"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sydneysmith.com\/wordpress\/wp-json\/wp\/v2\/categories?post=1366"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sydneysmith.com\/wordpress\/wp-json\/wp\/v2\/tags?post=1366"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}