Update GIVAYF

This commit is contained in:
Rikard Nordgren authored and FeralChild64 committed 2026-03-29 21:45:24 +02:00
1 parent 376823fc65
commit 135522352a
3 files changed
+13 -7

No files matched your search

+1 -1
View File
@@ -199,7 +199,7 @@ Floating point mathematical routines - not official, but well known and broadly
| `$AF9A` | `compute_ST` | DONE | |
| `$B1AA` | `FACINX` | NOT DONE | convert FAC1 to 16-bit signed integer |
| `$B1BF` | `convert_FAC1_to_s16` | NOT DONE | |
| `$B391` | `GIVAYF` | PARTIAL | not fully tested yet |
| `$B391` | `GIVAYF` | DONE | From the Microsoft BASIC, original name: GIVAYF |
| `$B3A2` | `convert_Y_to_FAC1` | DONE | From the Microsoft BASIC, original name: SNGFLT |
| `$B794` | `convert_u8_A_to_FAC1` | DONE | |
| `$B7B5` | `STRVAL` | PARTIAL | Only for 38k memory model |
+10 -5
View File
@@ -3,7 +3,9 @@
;; #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 - 16-bit signed integer to FAC1
;
; Output:
@@ -13,6 +15,8 @@
; Sets the data type flag at $0D to "numeric", stores the number in the FAC1 mantissa
; then calls convert_i16_to_FAC1
;
; This is verified to be identical to the original Microsoft implementation where it was named GIVAYF.
;
; See also:
; - [CM64] Computes Mapping the Commodore 64 - page 107
; - https://www.c64-wiki.com/wiki/GIVAYF
@@ -20,8 +24,9 @@
GIVAYF:
ldx #$00
stx $0D
sty FAC1_mantissa
sta FAC1_mantissa+1
ldx #0
stx VALTYP
sta FAC1_mantissa+0
sty FAC1_mantissa+1
ldx #$90
jmp convert_i16_to_FAC1
+2 -1
View File
@@ -20,9 +20,10 @@ int matches[MAX_SIZE];
int phase_mask[MAX_SIZE+MAX_SIZE];
#define NUM_CHUNKS 7
#define NUM_CHUNKS 8
// 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, 0xB84F,
0xB8D2, 0xB8D5,