calcout
public text v1 · immutable*Prints answer to lcd*
Print
psha
pshb
pshx
pshy
ldaa #$01
jsr LCDOutCmd
clra
ldy #0 Number of characters
xgdx
ODloop ldx #10 Reg D = input
idiv RegB is digit, RegX is rest of input
pshb Save for later, reverse order
iny
xgdx
cpd #0 Continue until
bne ODloop
ODout pula next digit
adda #'0' convert 0-9 to ASCII 0-9
jsr LCDOutChar
DEY
DEY
DP_Done INY
CPY #$00
BNE ODout
MSG_Done puly
pulx
pulb
pula
rts
*Finish Print command*