changeset 114:df803556bfae

Fix use of unsigned branch for signed comparison in floating point division
author William Astle <lost@l-w.ca>
date Wed, 27 Dec 2023 00:05:31 -0700
parents 0aac26453849
children 03eb6d6b49b4
files src/fps.s
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/fps.s	Tue Dec 26 23:37:45 2023 -0700
+++ b/src/fps.s	Wed Dec 27 00:05:31 2023 -0700
@@ -643,7 +643,7 @@
                 cmpa #64                        ; did we overflow upward?
                 lbge OVERROR                    ; brif so
                 cmpa #-64                       ; did we overflow downward (underflow)?
-                bls fps_div1                    ; brif we underflow
+                ble fps_div1                    ; brif we underflow
                 adda #64                        ; add back the bias
                 sta fpa0+fpa.exp                ; set result exponent
                 lda fpa0+fpa.sign               ; calculate result sign (XOR of argument signs)