From 908b783319872287a2e90afd0b7d66ec4dd09a6b Mon Sep 17 00:00:00 2001 From: Rikard Nordgren Date: Mon, 30 Mar 2026 21:45:54 +0200 Subject: [PATCH] Update mul_MEM_FAC1 --- STATUS.md | 2 +- .../math/{ba28.mul_MEM_FAC1.jmp.s => ba28.mul_MEM_FAC1.s} | 8 +++++--- tools/similarity.c | 3 ++- 3 files changed, 8 insertions(+), 5 deletions(-) rename src/basic/math/{ba28.mul_MEM_FAC1.jmp.s => ba28.mul_MEM_FAC1.s} (69%) diff --git a/STATUS.md b/STATUS.md index 1b8b17ef..cdb44a0f 100644 --- a/STATUS.md +++ b/STATUS.md @@ -219,7 +219,7 @@ Floating point mathematical routines - not official, but well known and broadly | `$B96F` | `inc_FAC1` | DONE | From the Microsoft BASIC, original name: INCFAC | | `$B983` | `shiftr_FAC1` | DONE | From the Microsoft BASIC, original name: SHIFTR | | `$B9EA` | `log_FAC1` | PARTIAL | not fully tested yet | -| `$BA28` | `mul_MEM_FAC1` | DONE | | +| `$BA28` | `mul_MEM_FAC1` | DONE | From the Microsoft BASIC, original name: FMULT | | `$BA2B` | `mul_FAC2_FAC1` | DONE | | | `$BA8C` | `mov_MEM_FAC2` | DONE | From the Microsoft BASIC, original name: CONUPK | | `$BA90` | `get_FAC2_via_INDEX` | DONE | From the Microsoft BASIC, no label | diff --git a/src/basic/math/ba28.mul_MEM_FAC1.jmp.s b/src/basic/math/ba28.mul_MEM_FAC1.s similarity index 69% rename from src/basic/math/ba28.mul_MEM_FAC1.jmp.s rename to src/basic/math/ba28.mul_MEM_FAC1.s index 9c927026..bd99214f 100644 --- a/src/basic/math/ba28.mul_MEM_FAC1.jmp.s +++ b/src/basic/math/ba28.mul_MEM_FAC1.s @@ -3,15 +3,17 @@ ;; #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 - multiplies FAC1 by RAM ; +; This is verified to be identical to the original Microsoft implementation where it was named FMULT +; ; Input: ; - .A - address low byte ; - .Y - address high byte ; -; Note: -; - C64 Wiki calls it FMULT, this looks like a mistake ; ; See also: ; - [CM64] Computes Mapping the Commodore 64 - page 113 diff --git a/tools/similarity.c b/tools/similarity.c index 07bfbee6..c8a98373 100644 --- a/tools/similarity.c +++ b/tools/similarity.c @@ -20,13 +20,14 @@ int matches[MAX_SIZE]; int phase_mask[MAX_SIZE+MAX_SIZE]; -#define NUM_CHUNKS 6 +#define NUM_CHUNKS 7 // Pairs of start, end memory addresses of known exact similarity with the open source Microsoft BASIC unsigned short microsoft_basic_chunks[NUM_CHUNKS * 2] = { 0xB391, 0xB39D, 0xB3A2, 0xB3A5, 0xB849, 0xB97D, 0xB983, 0xB9BB, + 0xBA28, 0xBA2A, 0xBA8C, 0xBAB6, 0xBB8F, 0xBCF2, };