From b454ca191d55a51da8b0a68cc1d33cfef31ddd52 Mon Sep 17 00:00:00 2001 From: Rikard Nordgren Date: Mon, 26 Jan 2026 19:21:17 +0100 Subject: [PATCH] Update mov_r_FAC1_TMP1 --- STATUS.md | 2 +- src/basic/math_mov/bbca.mov_r_FAC1_TMP1.s | 19 +++++++++++++++++-- src/basic/math_mov/mov_r_FAC1_TMP1.s | 18 ------------------ tools/similarity.c | 2 +- 4 files changed, 19 insertions(+), 22 deletions(-) delete mode 100644 src/basic/math_mov/mov_r_FAC1_TMP1.s diff --git a/STATUS.md b/STATUS.md index 99c892ad..3fe31c2a 100644 --- a/STATUS.md +++ b/STATUS.md @@ -224,7 +224,7 @@ Floating point mathematical routines - not official, but well known and broadly | `$BBA2` | `mov_MEM_FAC1` | DONE | | | `$BBA6` | `get_FAC1_via_INDEX` | DONE | | | `$BBC7` | `mov_r_FAC1_TMP2` | PARTIAL | not fully tested yet | -| `$BBCA` | `mov_r_FAC1_TMP1` | PARTIAL | not fully tested yet | +| `$BBCA` | `mov_r_FAC1_TMP1` | DONE | From the Microsoft BASIC, original name: MOV1F | | `$BBD0` | `mov_r_FAC1_VAR` | DONE | From the Microsoft BASIC, original name: MOVVF | | `$BBD4` | `mov_r_FAC1_MEM` | DONE | From the Microsoft BASIC, original name: MOVMF | | `$BBFC` | `mov_FAC2_FAC1` | DONE | From the Microsoft BASIC, original name: MOVFA | diff --git a/src/basic/math_mov/bbca.mov_r_FAC1_TMP1.s b/src/basic/math_mov/bbca.mov_r_FAC1_TMP1.s index 51494056..057a230e 100644 --- a/src/basic/math_mov/bbca.mov_r_FAC1_TMP1.s +++ b/src/basic/math_mov/bbca.mov_r_FAC1_TMP1.s @@ -3,6 +3,21 @@ ;; #LAYOUT# * BASIC_0 #TAKE ;; #LAYOUT# * * #IGNORE -; Just a compatibility jump - our routine is longer than original one +; This file is under the MIT license, it contains code released by Microsoft Corporation. +; See LICENSE for more information. - jmp mov_r_FAC1_TMP1 +; Math package - store FAC1 (rounds) in TEMPF1 +; +; This is verified to be identical to the original Microsoft implementation where it was named MOV1F. +; +; See also: +; - https://www.c64-wiki.com/wiki/BASIC-ROM +; - https://sta.c64.org/cbm64basconv.html +; + +mov_r_FAC1_TMP1: + + ldx #TEMPF1 + ldy #0 + + beq mov_r_FAC1_MEM ; Always branches diff --git a/src/basic/math_mov/mov_r_FAC1_TMP1.s b/src/basic/math_mov/mov_r_FAC1_TMP1.s deleted file mode 100644 index 79917784..00000000 --- a/src/basic/math_mov/mov_r_FAC1_TMP1.s +++ /dev/null @@ -1,18 +0,0 @@ -;; #LAYOUT# STD * #TAKE -;; #LAYOUT# * BASIC_0 #TAKE -;; #LAYOUT# * * #IGNORE - -; -; Math package - store FAC1 (rounds) in TEMPF1 -; -; See also: -; - https://www.c64-wiki.com/wiki/BASIC-ROM -; - https://sta.c64.org/cbm64basconv.html -; - -mov_r_FAC1_TMP1: - - ldy #$00 - ldx #$5C - - jmp mov_r_FAC1_MEM diff --git a/tools/similarity.c b/tools/similarity.c index 2108dd72..09c09389 100644 --- a/tools/similarity.c +++ b/tools/similarity.c @@ -24,7 +24,7 @@ int phase_mask[MAX_SIZE+MAX_SIZE]; // Pairs of start, end memory addresses of known exact similarity with the open source Microsoft BASIC unsigned short microsoft_basic_chunks[NUM_CHUNKS * 2] = { 0xB849, 0xB84F, - 0xBBD0, 0xBC1A + 0xBBCA, 0xBC1A };