From 4ac8de0a86b6dbbf072c42a6bb6d66089bcb45a3 Mon Sep 17 00:00:00 2001 From: Rikard Nordgren Date: Sun, 2 Feb 2025 13:30:33 +0100 Subject: [PATCH] Add SGN FAC1 --- STATUS.md | 2 +- src/basic/{,stubs_math => math}/bc39.interop | 0 src/basic/{,stubs_math => math}/bc39.sgn_FAC1.s | 5 ++--- strings/202BBC8562 | 3 +++ 4 files changed, 6 insertions(+), 4 deletions(-) rename src/basic/{,stubs_math => math}/bc39.interop (100%) rename src/basic/{,stubs_math => math}/bc39.sgn_FAC1.s (90%) create mode 100644 strings/202BBC8562 diff --git a/STATUS.md b/STATUS.md index 249ca2f9..d0f492f4 100644 --- a/STATUS.md +++ b/STATUS.md @@ -232,7 +232,7 @@ Floating point mathematical routines - not official, but well known and broadly | `$BC0F` | `mov_FAC1_FAC2` | DONE | | | `$BC1B` | `round_FAC1` | PARTIAL | not fully tested yet | | `$BC2B` | `sgn_FAC1_A` | DONE | | -| `$BC39` | `sgn_FAC1` | NOT 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 | | `$BC58` | `abs_FAC1` | NOT DONE | | diff --git a/src/basic/,stubs_math/bc39.interop b/src/basic/math/bc39.interop similarity index 100% rename from src/basic/,stubs_math/bc39.interop rename to src/basic/math/bc39.interop diff --git a/src/basic/,stubs_math/bc39.sgn_FAC1.s b/src/basic/math/bc39.sgn_FAC1.s similarity index 90% rename from src/basic/,stubs_math/bc39.sgn_FAC1.s rename to src/basic/math/bc39.sgn_FAC1.s index 7828f4e6..20be7ef3 100644 --- a/src/basic/,stubs_math/bc39.sgn_FAC1.s +++ b/src/basic/math/bc39.sgn_FAC1.s @@ -15,7 +15,6 @@ ; - https://codebase64.org/doku.php?id=base:kernal_floating_point_mathematics ; -; XXX provide implementation - sgn_FAC1: - +STUB_IMPLEMENTATION + jsr sgn_FAC1_A + ; Fallthrough to convert_A_to_FAC1 diff --git a/strings/202BBC8562 b/strings/202BBC8562 new file mode 100644 index 00000000..f7af9b82 --- /dev/null +++ b/strings/202BBC8562 @@ -0,0 +1,3 @@ +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