.TITLE CVTOB - Convert binary to decimal. .VERSION 20 .ENABLE 7BIT / ++ / CVTOB Y2.0 / / (c) 1988, 1989 by Johnny Billquist / / History: / / 88/12/29 15:15 BQT X1.0. Initial coding. / 89/01/04 15:35 BQT X1.1. Split into PRSLIB. / 89/12/27 05:00 BQT Y2.0. Made from STRLIB. / / -- / .FSECT CVTOB / / CVTOB convert an octal ascii string into binary. / 0 /For return address. CLA TAD I CVTOB /Get arg1. ISZ CVTOB DCA SP$ /Save as source pointer. RDF /Get return field. TAD (CDF CIF) DCA R$ DCA V$ /Clear value. 1$: TAD I SP$ /Get char. ISZ SP$ /Bump pointer. TAD (-60) /Check if octal digit. SPA JMP E$ /Was not. TAD (-10) SMA JMP E$ /Was not. TAD (10) DCA T$ /Was. Save number. TAD V$ /Get value. RTL;RAL /Shift one digit left. AND (7770) /Clear low digit. TAD T$ /Insert number at low digit. DCA V$ /Save value. JMP 1$ /Repeat. E$: CLA /End of convert. TAD V$ /Get value. R$: HLT /Return field. JMP I CVTOB /Return. SP$: 0 /Source pointer. V$: 0 /Value. T$: 0 /Number. / $