diff --git a/STATUS.md b/STATUS.md index 9d4aa3c9..d7593baf 100644 --- a/STATUS.md +++ b/STATUS.md @@ -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 | diff --git a/src/basic/math/b3a2.convert_Y_to_FAC1.s b/src/basic/math/b3a2.convert_Y_to_FAC1.s index 12f3bdad..167ad4b0 100644 --- a/src/basic/math/b3a2.convert_Y_to_FAC1.s +++ b/src/basic/math/b3a2.convert_Y_to_FAC1.s @@ -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 diff --git a/src/basic/math/bc3c.convert_A_to_FAC1.s b/src/basic/math/bc3c.convert_A_to_FAC1.s index 11ef115b..b5e22c2a 100644 --- a/src/basic/math/bc3c.convert_A_to_FAC1.s +++ b/src/basic/math/bc3c.convert_A_to_FAC1.s @@ -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 diff --git a/src/basic/math/bc44.convert_i16_to_FAC1.s b/src/basic/math/bc44.convert_i16_to_FAC1.s index bf8a956b..94ef1c27 100644 --- a/src/basic/math/bc44.convert_i16_to_FAC1.s +++ b/src/basic/math/bc44.convert_i16_to_FAC1.s @@ -24,6 +24,6 @@ convert_i16_to_FAC1: carry: - lda FAC1_mantissa+1 + lda FAC1_mantissa cmp #$80 ; Copy sign into carry rts diff --git a/src/basic/math/convert_i16_expsign_to_FAC1.s b/src/basic/math/convert_i16_expsign_to_FAC1.s index a04c02c1..53dbd390 100644 --- a/src/basic/math/convert_i16_expsign_to_FAC1.s +++ b/src/basic/math/convert_i16_expsign_to_FAC1.s @@ -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 #