Setting result to largest value for true overflow.

This commit is contained in:
Russell-S-Harper 2018-08-17 22:57:44 -04:00
parent 8edcce337d
commit 4c38ba57de
2 changed files with 6 additions and 3 deletions

View File

@ -599,10 +599,12 @@ _3 JSR _CMPDC ; is D < C?
ROL _RB+3
BCC _3
; carry is set, means a real overflow condition
LDA _R0+3,X
ORA #_F_O
LDA #$FF ; set to the maximum
STA _R0,X
STA _R0+1,X
STA _R0+2,X
LDA #_MAX_V|_F_O
STA _R0+3,X
BEQ _4
JMP _9
_4 LDA _RB ; is RB > 0?
ORA _RB+1

View File

@ -131,6 +131,7 @@ _MOD_C = $e0
_EXT_C = $f0
; common constants
_MAX_V = $3f ; i.e. the $3f part of $3fffffff
; plus and minus 1 for increment and decrement
_PLS_1 = %00000100 ; i.e. the $04 part of $00000400