From 5d8241fe2c101a5054695b56d06c148da76fbf45 Mon Sep 17 00:00:00 2001 From: Rikard Nordgren Date: Sun, 6 Apr 2025 12:33:08 +0200 Subject: [PATCH] Fix broken div10_FAC1 Also add some unit tests for div_FAC1_FAC2 --- src/basic/math/bafe.div10_FAC1_p.s | 15 ++-- strings/842000000020 | 1 + strings/A2BB4C12BB | 3 + strings/A84CA2B34C | 3 + testsuite/unit/math.vs | 107 +++++++++++++++++++++++++++++ 5 files changed, 120 insertions(+), 9 deletions(-) create mode 100644 strings/842000000020 create mode 100644 strings/A2BB4C12BB create mode 100644 strings/A84CA2B34C diff --git a/src/basic/math/bafe.div10_FAC1_p.s b/src/basic/math/bafe.div10_FAC1_p.s index a13dd084..4a83d10f 100644 --- a/src/basic/math/bafe.div10_FAC1_p.s +++ b/src/basic/math/bafe.div10_FAC1_p.s @@ -7,7 +7,7 @@ ; Math package - divide FAC1 by 10, result is always positive ; ; Notes: -; - shifts FAC1 to FAC2, loads FAC1 with the constant 10, falls through to the division routine +; - moves FAC1 to FAC2, loads FAC1 with the constant 10, jumps to the division routine ; ; See also: @@ -16,14 +16,11 @@ ; - https://codebase64.org/doku.php?id=base:kernal_floating_point_mathematics ; -; XXX test this - div10_FAC1_p: - lda #$00 - sta FAC1_sign + jsr mov_FAC1_FAC2 + ldy #>const_TEN + lda #const_TEN - lda #