Add sqr_FAC2

This commit is contained in:
Rikard Nordgren authored and FeralChild64 committed 2026-04-29 21:18:16 +02:00
1 parent 661f93a03d
commit 24f1bc9193
4 files changed
+18 -5

No files matched your search

+1 -1
View File
@@ -252,7 +252,7 @@ Floating point mathematical routines - not official, but well known and broadly
| `$BD7E` | `FINLOG` | DONE | From the Microsoft BASIC, original name: FINLOG |
| `$BDDD` | `FOUT` | DONE | From the Microsoft BASIC, original name: FOUT |
| `$BF71` | `sqr_FAC1` | DONE | From the Microsoft BASIC, original name: SQR |
| `$BF74` | `sqr_FAC2` | NOT DONE | |
| `$BF74` | `sqr_FAC2` | DONE | From the Microsoft BASIC, no label |
| `$BF78` | `pwr_FAC2_MEM` | PARTIAL | needs `pwr_FAC2_FAC1` |
| `$BF7B` | `pwr_FAC2_FAC1` | NOT DONE | |
| `$BFB4` | `toggle_sign_FAC1` | DONE | From the Microsoft BASIC, original name: NEGOP |
File renamed without changes.
@@ -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 FAC2
;
; This is verified to be identical to the original Microsoft implementation where it was unnamed
;
; Note:
; - loads .5 into FAC1 and falling through to the exponentiation routine
;
@@ -15,8 +19,17 @@
; - https://codebase64.org/doku.php?id=base:kernal_floating_point_mathematics
;
; XXX provide implementation
!ifdef CONFIG_TRANSCENDENTAL_FUNCTIONS {
sqr_FAC2:
+STUB_IMPLEMENTATION
lda #<const_HALF
ldy #>const_HALF
; FALLLTROUGH to pwr_FAC2_MEM
} else {
jmp do_NOT_IMPLEMENTED_error
}
+1 -1
View File
@@ -31,7 +31,7 @@ unsigned short microsoft_basic_chunks[NUM_CHUNKS * 2] = {
0xBD7E, 0xBD90,
0xBDB3, 0xBDC1,
0xBDDD, 0xBF51,
0xBF71, 0xBF73,
0xBF71, 0xBF77,
0xBFB4, 0xBFEC,
0xE043, 0xE08C,
0xE264, 0xE2C2, // Two byte gap here is an optimization