From 8f7f6b65307439583bbbdebd3532037bfad2e012 Mon Sep 17 00:00:00 2001 From: Rikard Nordgren Date: Mon, 2 Feb 2026 20:44:10 +0100 Subject: [PATCH] Update add_MEM_FAC1 --- STATUS.md | 2 +- src/basic/math/b867.add_MEM_FAC1.s | 6 +++++- tools/similarity.c | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/STATUS.md b/STATUS.md index 8ad041cf..2498ac39 100644 --- a/STATUS.md +++ b/STATUS.md @@ -208,7 +208,7 @@ Floating point mathematical routines - not official, but well known and broadly | `$B850` | `sub_MEM_FAC1` | DONE | From the Microsoft BASIC, original name: FSUB | | `$B853` | `sub_FAC2_FAC1` | DONE | From the Microsoft BASIC, original name: FSUBT | | `$B862` | `add_align_exponents` | DONE | From the Microsoft BASIC, original name: FADD5 | -| `$B867` | `add_MEM_FAC1` | DONE | | +| `$B867` | `add_MEM_FAC1` | DONE | From the Microsoft BASIC, original name: FADD | | `$B86A` | `add_FAC2_FAC1` | DONE | | | `$B8D2` | `abs_and_normal_FAC` | DONE | From the Microsoft BASIC, original name: FADFLT | | `$B8FE` | `normal_FAC1` | DONE | | diff --git a/src/basic/math/b867.add_MEM_FAC1.s b/src/basic/math/b867.add_MEM_FAC1.s index 87f33af4..8fd07284 100644 --- a/src/basic/math/b867.add_MEM_FAC1.s +++ b/src/basic/math/b867.add_MEM_FAC1.s @@ -3,13 +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 - add memory variable to FAC1 ; ; Input: ; - .A - address low byte ; - .Y - address high byte ; +; This is verified to be identical to the original Microsoft implementation where it was named FADD. +; ; See also: ; - [CM64] Computes Mapping the Commodore 64 - page 112 ; - https://www.c64-wiki.com/wiki/Floating_point_arithmetic diff --git a/tools/similarity.c b/tools/similarity.c index 34895362..6f6773e1 100644 --- a/tools/similarity.c +++ b/tools/similarity.c @@ -25,7 +25,7 @@ int phase_mask[MAX_SIZE+MAX_SIZE]; unsigned short microsoft_basic_chunks[NUM_CHUNKS * 2] = { 0xB391, 0xB39D, 0xB3A2, 0xB3A5, - 0xB849, 0xB866, + 0xB849, 0xB869, 0xB8D2, 0xB8D5, 0xB947, 0xB97D, 0xB983, 0xB9BB,