diff --git a/STATUS.md b/STATUS.md index 87ae4c88..daa3c350 100644 --- a/STATUS.md +++ b/STATUS.md @@ -195,7 +195,7 @@ Floating point mathematical routines - not official, but well known and broadly | `$AABC` | `print_FAC1` | NOT DONE | | | `$AF7B` | `compute_TI` | NOT DONE | | | `$AF7E` | not named yet | NOT DONE | | -| `$AF87` | not named yet | NOT DONE | | +| `$AF87` | `set_FAC1_mantissa` | DONE | | | `$AF9A` | `compute_ST` | NOT DONE | | | `$B1AA` | `FACINX` | NOT DONE | convert FAC1 to 16-bit signed integer | | `$B1BF` | `convert_FAC1_to_s16` | NOT DONE | | diff --git a/src/basic/,stubs_math/af7e.math_stub.s b/src/basic/,stubs_math/af7e.math_stub.s index 051a14e5..3a85250e 100644 --- a/src/basic/,stubs_math/af7e.math_stub.s +++ b/src/basic/,stubs_math/af7e.math_stub.s @@ -4,7 +4,7 @@ ;; #LAYOUT# * * #IGNORE ; -; Math package - sets mantissa to 00yyxxaa +; Math package - set rest of FAC1 and JMP to $b8d2 ; ; See also: ; - https://codebase64.org/doku.php?id=base:kernal_floating_point_mathematics diff --git a/src/basic/,stubs_math/af87.interop b/src/basic/math/af87.interop similarity index 100% rename from src/basic/,stubs_math/af87.interop rename to src/basic/math/af87.interop diff --git a/src/basic/,stubs_math/af87.math_stub.s b/src/basic/math/af87.set_FAC1_mantissa.s similarity index 57% rename from src/basic/,stubs_math/af87.math_stub.s rename to src/basic/math/af87.set_FAC1_mantissa.s index 3a85250e..bfc4367c 100644 --- a/src/basic/,stubs_math/af87.math_stub.s +++ b/src/basic/math/af87.set_FAC1_mantissa.s @@ -4,12 +4,17 @@ ;; #LAYOUT# * * #IGNORE ; -; Math package - set rest of FAC1 and JMP to $b8d2 +; Math package - sets mantissa to 00yyxxaa ; ; See also: ; - https://codebase64.org/doku.php?id=base:kernal_floating_point_mathematics ; -; XXX add name, label, implement, test - +STUB_IMPLEMENTATION +set_FAC1_mantissa: + sty FAC1_mantissa+1 + stx FAC1_mantissa+2 + sta FAC1_mantissa+3 + lda #0 + sta FAC1_mantissa + rts