Update FINLOG

This commit is contained in:
Rikard Nordgren authored and FeralChild64 committed 2026-04-12 13:13:18 +02:00
1 parent eaa517f302
commit 7eda12aa34
3 files changed
+17 -9

No files matched your search

+1 -1
View File
@@ -249,7 +249,7 @@ Floating point mathematical routines - not official, but well known and broadly
| `$BCCC` | `int_FAC1` | DONE | From the Microsoft BASIC, original name: INT | | `$BCCC` | `int_FAC1` | DONE | From the Microsoft BASIC, original name: INT |
| `$BCE9` | `clear_FAC1` | DONE | From the Microsoft BASIC, original name: CLRFAC | | `$BCE9` | `clear_FAC1` | DONE | From the Microsoft BASIC, original name: CLRFAC |
| `$BCF3` | `FIN` | PARTIAL | Only for 38k memory model + not fully tested yet | | `$BCF3` | `FIN` | PARTIAL | Only for 38k memory model + not fully tested yet |
| `$BD7E` | `FINLOG` | DONE | | | `$BD7E` | `FINLOG` | DONE | From the Microsoft BASIC, original name: FINLOG |
| `$BDDD` | `FOUT` | NOT DONE | outputs FAC1 to string at $0100 | | `$BDDD` | `FOUT` | NOT DONE | outputs FAC1 to string at $0100 |
| `$BF71` | `sqr_FAC1` | PARTIAL | needs `sqr_FAC2` | | `$BF71` | `sqr_FAC1` | PARTIAL | needs `sqr_FAC2` |
| `$BF74` | `sqr_FAC2` | NOT DONE | | | `$BF74` | `sqr_FAC2` | NOT DONE | |
+14 -7
View File
@@ -3,17 +3,24 @@
;; #LAYOUT# * BASIC_0 #TAKE ;; #LAYOUT# * BASIC_0 #TAKE
;; #LAYOUT# * * #IGNORE ;; #LAYOUT# * * #IGNORE
; ; This file is under the MIT license, it contains code released by Microsoft Corporation.
; See LICENSE for more information.
; Math package - add an ASCII digit in A that has been converted to a signed integer to FAC1 ; Math package - add an ASCII digit in A that has been converted to a signed integer to FAC1
; ;
; This is verified to be identical to the original Microsoft implementation where it was named FINLOG.
;
; See also: ; See also:
; - [CM64] Computes Mapping the Commodore 64 - page 113 ; - [CM64] Computes Mapping the Commodore 64 - page 113
; ;
FINLOG: FINLOG:
pha pha
jsr mov_FAC1_FAC2 jsr mov_r_FAC1_FAC2
pla pla
jsr convert_A_to_FAC1 jsr convert_A_to_FAC1
jsr add_FAC2_FAC1 lda FAC2_sign
rts eor FAC1_sign
sta ARISGN ; Resultant sign
ldx FAC1_exponent ; Set signs on thing to add
jmp add_FAC2_FAC1
+2 -1
View File
@@ -20,7 +20,7 @@ int matches[MAX_SIZE];
int phase_mask[MAX_SIZE+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 // Pairs of start, end memory addresses of known exact similarity with the open source Microsoft BASIC
unsigned short microsoft_basic_chunks[NUM_CHUNKS * 2] = { unsigned short microsoft_basic_chunks[NUM_CHUNKS * 2] = {
0xB391, 0xB39D, 0xB391, 0xB39D,
@@ -28,6 +28,7 @@ unsigned short microsoft_basic_chunks[NUM_CHUNKS * 2] = {
0xB849, 0xB97D, 0xB849, 0xB97D,
0xB983, 0xB9BB, 0xB983, 0xB9BB,
0xBA28, 0xBCF2, 0xBA28, 0xBCF2,
0xBD7E, 0xBD90,
0xBFB4, 0xBFBE, 0xBFB4, 0xBFBE,
}; };