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

+3 -3
View File
@@ -200,7 +200,7 @@ Floating point mathematical routines - not official, but well known and broadly
| `$B1AA` | `FACINX` | NOT DONE | convert FAC1 to 16-bit signed integer |
| `$B1BF` | `convert_FAC1_to_s16` | NOT DONE | |
| `$B391` | `GIVAYF` | PARTIAL | not fully tested yet |
| `$B3A2` | `convert_Y_to_FAC1` | PARTIAL | not fully tested yet |
| `$B3A2` | `convert_Y_to_FAC1` | DONE | |
| `$B794` | `convert_A_to_FAC1` | NOT DONE | |
| `$B7B5` | `STRVAL` | NOT DONE | imports string to FAC1 |
| `$B7F7` | `convert_FAC1_to_ADDR` | NOT DONE | |
@@ -233,8 +233,8 @@ Floating point mathematical routines - not official, but well known and broadly
| `$BC1B` | `round_FAC1` | PARTIAL | not fully tested yet |
| `$BC2B` | `sgn_FAC1_A` | DONE | |
| `$BC39` | `sgn_FAC1` | DONE | |
| `$BC3C` | `convert_A_to_FAC1` | PARTIAL | not fully tested yet |
| `$BC44` | `convert_i16_to_FAC1` | PARTIAL | not fully tested yet |
| `$BC3C` | `convert_A_to_FAC1` | DONE | |
| `$BC44` | `convert_i16_to_FAC1` | DONE | |
| `$BC58` | `abs_FAC1` | NOT DONE | |
| `$BC5B` | `FCOMP` | NOT DONE | compare FAC1 with RAM location |
| `$BC9B` | `QINT` | NOT DONE | convert FAC1 to 32 bit signed integer |
+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
+3
View File
@@ -0,0 +1,3 @@
JSR $BC2B + STA fragment
Calls the SGN FAC1 into A which is a well known routine and then stores the result in the zero page. Trivial
-3
View File
@@ -1,3 +0,0 @@
JSR $BC2B + STA $62
Calls the SGN FAC1 into A which is a well known routine and then stores the result in the FAC1 mantissa. Trivial