optimized hex byte printing, idea from Forum64

This commit is contained in:
FeralChild64 committed 2019-09-04 17:05:46 +02:00
1 parent 97c361af9c
commit 6114f982ec
2 files changed
+20 -22

No files matched your search

+10 -11
View File
@@ -139,20 +139,19 @@ printf_retreat:
rts
printf_printhexbyte:
;; Print the hex value in .A as two digits, idea by Haubitze
sed
pha
lsr
lsr
lsr
lsr
ora #$30
cmp #$3A
bcc +
adc #6
* jsr JCHROUT
cmp #$0A
adc #$30
jsr JCHROUT
pla
and #$0f
ora #$30
cmp #$3A
bcc +
adc #6
* jmp JCHROUT
and #$0F
cmp #$0A
adc #$30
cld
jmp JCHROUT
+10 -11
View File
@@ -139,20 +139,19 @@ printf_retreat:
rts
printf_printhexbyte:
;; Print the hex value in .A as two digits, idea by Haubitze
sed
pha
lsr
lsr
lsr
lsr
ora #$30
cmp #$3A
bcc +
adc #6
* jsr JCHROUT
cmp #$0A
adc #$30
jsr JCHROUT
pla
and #$0f
ora #$30
cmp #$3A
bcc +
adc #6
* jmp JCHROUT
and #$0F
cmp #$0A
adc #$30
cld
jmp JCHROUT