{"id":1368,"date":"2015-12-06T05:22:23","date_gmt":"2015-12-06T05:22:23","guid":{"rendered":"http:\/\/www.sydneysmith.com\/wordpress\/?p=1368"},"modified":"2017-05-14T00:46:35","modified_gmt":"2017-05-14T00:46:35","slug":"hp65-s3","status":"publish","type":"post","link":"https:\/\/www.sydneysmith.com\/wordpress\/1368\/hp65-s3\/","title":{"rendered":"HP65 s3 &#8211; W\/PRGM"},"content":{"rendered":"<p>The HP-65 calculator has an internal set of status flags known as the &#8220;s register&#8221;. &#8220;s3&#8221; is one of those flags but it behaves a bit strangely &#8230; <!--more--><\/p>\n<p>Any check of s3 doesn&#8217;t do what you&#8217;d expect. For example:<\/p>\n<pre>\r\n                          ; S= ............\r\n00537 if s3 = 0\r\n00540 goto 00552          ; ??? didn't go 0552 yet s3 doesn't seem set\r\n00541 if s11 = 0\r\n<\/pre>\n<p>s3 is clearly 0 yet &#8220;if s3 = 0&#8221; didn&#8217;t go where one would expect.<\/p>\n<p>There is something going on &#8220;under the hood&#8221; here. The tests(num) function that does the &#8220;if sN = 0&#8221; microcode instruction sets carry if sN is 1; OR rN is 1. More flags!<\/p>\n<p>rN is labelled in the code as &#8220;hard status for HP-55&#8221;. It looks like there are some hardware attachments of some type that can be wired in to override individual bits of the s register. This is similar to the s3 flag being used by the HP-67 for status information from the card reader (eg execute a &#8220;CRC ready? command&#8221; then test &#8220;if s3 = 1&#8221;). With the &#8217;67 it is obvious because the hardware actually sets the s3 flag. It shows as &#8220;S= &#8230;3&#8230;&#8230;..&#8221;.<\/p>\n<p>The catch with the &#8217;65 is the s3 flag appears clear but tests as if set (because r3 is). The behaviour doesn&#8217;t match what the presented status info suggests.<\/p>\n<p>The only use of the 12 HP-55 &#8220;r&#8221; flags in the HP-65 is r[3]. This is 1 if the relevant slide switch is at W\/PRGM and 0 if it is in the RUN position.<\/p>\n<p>So s3 means W\/PRGM &#8211; but you&#8217;ll never notice it being set. Something to be aware of in microcode traces.<\/p>\n<p>It might have been better if s3 were directly tied to the W\/PRGM-RUN switch and couldn&#8217;t be cleared or set by software. I&#8217;m not sure whether the HP-65 microcode ROMs would work with that but, if so, it would show what&#8217;s happening a lot better.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The HP-65 calculator has an internal set of status flags known as the &#8220;s register&#8221;. &#8220;s3&#8221; is one of those flags but it behaves a bit strangely &#8230;<\/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\/1368"}],"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=1368"}],"version-history":[{"count":3,"href":"https:\/\/www.sydneysmith.com\/wordpress\/wp-json\/wp\/v2\/posts\/1368\/revisions"}],"predecessor-version":[{"id":1373,"href":"https:\/\/www.sydneysmith.com\/wordpress\/wp-json\/wp\/v2\/posts\/1368\/revisions\/1373"}],"wp:attachment":[{"href":"https:\/\/www.sydneysmith.com\/wordpress\/wp-json\/wp\/v2\/media?parent=1368"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sydneysmith.com\/wordpress\/wp-json\/wp\/v2\/categories?post=1368"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sydneysmith.com\/wordpress\/wp-json\/wp\/v2\/tags?post=1368"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}