Mercurial > hg > index.cgi
comparison src/fps.s @ 96:69af7224f614
Tweak exponent calculation in fp to ascii conversion
author | William Astle <lost@l-w.ca> |
---|---|
date | Sun, 22 Oct 2023 21:05:37 -0600 |
parents | 6ac267da2216 |
children | 6837d10b67fb |
comparison
equal
deleted
inserted
replaced
95:25b44f1ac2aa | 96:69af7224f614 |
---|---|
855 fps_toascii9 ldb fpaextra+3 ; get decimal exponent to display | 855 fps_toascii9 ldb fpaextra+3 ; get decimal exponent to display |
856 beq fps_toascii13 | 856 beq fps_toascii13 |
857 lda #'E ; output "E" | 857 lda #'E ; output "E" |
858 sta ,u+ | 858 sta ,u+ |
859 tstb ; negative? | 859 tstb ; negative? |
860 bpl fps_toascii10 ; brif not | 860 bpl fps_toascii10 ; brif not |
861 negb ; positivize it | 861 comb ; positivize it, but also subtract 1? |
862 lda #'- ; put a minus for the exponent | 862 lda #'- ; put a minus for the exponent |
863 sta ,u+ | 863 sta ,u+ |
864 fps_toascii10 cmpb #10 ; do we have two digits for exponent? | 864 fps_toascii10 cmpb #10 ; do we have two digits for exponent? |
865 blo fps_toascii12 ; brif not | 865 blo fps_toascii12 ; brif not |
866 lda #0x2f ; initialize left digit | 866 lda #0x2f ; initialize left digit |