comparison src/int.s @ 97:b375a38b2b1a

Fix initialization error in integer to ascii conversion
author William Astle <lost@l-w.ca>
date Sun, 22 Oct 2023 21:15:14 -0600
parents 663d8e77b579
children b1958992a66a
comparison
equal deleted inserted replaced
96:69af7224f614 97:b375a38b2b1a
7 ; trailing NUL. 7 ; trailing NUL.
8 int_toascii ldu #strbuff+1 ; point to start of digits 8 int_toascii ldu #strbuff+1 ; point to start of digits
9 lda #0x20 ; default sign to space 9 lda #0x20 ; default sign to space
10 sta -1,u 10 sta -1,u
11 ldx #int_toascii5 ; point to digit constant table 11 ldx #int_toascii5 ; point to digit constant table
12 ldd #10 ; do 10 digits, no nonzero seen yet 12 ldd #0xa00 ; do 10 digits, no nonzero seen yet
13 stb fpaextra ; save digit count 13 std fpaextra ; save digit counts
14 ldd val0+val.int+2 ; copy to temporary accumulator 14 ldd val0+val.int+2 ; copy to temporary accumulator
15 std fpaextra+4 15 std fpaextra+4
16 ldd val0+val.int 16 ldd val0+val.int
17 std fpaextra+2 ; (will set N if the number is negative) 17 std fpaextra+2 ; (will set N if the number is negative)
18 bpl int_toascii0 ; brif so 18 bpl int_toascii0 ; brif so