fix bug in print_integer with digit 9

This commit is contained in:
Paul Gardner-Stephen committed 2019-05-05 00:25:15 +09:30
1 parent 5586e61ab9
commit 74aaf9fe3f
1 file changed
+5 -1
+5 -1
View File
@@ -80,17 +80,21 @@ next_hi_bit:
cpy #$7f cpy #$7f
bcc hi_loop bcc hi_loop
fix_carry:
;; Deal with any carries ;; Deal with any carries
ldx #3 ldx #3
carry_fix_loop: carry_fix_loop:
lda $0101,x lda $0101,x
cmp #9 cmp #10
bcc + bcc +
inc $0100,x inc $0100,x
sec sec
sbc #10 sbc #10
sta $0101,x sta $0101,x
jmp carry_fix_loop jmp carry_fix_loop
* dex * dex
bpl carry_fix_loop bpl carry_fix_loop