{"id":1374,"date":"2015-12-06T11:42:17","date_gmt":"2015-12-06T11:42:17","guid":{"rendered":"http:\/\/www.sydneysmith.com\/wordpress\/?p=1374"},"modified":"2017-05-15T12:15:49","modified_gmt":"2017-05-15T12:15:49","slug":"hp-67-program-binary-view-by-class67","status":"publish","type":"post","link":"https:\/\/www.sydneysmith.com\/wordpress\/1374\/hp-67-program-binary-view-by-class67\/","title":{"rendered":"HP-67 Program &#8211; Binary View by Class&#8217;67"},"content":{"rendered":"<p>Here&#8217;s a program from a contributor, Class&#8217;67. It does high precision base conversions. In his words: <!--more--><\/p>\n<h2>Gss HP-67 Binary View<\/h2>\n<p>v0.07, 12\/04\/2015  by  Class&#8217;67<\/p>\n<p>Store these constants for D2B &#038; B2D programs:<\/p>\n<table>\n<tr>\n<td>Reg.<\/td>\n<td>Value<\/td>\n<\/tr>\n<tr>\n<td>A<\/td>\n<td>2^32<\/td>\n<\/tr>\n<tr>\n<td>B<\/td>\n<td>2^16<\/td>\n<\/tr>\n<tr>\n<td>C<\/td>\n<td>&nbsp;<\/td>\n<\/tr>\n<tr>\n<td>D<\/td>\n<td>&nbsp;<\/td>\n<\/tr>\n<tr>\n<td>E<\/td>\n<td>&nbsp;<\/td>\n<\/tr>\n<tr>\n<td>R04<\/td>\n<td>.01  (adjust for best EXT operation)<\/td>\n<\/tr>\n<\/table>\n<p>CNV  &#8211;  Convert Z in base Y to base X. (Lbl A)<br \/>\nBinary form of decimals up to 2^16 can be viewed in R00 in Data screen.<br \/>\nUses registers R00 &#8211; R03.<\/p>\n<p>D2B  &#8211;  Decimal to binary conversion. (Lbl B)<br \/>\nUses Data Screen to display binary expansion of decimal values.<br \/>\nex.  33554499 = 2^25 + 67<\/p>\n<p>QR  &#8211;  Quotient_Remainder function. (Lbl C)<br \/>\nReturns remainder in X and quotient in Y, Z, and T.  ( Y, X &gt; 0 )  Uses R09.<\/p>\n<p>B2D  &#8211;  Binary to decimal conversion. (Lbl D)<br \/>\nUsing the Data Screen view, input binary number in registers R05 &#8211; R07. Leading zeros are not required. Result is stored in R08. Uses registers R01 &#8211; R09, RA, RB, and R25.  <\/p>\n<p>DblD  &#8211;  Double input for D2B and CNV. (Lbl d)<br \/>\nThis extends the input range to 2^48 &#8211; 1.<\/p>\n<p>To use the D2B routine, Press [ d ],<br \/>\nAt the prompt (1),  input the left half of the number to convert. Press [R\/S].<br \/>\nAt the prompt (2),  input the right half of the number to convert. Press [R\/S].<\/p>\n<p>ex.  Convert  145678901456789  to binary.<\/p>\n<p>Press [ d ].<br \/>\n(1) 1.4567890 E14 [R\/S]<br \/>\n(2) 1456789 [R\/S]<br \/>\nView Data screen.<br \/>\n05:   1000010001111110<br \/>\n06:   1000001100101100<br \/>\n07:   10111110010101<br \/>\n08:   12181<\/p>\n<p>To use the CNV routine,  first Set Flag 2.<br \/>\nStore &#8216;from base&#8217; in R01.<br \/>\nStore &#8216;to base&#8217; in R03.<br \/>\nPress [ d ].  <\/p>\n<p>ex.  Convert  6767676767676767(octal) to decimal using the CNV routine.<\/p>\n<p>Set Flag 2.<br \/>\nStore 8 in R01.<br \/>\nStore 10 in R03.<br \/>\nPress [ d ].<br \/>\n(1) 6.7676767 E15 [R\/S]<br \/>\n(2) 67676767 [R\/S]<br \/>\nView R00 in Data screen.<br \/>\n00:   245732122525175<\/p>\n<p>EXT  &#8211;  Extracts the X&#8217;th digit from Y. (Lbl E)<br \/>\n(uses constant in R04)<\/p>\n<p>Nbits  &#8211;  Calculates the number of bits in the binary expansion of X.  (Lbl b)<\/p>\n<p>(   )  &#8211;  D2B and DblD subroutine. (Lbl a)<\/p>\n<p>CSR  &#8211;  Clear Summation Registers. (Lbl c)<\/p>\n<p>(   )  &#8211;  Binary extraction subroutine. (Lbl e)<\/p>\n<p>Note:  Flag 1 will be left set by DblD. This will not affect operation of other routines.<\/p>\n<p>Here&#8217;s the program in gss-hp67 format:<\/p>\n<pre>\r\nPROG\r\n224\r\n001: 31 25 11\r\n002: 35 61 01\r\n003: 33 03\r\n004: 35 53\r\n005: 33 01\r\n006: 32 25 11\r\n007: 35 71 01\r\n008: 34 01\r\n009: 41\r\n010: 31 22 03\r\n011: 31 22 00\r\n012: 34 03\r\n013: 31 22 03\r\n014: 33 01\r\n015: 34 03\r\n016: 31 25 00\r\n017: 33 02\r\n018: 51\r\n019: 35 52\r\n020: 33 00\r\n021: 31 25 01\r\n022: 34 01\r\n023: 35 52\r\n024: 34 02\r\n025: 81\r\n026: 31 83\r\n027: 31 51\r\n028: 22 02\r\n029: 35 53\r\n030: 71\r\n031: 35 53\r\n032: 71\r\n033: 33 61 00\r\n034: 35 53\r\n035: 22 01\r\n036: 31 25 02\r\n037: 34 00\r\n038: 35 22\r\n039: 31 25 03\r\n040: 01\r\n041: 51\r\n042: 31 53\r\n043: 31 83\r\n044: 01\r\n045: 61\r\n046: 32 53\r\n047: 35 22\r\n048: 31 25 15\r\n049: 32 53\r\n050: 81\r\n051: 32 83\r\n052: 34 04\r\n053: 61\r\n054: 01\r\n055: 00\r\n056: 71\r\n057: 31 83\r\n058: 35 22\r\n059: 31 25 12\r\n060: 35 51 01\r\n061: 33 08\r\n062: 00\r\n063: 33 05\r\n064: 33 06\r\n065: 33 07\r\n066: 61\r\n067: 02\r\n068: 33 03\r\n069: 44\r\n070: 01\r\n071: 00\r\n072: 33 01\r\n073: 44\r\n074: 34 11\r\n075: 32 81\r\n076: 22 06\r\n077: 31 22 13\r\n078: 33 08\r\n079: 35 52\r\n080: 32 22 11\r\n081: 33 05\r\n082: 34 08\r\n083: 41\r\n084: 31 25 06\r\n085: 44\r\n086: 34 12\r\n087: 32 81\r\n088: 22 07\r\n089: 31 22 13\r\n090: 33 08\r\n091: 35 54\r\n092: 32 22 11\r\n093: 33 06\r\n094: 34 08\r\n095: 41\r\n096: 31 25 07\r\n097: 44\r\n098: 61\r\n099: 32 22 11\r\n100: 33 07\r\n101: 35 61 01\r\n102: 35 22\r\n103: 31 25 13\r\n104: 33 09\r\n105: 35 52\r\n106: 41\r\n107: 41\r\n108: 34 09\r\n109: 81\r\n110: 31 83\r\n111: 41\r\n112: 41\r\n113: 35 53\r\n114: 35 53\r\n115: 34 09\r\n116: 71\r\n117: 51\r\n118: 35 22\r\n119: 32 25 13\r\n120: 31 42\r\n121: 00\r\n122: 33 04\r\n123: 33 05\r\n124: 33 06\r\n125: 33 07\r\n126: 33 08\r\n127: 33 09\r\n128: 61\r\n129: 31 42\r\n130: 35 22\r\n131: 32 25 12\r\n132: 31 53\r\n133: 02\r\n134: 31 53\r\n135: 81\r\n136: 01\r\n137: 61\r\n138: 31 83\r\n139: 35 22\r\n140: 31 25 14\r\n141: 35 61 01\r\n142: 01\r\n143: 09\r\n144: 42\r\n145: 33 02\r\n146: 01\r\n147: 06\r\n148: 33 03\r\n149: 00\r\n150: 33 08\r\n151: 34 05\r\n152: 31 51\r\n153: 22 06\r\n154: 34 11\r\n155: 33 09\r\n156: 34 05\r\n157: 32 22 15\r\n158: 31 25 06\r\n159: 34 06\r\n160: 31 51\r\n161: 22 07\r\n162: 34 12\r\n163: 33 09\r\n164: 34 06\r\n165: 32 22 15\r\n166: 31 25 07\r\n167: 01\r\n168: 33 09\r\n169: 34 07\r\n170: 31 51\r\n171: 22 09\r\n172: 32 25 15\r\n173: 33 01\r\n174: 34 03\r\n175: 35 33\r\n176: 22 08\r\n177: 35 33\r\n178: 31 25 08\r\n179: 34 09\r\n180: 02\r\n181: 35 34\r\n182: 01\r\n183: 51\r\n184: 35 63\r\n185: 71\r\n186: 34 01\r\n187: 35 34\r\n188: 31 22 15\r\n189: 71\r\n190: 33 61 08\r\n191: 31 33\r\n192: 35 71 01\r\n193: 22 09\r\n194: 34 02\r\n195: 35 24\r\n196: 22 24\r\n197: 31 25 09\r\n198: 34 08\r\n199: 35 22\r\n200: 32 25 14\r\n201: 01\r\n202: 84\r\n203: 33 08\r\n204: 02\r\n205: 84\r\n206: 33 61 08\r\n207: 34 08\r\n208: 35 51 01\r\n209: 35 71 02\r\n210: 22 31 11\r\n211: 22 12\r\n212: 84\r\n213: 84\r\n214: 84\r\n215: 84\r\n216: 84\r\n217: 84\r\n218: 84\r\n219: 84\r\n220: 84\r\n221: 84\r\n222: 84\r\n223: 84\r\n224: 84\r\nSTATE\r\n7\r\nDEG\r\nFIX\r\n9\r\n0\r\n0\r\n0\r\n1\r\nCARD\r\n11\r\nTitle: Binary View\r\nA: CNV\r\nB: D2B\r\nC: QR\r\nD: B2D\r\nE: EXT\r\na: \r\nb: Nbits\r\nc: CSR\r\nd: DblD\r\ne: \r\nHELP\r\n16\r\nGss HP-67 Binary View\r\n v0.07,  12\/04\/2015  by  Class'67\r\n\r\nA)  Convert Z in base Y to base X.\r\nB)  Decimal to binary converter.\r\nb)  Number of bits in decimal X.\r\nC)  Quotient_Remainder function.\r\nc)  Clear summation registers.\r\nD)  Binary to decimal converter.\r\nd)  Double input for D2B and CNV.\r\nE)  Extract the X'th digit from Y.\r\n      \r\nNotes:\r\nStore  2^32 in Reg. RA \r\nStore  2^16 in Reg. RB\r\nStore  .01 in Reg. R04\r\nEND\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Here&#8217;s a program from a contributor, Class&#8217;67. It does high precision base conversions. In his words:<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[16,5,3,51],"tags":[38],"_links":{"self":[{"href":"https:\/\/www.sydneysmith.com\/wordpress\/wp-json\/wp\/v2\/posts\/1374"}],"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=1374"}],"version-history":[{"count":5,"href":"https:\/\/www.sydneysmith.com\/wordpress\/wp-json\/wp\/v2\/posts\/1374\/revisions"}],"predecessor-version":[{"id":1511,"href":"https:\/\/www.sydneysmith.com\/wordpress\/wp-json\/wp\/v2\/posts\/1374\/revisions\/1511"}],"wp:attachment":[{"href":"https:\/\/www.sydneysmith.com\/wordpress\/wp-json\/wp\/v2\/media?parent=1374"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sydneysmith.com\/wordpress\/wp-json\/wp\/v2\/categories?post=1374"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sydneysmith.com\/wordpress\/wp-json\/wp\/v2\/tags?post=1374"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}