changeset 117:053fd2fb92e8

Check the correct extra precision byte for rounding during fp normalization
author William Astle <lost@l-w.ca>
date Wed, 27 Dec 2023 19:30:19 -0700
parents e72cda5e5ee2
children cddbe8bc07e5
files src/fps.s
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/fps.s	Wed Dec 27 15:57:59 2023 -0700
+++ b/src/fps.s	Wed Dec 27 19:30:19 2023 -0700
@@ -402,7 +402,7 @@
 fps_normalize3  addb fpa0+fpa.exp               ; adjust exponent
                 stb fpa0+fpa.exp
                 ble fps_normalize4              ; brif we underflowed to zero
-                ldb fpaextra                    ; get extra precision digit
+                ldb fpa0+fpa.extra              ; get extra precision digit
                 andb #0xf0                      ; keep only the highest extra precision digit
                 cmpb #0x50                      ; do we need to round?
                 blo fps_normalize5              ; brif not