{"id":1486,"date":"2016-01-01T23:02:20","date_gmt":"2016-01-01T23:02:20","guid":{"rendered":"http:\/\/www.sydneysmith.com\/wordpress\/?p=1486"},"modified":"2017-05-14T00:40:37","modified_gmt":"2017-05-14T00:40:37","slug":"hp-65-number-entry","status":"publish","type":"post","link":"https:\/\/www.sydneysmith.com\/wordpress\/1486\/hp-65-number-entry\/","title":{"rendered":"HP-65 Number Entry"},"content":{"rendered":"<p>Here&#8217;s what happens internally when you enter a number into a HP-65 calculator: <!--more--><\/p>\n<pre>\r\nstartup \" 0.00\"\r\nA =00000000000999 C =00000000000000\r\nB =02009999999999 M =00000000000221 P =1\r\nS =............   f =..2..5..\r\n\r\npress 1 see \" 1.\"\r\nA =01000000000000 C =01000000000000\r\nB =02999999999999 M =00000000000221 P =1\r\nS =.1..........   f =.12..5..\r\n\r\npress 2 see \" 12.\"\r\nA =01200000000000 C =01200000000001\r\nB =00299999999999 M =00000000000221 P =1\r\nS =.1..........   f =.12..5..\r\n\r\npress 3 see \" 123.\"\r\nA =01230000000000 C =01230000000002\r\nB =00029999999999 M =00000000000221 P =1\r\nS =.1..........   f =.12..5..\r\n\r\npress . see \" 123.\"\r\nA =01230000000000 C =01230000000002\r\nB =00029999999999 M =00000000000221 P =1\r\nS =.12.........   f =.12..5..\r\n\r\npress 4 see \" 123.4\"\r\nA =01234000000000 C =01234000000002\r\nB =00020999999999 M =00000000000221 P =1\r\nS =.12.........   f =.12..5..\r\n\r\npress 5 see \" 123.45\"\r\nA =01234500000000 C =01234500000002\r\nB =00020099999999 M =00000000000221 P =1\r\nS =.12.........   f =.12..5..\r\n\r\npress 6 see \" 123.456\"\r\nA =01234560000000 C =01234560000002\r\nB =00020009999999 M =00000000000221 P =1\r\nS =.12.........   f =.12..5..\r\n\r\npress [EEX] see \" 123.456     00\"\r\nA =01234560000000 C =01234560000002\r\nB =00020009999000 M =00000000000221 P =1\r\nS =.12....7....   f =.12..5..\r\n\r\npress 8 see \" 123.456     08\"\r\nA =01234560000008 C =01234560000010\r\nB =00020009999000 M =00000000000221 P =1\r\nS =.12....7....   f =.12..5..\r\n\r\npress 9 see \" 123.456     89\"\r\nA =01234560000089 C =01234560000091\r\nB =00020009999000 M =00000000000221 P =1\r\nS =.12....7....   f =.12..5..\r\n\r\npress [CHS] see \" 123.456    -89\"\r\nA =01234560000989 C =01234560000913\r\nB =00020009999000 M =00000000000221 P =1\r\nS =.12....7....   f =.12..5..\r\n\r\npress [ENTER] see \" 0.00\"\r\nA =00001234560999 C =01234560000913\r\nB =02009999999999 M =00000000000221 P =1\r\nS =............   f =..2..5..\r\nD =01234560000913\r\n<\/pre>\n<p>Interestingly, it doesn&#8217;t switch to SCI display for small numbers. I was expecting to see &#8221; 1.2346 -87&#8243;. This must have been introduced after the HP-65.<\/p>\n<p>It looks like [.] sets s2 and [EEX] sets s7.<\/p>\n<p>An exponent of -87 is stored as &#8220;913&#8221; (1000 + -87).<\/p>\n<p>You can see that [ENTER] has copied stack X (C register) to stack Y (D register).<\/p>\n<p>The value in C is always the current stack X value. As digits get added this gets updated. It isn&#8217;t just a copy of what has been keyed so far, into the A register &#8211; the C register exponent is updated too.<\/p>\n<p>The A and B registers match standard classic calculator behaviour. I&#8217;m having trouble finding the article that described it to me years ago but it comes down to:<\/p>\n<ul>\n<li>What is in the A register is what appears in the display.<\/li>\n<li>That is modified by the B register: a 0 allows the A digit to appear, a 9 hides it (blank \/ off), a 2 inserts a decimal point to the right.<\/li>\n<\/ul>\n<p>You can see this above by comparing the &#8220;see &#8230;&#8221; and the &#8220;A=&#8221; and &#8220;B=&#8221; values.<\/p>\n<p>There isn&#8217;t a counter of which digit it is up to. It has to work that out each time.<\/p>\n<p>Pressing EEX sets a flag but also clears the bottom three digits in B from &#8220;9&#8221;s to &#8220;0&#8221;s. This lets the exponent digits show.<\/p>\n<p>Digits 13 (leftmost) and 3 are sign digits. They are wired to only show as &#8221; &#8221; or &#8220;-&#8220;. A &#8220;9&#8221; in those positions shows as &#8220;-&#8220;. A &#8220;0&#8221; shows as &#8221; &#8221; (for positive).<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Here&#8217;s what happens internally when you enter a number into a HP-65 calculator:<\/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],"_links":{"self":[{"href":"https:\/\/www.sydneysmith.com\/wordpress\/wp-json\/wp\/v2\/posts\/1486"}],"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=1486"}],"version-history":[{"count":2,"href":"https:\/\/www.sydneysmith.com\/wordpress\/wp-json\/wp\/v2\/posts\/1486\/revisions"}],"predecessor-version":[{"id":1488,"href":"https:\/\/www.sydneysmith.com\/wordpress\/wp-json\/wp\/v2\/posts\/1486\/revisions\/1488"}],"wp:attachment":[{"href":"https:\/\/www.sydneysmith.com\/wordpress\/wp-json\/wp\/v2\/media?parent=1486"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sydneysmith.com\/wordpress\/wp-json\/wp\/v2\/categories?post=1486"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sydneysmith.com\/wordpress\/wp-json\/wp\/v2\/tags?post=1486"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}