Fixes after testing of convert int to FAC functions

This commit is contained in:
Rikard Nordgren committed 2025-02-09 21:05:23 +01:00
1 parent f70ec201c5
commit 716346e4a4
7 files changed
+14 -14

No files matched your search

+2 -2
View File
@@ -18,7 +18,7 @@
;
convert_Y_to_FAC1:
sty FAC1_mantissa+1
lda #$00
sta FAC1_mantissa+1
sty FAC1_mantissa
sta FAC1_mantissa
jmp convert_i16_to_FAC1
+2 -2
View File
@@ -17,8 +17,8 @@
convert_A_to_FAC1:
sta FAC1_mantissa
sta FAC1_mantissa+1
jsr sign_extend_A_to_Y
sty FAC1_mantissa+1
sty FAC1_mantissa
+nop ; To not leave a gap to the fallthrough
; Fall through to convert_i16_to_FAC1
+1 -1
View File
@@ -24,6 +24,6 @@ convert_i16_to_FAC1:
carry:
lda FAC1_mantissa+1
lda FAC1_mantissa
cmp #$80 ; Copy sign into carry
rts
+3 -3
View File
@@ -12,12 +12,12 @@ convert_i16_expsign_to_FAC1:
sta FAC1_mantissa+3
stx FAC1_exponent
sta FAC1_sign
bcs @1
bcc @1
; Handle signed int
lda FAC1_mantissa+1 ; Clear sign bit of int 16
lda FAC1_mantissa ; Clear sign bit of int 16
and #$7F
sta FAC1_mantissa+1
sta FAC1_mantissa
ldy #>CONST_NEG_32768 ; Subtract with 32768 to invert negative number
lda #<CONST_NEG_32768
jsr add_MEM_FAC1