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