.TITLE CVTBO - Convert binary to decimal. .VERSION 20 .ENABLE 7BIT / ++ / CVTBO 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 CVTBO / / CVTBO converts a binary to octal ascii. / 0 /For return address. DCA VAL$ /Save value. TAD I CVTBO /Get arg1. ISZ CVTBO DCA DP$ /Save as dest. pointer. RDF /Get return field. TAD (CDF CIF) DCA R$ TAD (-4) /Set loop count to 4. DCA LC$ 1$: TAD VAL$ /Get value. RTL;RAL /Shift one digit left. DCA VAL$ /Save value. TAD VAL$ RAL /Shift high digit into low digit. AND (7) /Mask low digit. TAD (60) /Asciify. DCA I DP$ /Save char. ISZ DP$ /Bump pointer. ISZ LC$ /Bump count. JMP 1$ /Repeat. R$: HLT /Return field. JMP I CVTBO /Return. VAL$: 0 /Value. DP$: 0 /Destination pointer. LC$: 0 /Loop count. / $