.include "labmac.i" .section .text .globl main main: MOVE.L #255, D1 JSR outint MOVE.L #1234567890, D1 JSR outint MOVE.L #99775533, D1 JSR outint RTS outint: MOVE.L #intstr+10, A0 | pointer A0 behind last digit loop: DIVUL.L #10, D2:D1 | D1 := D1/10, D2 := remainder ADD.B #'0', D2 | make D2 digit character MOVE.B D2, -(A0) | write digit TST.L D1 | check quotient BNE loop | while ? 0 repeat with quotient in D1 print: CALLEXEC LCD_PutString | call string print (address in A0) RTS intstr: .asciz "1234567890 " | number can have up to 10 digits