diff --git a/STATUS.md b/STATUS.md index 08650c8b..f40beb54 100644 --- a/STATUS.md +++ b/STATUS.md @@ -251,7 +251,7 @@ Floating point mathematical routines - not official, but well known and broadly | `$BCF3` | `FIN` | PARTIAL | Only for 38k memory model + not fully tested yet | | `$BD7E` | `FINLOG` | DONE | From the Microsoft BASIC, original name: FINLOG | | `$BDDD` | `FOUT` | DONE | From the Microsoft BASIC, original name: FOUT | -| `$BF71` | `sqr_FAC1` | PARTIAL | needs `sqr_FAC2` | +| `$BF71` | `sqr_FAC1` | DONE | From the Microsoft BASIC, original name: SQR | | `$BF74` | `sqr_FAC2` | NOT DONE | | | `$BF78` | `pwr_FAC2_MEM` | PARTIAL | needs `pwr_FAC2_FAC1` | | `$BF7B` | `pwr_FAC2_FAC1` | NOT DONE | | diff --git a/src/basic/math_trans/bf71.sqr_FAC1.s b/src/basic/math_trans/bf71.sqr_FAC1.s index 76f373ef..642feb3b 100644 --- a/src/basic/math_trans/bf71.sqr_FAC1.s +++ b/src/basic/math_trans/bf71.sqr_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 - square root of FAC1 ; +; This is verified to be identical to the original Microsoft implementation where it was named SQR. +; ; Note: ; - transfers FAC1 to FAC2 and falls through to SQR2 ; @@ -20,9 +24,9 @@ sqr_FAC1: - jsr mov_FAC1_FAC2 + jsr mov_r_FAC1_FAC2 - ; FALLLTROUGH to sqr_FAC2 + ; FALLLTROUGH to sqr_FAC2 } else { diff --git a/tools/similarity.c b/tools/similarity.c index 77821498..15cb5bc3 100644 --- a/tools/similarity.c +++ b/tools/similarity.c @@ -20,7 +20,7 @@ int matches[MAX_SIZE]; int phase_mask[MAX_SIZE+MAX_SIZE]; -#define NUM_CHUNKS 12 +#define NUM_CHUNKS 13 // 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, @@ -31,6 +31,7 @@ unsigned short microsoft_basic_chunks[NUM_CHUNKS * 2] = { 0xBD7E, 0xBD90, 0xBDB3, 0xBDC1, 0xBDDD, 0xBF51, + 0xBF71, 0xBF73, 0xBFB4, 0xBFEC, 0xE043, 0xE08C, 0xE264, 0xE2C2, // Two byte gap here is an optimization