All pastes #476661 Raw Edit

calcout

public text v1 · immutable
·published 2007-05-08 08:03 UTC
rendered paste body
*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*