From 39763ef7337bd8b1d118238d2b183afce2acf776 Mon Sep 17 00:00:00 2001 From: Rikard Nordgren Date: Mon, 26 Jan 2026 20:18:48 +0100 Subject: [PATCH] Update mov_MEM_FAC1 and get_FAC1_via_INDEX --- STATUS.md | 4 ++-- src/basic/math_mov/bba2.mov_MEM_FAC1.s | 6 +++++- src/basic/math_mov/bba6.get_FAC1_via_INDEX.s | 5 +++++ tools/similarity.c | 2 +- 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/STATUS.md b/STATUS.md index 60c932e2..b4995691 100644 --- a/STATUS.md +++ b/STATUS.md @@ -221,8 +221,8 @@ Floating point mathematical routines - not official, but well known and broadly | `$BAFE` | `div10_FAC1_p` | DONE | | | `$BB0F` | `div_MEM_FAC1` | DONE | | | `$BB12` | `div_FAC2_FAC1` | DONE | | -| `$BBA2` | `mov_MEM_FAC1` | DONE | | -| `$BBA6` | `get_FAC1_via_INDEX` | DONE | | +| `$BBA2` | `mov_MEM_FAC1` | DONE | From the Microsoft BASIC, original name: MOVFM | +| `$BBA6` | `get_FAC1_via_INDEX` | DONE | From the Microsoft BASIC, no label | | `$BBC7` | `mov_r_FAC1_TMP2` | DONE | From the Microsoft BASIC, original name: MOV2F | | `$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 | diff --git a/src/basic/math_mov/bba2.mov_MEM_FAC1.s b/src/basic/math_mov/bba2.mov_MEM_FAC1.s index 4843ff8f..0bb1bd29 100644 --- a/src/basic/math_mov/bba2.mov_MEM_FAC1.s +++ b/src/basic/math_mov/bba2.mov_MEM_FAC1.s @@ -3,9 +3,13 @@ ;; #LAYOUT# * BASIC_0 #TAKE ;; #LAYOUT# * * #IGNORE +; This file is under the MIT license, it contains code released by Microsoft Corporation. +; See LICENSE for more information. ; Math package - fetch FAC1 from RAM location ; +; This is verified to be identical to the original Microsoft implementation where it was named MOVFM. +; ; Input: ; - .A - address low byte ; - .Y - address high byte @@ -24,7 +28,7 @@ mov_MEM_FAC1: - sty INDEX+1 sta INDEX+0 + sty INDEX+1 ; FALLTHROUGH to get_FAC1_via_INDEX diff --git a/src/basic/math_mov/bba6.get_FAC1_via_INDEX.s b/src/basic/math_mov/bba6.get_FAC1_via_INDEX.s index cb29efa2..9bdb62b9 100644 --- a/src/basic/math_mov/bba6.get_FAC1_via_INDEX.s +++ b/src/basic/math_mov/bba6.get_FAC1_via_INDEX.s @@ -3,6 +3,11 @@ ;; #LAYOUT# * BASIC_0 #TAKE ;; #LAYOUT# * * #IGNORE +; This file is under the MIT license, it contains code released by Microsoft Corporation. +; See LICENSE for more information. +; +; This is verified to be identical to the original Microsoft implementation where it was part of MOVFM. +; ; Math package - Mov MEM to FAC1 with address in INDEX zero page register ; ; See also: diff --git a/tools/similarity.c b/tools/similarity.c index f762950a..b7cc704f 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, - 0xBBC7, 0xBC1A + 0xBBA2, 0xBC1A };