mirror of
https://github.com/Michaelangel007/apple2_printm.git
synced 2025-01-19 21:29:55 +00:00
Ver 27
This commit is contained in:
parent
f586c92b55
commit
a2f25bbee8
30
printm.s
30
printm.s
@ -5,7 +5,7 @@
|
|||||||
.feature leading_dot_in_identifiers
|
.feature leading_dot_in_identifiers
|
||||||
.PC02 ; 65C02
|
.PC02 ; 65C02
|
||||||
|
|
||||||
/* Version 26
|
/* Version 27
|
||||||
printm - a modular micro printf replacement for 65C02
|
printm - a modular micro printf replacement for 65C02
|
||||||
Michael Pohoreski
|
Michael Pohoreski
|
||||||
Copyleft {c} Feb, 2016
|
Copyleft {c} Feb, 2016
|
||||||
@ -716,7 +716,7 @@ PrintDec
|
|||||||
|
|
||||||
LDX #5 ; was Y
|
LDX #5 ; was Y
|
||||||
DEY ; $FF - $FD = 2
|
DEY ; $FF - $FD = 2
|
||||||
@_BCD2Char: ; NOTE: Digits are reversed!
|
@BCD2Char: ; NOTE: Digits are reversed!
|
||||||
LDA _bcd-$FD,Y ; __c??? _b_?XX a_YYXX
|
LDA _bcd-$FD,Y ; __c??? _b_?XX a_YYXX
|
||||||
LSR
|
LSR
|
||||||
LSR
|
LSR
|
||||||
@ -733,7 +733,7 @@ PrintDec
|
|||||||
JSR COUT
|
JSR COUT
|
||||||
DEY
|
DEY
|
||||||
DEX
|
DEX
|
||||||
BPL @_BCD2Char
|
BPL @BCD2Char
|
||||||
RTS
|
RTS
|
||||||
|
|
||||||
; NOTE: Can't use printm PrintStr*() as it may not be enabled/available
|
; NOTE: Can't use printm PrintStr*() as it may not be enabled/available
|
||||||
@ -1192,9 +1192,13 @@ DEBUG .sprintf( "PrintDec2() @ %X", * )
|
|||||||
BNE @Dec2BCD
|
BNE @Dec2BCD
|
||||||
CLD
|
CLD
|
||||||
|
|
||||||
|
NEW_PRINT_DEC = 0
|
||||||
|
.if NEW_PRINT_DEC
|
||||||
|
DecWidth:
|
||||||
|
.endif
|
||||||
LDX #5 ; was Y
|
LDX #5 ; was Y
|
||||||
DEY ; $FF - $FD = 2
|
DEY ; $FF - $FD = 2
|
||||||
@_BCD2Char: ; NOTE: Digits are reversed!
|
@BCD2Char: ; NOTE: Digits are reversed!
|
||||||
LDA _bcd-$FD,Y ; __c??? _b_?XX a_YYXX
|
LDA _bcd-$FD,Y ; __c??? _b_?XX a_YYXX
|
||||||
LSR
|
LSR
|
||||||
LSR
|
LSR
|
||||||
@ -1202,21 +1206,35 @@ DEBUG .sprintf( "PrintDec2() @ %X", * )
|
|||||||
LSR
|
LSR
|
||||||
CLC
|
CLC
|
||||||
ADC #'0'+$80
|
ADC #'0'+$80
|
||||||
|
.if NEW_PRINT_DEC
|
||||||
|
JSR PutChar
|
||||||
|
.else
|
||||||
STA _bcd,X ; __c??X _b_YXX aZYYXX
|
STA _bcd,X ; __c??X _b_YXX aZYYXX
|
||||||
|
.endif
|
||||||
DEX ; was Y
|
DEX ; was Y
|
||||||
|
.if NEW_PRINT_DEC
|
||||||
|
BMI NextFormat
|
||||||
|
.endif
|
||||||
LDA _bcd-$FD,Y ; __c??X _b_YXX aZYYXX
|
LDA _bcd-$FD,Y ; __c??X _b_YXX aZYYXX
|
||||||
AND #$F
|
AND #$F
|
||||||
CLC
|
CLC
|
||||||
ADC #'0'+$80
|
ADC #'0'+$80
|
||||||
|
.if NEW_PRINT_DEC
|
||||||
|
JSR PutChar
|
||||||
|
.else
|
||||||
STA _bcd,X ; __c?XX _bYYXX ZZYYXX
|
STA _bcd,X ; __c?XX _bYYXX ZZYYXX
|
||||||
|
.endif
|
||||||
DEY
|
DEY
|
||||||
DEX
|
DEX
|
||||||
BPL @_BCD2Char
|
BPL @BCD2Char
|
||||||
|
|
||||||
|
.if NEW_PRINT_DEC
|
||||||
|
BMI NextFormat ; always
|
||||||
|
.else
|
||||||
DecWidth:
|
DecWidth:
|
||||||
LDX #0 ; _nDecDigits NOTE: self-modifying!
|
LDX #0 ; _nDecDigits NOTE: self-modifying!
|
||||||
JMP PrintReverseBCD
|
JMP PrintReverseBCD
|
||||||
|
.endif
|
||||||
.endif ; ENABLE_DEC
|
.endif ; ENABLE_DEC
|
||||||
|
|
||||||
; ______________________________________________________________________
|
; ______________________________________________________________________
|
||||||
|
Loading…
x
Reference in New Issue
Block a user