.TITLE OCTAL integer conversion .IDENT /02.02/ ; ; OCTAL converts the integer in R0 to octal ASCII representation with leading ; zeros, storing the result at the 4 word block pointed to by R1. ; Input: integer in R0 ; pointer to 4 word .ASCIZ string in R1 ; Output: octal ASCII string at location pointed to by R1 ; Linkage: PC ; affects no registers ; ; 10-JUL-2004 H. Rosenfeld replaced DIV by BIC and ROR ; 09-JUL-2004 H. Rosenfeld ; .ENABL REG .CSECT OCTAL:: MOV R0,-(SP) MOV R1,-(SP) MOV R2,-(SP) MOV R3,-(SP) MOV R1,R3 CLR R2 1$: MOV R0,R1 BIC #177770,R1 BIC R1,R0 CLC ROR R0 ROR R0 ROR R0 ADD #60,R1 MOV R1,-(SP) INC R2 CMP #6,R2 BNE 1$ 2$: MOVB (SP)+,(R3)+ SOB R2,2$ CLRB (R3) MOV (SP)+,R3 MOV (SP)+,R2 MOV (SP)+,R1 MOV (SP)+,R0 RTS PC .END