{"id":1850,"date":"2018-02-09T12:19:43","date_gmt":"2018-02-09T12:19:43","guid":{"rendered":"http:\/\/www.sydneysmith.com\/wordpress\/?p=1850"},"modified":"2018-02-09T12:34:20","modified_gmt":"2018-02-09T12:34:20","slug":"hp29-scan-codes","status":"publish","type":"post","link":"https:\/\/www.sydneysmith.com\/wordpress\/1850\/hp29-scan-codes\/","title":{"rendered":"HP-29 Scan Codes"},"content":{"rendered":"<p>A calculator keyboard gets scanned to see which, if any, key has been pressed.<\/p>\n<p>It is a fairly simple process. The calculator activates each keyboard row in turn, and checks to see if a signal appears in any of the columns. Each key connects a different row to a different column. It looks like this:<!--more--><\/p>\n<p><a href=\"http:\/\/www.sydneysmith.com\/wordpress\/wp-content\/uploads\/2018\/02\/2018020901-gss-5x7-keyboard.png\"><img loading=\"lazy\" src=\"http:\/\/www.sydneysmith.com\/wordpress\/wp-content\/uploads\/2018\/02\/2018020901-gss-5x7-keyboard-239x300.png\" alt=\"5x7 keyboard\" width=\"239\" height=\"300\" class=\"alignnone size-medium wp-image-1851\" srcset=\"https:\/\/www.sydneysmith.com\/wordpress\/wp-content\/uploads\/2018\/02\/2018020901-gss-5x7-keyboard-239x300.png 239w, https:\/\/www.sydneysmith.com\/wordpress\/wp-content\/uploads\/2018\/02\/2018020901-gss-5x7-keyboard.png 340w\" sizes=\"(max-width: 239px) 100vw, 239px\" \/><\/a><br \/>\n(from <a href=\"http:\/\/www.hpl.hp.com\/hpjournal\/pdfs\/IssuePDFs\/1975-11.pdf\" rel=\"noopener\" target=\"_blank\">HP Journal, 1975-11<\/a>, page 9)<\/p>\n<p>There&#8217;s up to 5 keys across, and there&#8217;s 7 rows of keys.<\/p>\n<p>The ENTER key is always the first key (LHS) on the third row (from the top). It is a wide key, that occupies two positions on the grid. I&#8217;m not sure of the exact mechanics, but it only presses the first switch. The other three keys on the same row appear in the third, fourth and fifth columns.<\/p>\n<p>The row values (top to bottom) are: 0xb0, 0x40, 0xd0, 0x60, 0xa0, 0x70 and 0x90.<br \/>\nThe column values (L-&gt;R) are: 3, 2, 1, 0 and 4.<\/p>\n<p>This means the ENTER key causes a scan code of (row 3 + col 1) 0xd0 + 3 or 0xd3.<\/p>\n<p>In the microcode, when the calculator does a &#8220;keys -> a&#8221; instruction and the ENTER key has been pressed, 0xd appears in A[2] and 0x3 appears in A[1].<\/p>\n<p>This means the scancodes are:<\/p>\n<table>\n<tr>\n<td>Row<\/td>\n<td>Col<\/td>\n<td>Key<\/td>\n<td>Scancode<\/td>\n<\/tr>\n<tr>\n<td>1<\/td>\n<td>1<\/td>\n<td>SST<\/td>\n<td>0xb3<\/td>\n<\/tr>\n<tr>\n<td>1<\/td>\n<td>2<\/td>\n<td>GSB<\/td>\n<td>0xb2<\/td>\n<\/tr>\n<tr>\n<td>1<\/td>\n<td>3<\/td>\n<td>GTO<\/td>\n<td>0xb1<\/td>\n<\/tr>\n<tr>\n<td>1<\/td>\n<td>4<\/td>\n<td>f  <\/td>\n<td>0xb0<\/td>\n<\/tr>\n<tr>\n<td>1<\/td>\n<td>5<\/td>\n<td>g  <\/td>\n<td>0xb4<\/td>\n<\/tr>\n<tr>\n<td>2<\/td>\n<td>1<\/td>\n<td>x<->y<\/td>\n<td>0x43<\/td>\n<\/tr>\n<tr>\n<td>2<\/td>\n<td>2<\/td>\n<td>Rv <\/td>\n<td>0x42<\/td>\n<\/tr>\n<tr>\n<td>2<\/td>\n<td>3<\/td>\n<td>STO<\/td>\n<td>0x41<\/td>\n<\/tr>\n<tr>\n<td>2<\/td>\n<td>4<\/td>\n<td>RCL<\/td>\n<td>0x40<\/td>\n<\/tr>\n<tr>\n<td>2<\/td>\n<td>5<\/td>\n<td>SUM<\/td>\n<td>0x44<\/td>\n<\/tr>\n<tr>\n<td>3<\/td>\n<td>1<\/td>\n<td>ENTER<\/td>\n<td>0xd3<\/td>\n<\/tr>\n<tr>\n<td>3<\/td>\n<td>3<\/td>\n<td>CHS<\/td>\n<td>0xd1<\/td>\n<\/tr>\n<tr>\n<td>3<\/td>\n<td>4<\/td>\n<td>EEX<\/td>\n<td>0xd0<\/td>\n<\/tr>\n<tr>\n<td>3<\/td>\n<td>5<\/td>\n<td>CLx<\/td>\n<td>0xd4<\/td>\n<\/tr>\n<tr>\n<td>4<\/td>\n<td>1<\/td>\n<td>&#8211;<\/td>\n<td>0x63<\/td>\n<\/tr>\n<tr>\n<td>4<\/td>\n<td>2<\/td>\n<td>7<\/td>\n<td>0x62<\/td>\n<\/tr>\n<tr>\n<td>4<\/td>\n<td>3<\/td>\n<td>8<\/td>\n<td>0x61<\/td>\n<\/tr>\n<tr>\n<td>4<\/td>\n<td>4<\/td>\n<td>9<\/td>\n<td>0x60<\/td>\n<\/tr>\n<tr>\n<td>5<\/td>\n<td>1<\/td>\n<td>+<\/td>\n<td>0xa3<\/td>\n<\/tr>\n<tr>\n<td>5<\/td>\n<td>2<\/td>\n<td>4<\/td>\n<td>0xa2<\/td>\n<\/tr>\n<tr>\n<td>5<\/td>\n<td>3<\/td>\n<td>5<\/td>\n<td>0xa1<\/td>\n<\/tr>\n<tr>\n<td>5<\/td>\n<td>4<\/td>\n<td>6<\/td>\n<td>0xa0<\/td>\n<\/tr>\n<tr>\n<td>6<\/td>\n<td>1<\/td>\n<td>x<\/td>\n<td>0x73<\/td>\n<\/tr>\n<tr>\n<td>6<\/td>\n<td>2<\/td>\n<td>1<\/td>\n<td>0x72<\/td>\n<\/tr>\n<tr>\n<td>6<\/td>\n<td>3<\/td>\n<td>2<\/td>\n<td>0x71<\/td>\n<\/tr>\n<tr>\n<td>6<\/td>\n<td>4<\/td>\n<td>3<\/td>\n<td>0x70<\/td>\n<\/tr>\n<tr>\n<td>7<\/td>\n<td>1<\/td>\n<td>\/<\/td>\n<td>0x93<\/td>\n<\/tr>\n<tr>\n<td>7<\/td>\n<td>2<\/td>\n<td>0<\/td>\n<td>0x92<\/td>\n<\/tr>\n<tr>\n<td>7<\/td>\n<td>3<\/td>\n<td>.<\/td>\n<td>0x91<\/td>\n<\/tr>\n<tr>\n<td>7<\/td>\n<td>4<\/td>\n<td>R\/S<\/td>\n<td>0x90<\/td>\n<\/tr>\n<\/table>\n<p>These are the same scancodes for the button positions, as those used for the HP25.<\/p>\n<p>This is part of the <a href=\"http:\/\/www.sydneysmith.com\/wordpress\/hp29-main\/\">HP-29 topic<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A calculator keyboard gets scanned to see which, if any, key has been pressed. It is a fairly simple process. The calculator activates each keyboard row in turn, and checks to see if a signal appears in any of the columns. Each key connects a different row to a different column. It looks like this:<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[16,5,64],"tags":[65,32],"_links":{"self":[{"href":"https:\/\/www.sydneysmith.com\/wordpress\/wp-json\/wp\/v2\/posts\/1850"}],"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=1850"}],"version-history":[{"count":4,"href":"https:\/\/www.sydneysmith.com\/wordpress\/wp-json\/wp\/v2\/posts\/1850\/revisions"}],"predecessor-version":[{"id":1856,"href":"https:\/\/www.sydneysmith.com\/wordpress\/wp-json\/wp\/v2\/posts\/1850\/revisions\/1856"}],"wp:attachment":[{"href":"https:\/\/www.sydneysmith.com\/wordpress\/wp-json\/wp\/v2\/media?parent=1850"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sydneysmith.com\/wordpress\/wp-json\/wp\/v2\/categories?post=1850"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sydneysmith.com\/wordpress\/wp-json\/wp\/v2\/tags?post=1850"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}