diff --git a/STATUS.md b/STATUS.md index 952a0e9e..73bd6300 100644 --- a/STATUS.md +++ b/STATUS.md @@ -204,7 +204,7 @@ Floating point mathematical routines - not official, but well known and broadly | `$B794` | `convert_u8_A_to_FAC1` | DONE | | | `$B7B5` | `STRVAL` | PARTIAL | Only for 38k memory model | | `$B7F7` | `convert_FAC1_to_ADDR` | NOT DONE | | -| `$B849` | `add_HALF_FAC1` | DONE | | +| `$B849` | `add_HALF_FAC1` | DONE | From the Microsoft BASIC, original name: FADDH | | `$B850` | `sub_MEM_FAC1` | DONE | | | `$B853` | `sub_FAC2_FAC1` | DONE | | | `$B862` | `add_align_exponents` | DONE | | diff --git a/src/basic/math/b849.add_HALF_FAC1.s b/src/basic/math/b849.add_HALF_FAC1.s index adb72fe7..e9fca350 100644 --- a/src/basic/math/b849.add_HALF_FAC1.s +++ b/src/basic/math/b849.add_HALF_FAC1.s @@ -3,15 +3,19 @@ ;; #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 0.5 to FAC1 ; +; This is verified to be identical to the original Microsoft implementation where it was named FADDH. +; ; See also: ; - [CM64] Computes Mapping the Commodore 64 - page 112 add_HALF_FAC1: - ldy #>const_HALF lda #const_HALF jmp add_MEM_FAC1 diff --git a/tools/similarity.c b/tools/similarity.c index d608e378..c0360de4 100644 --- a/tools/similarity.c +++ b/tools/similarity.c @@ -22,7 +22,11 @@ int phase_mask[MAX_SIZE+MAX_SIZE]; #define NUM_CHUNKS 1 // Pairs of start, end memory addresses of known exact similarity with the open source Microsoft BASIC -unsigned short microsoft_basic_chunks[NUM_CHUNKS * 2] = {0xBBFC, 0xBC1A}; +unsigned short microsoft_basic_chunks[NUM_CHUNKS * 2] = { + 0xB849, 0xB84F, + 0xBBFC, 0xBC1A +}; + int main(int argc,char **argv)