Update toggle_sign_FAC1
This commit is contained in:
1 parent
635a795b77
commit
eaa517f302
3 files changed
+15
-20
No files matched your search
@@ -255,7 +255,7 @@ Floating point mathematical routines - not official, but well known and broadly
|
|||||||
| `$BF74` | `sqr_FAC2` | NOT DONE | |
|
| `$BF74` | `sqr_FAC2` | NOT DONE | |
|
||||||
| `$BF78` | `pwr_FAC2_MEM` | PARTIAL | needs `pwr_FAC2_FAC1` |
|
| `$BF78` | `pwr_FAC2_MEM` | PARTIAL | needs `pwr_FAC2_FAC1` |
|
||||||
| `$BF7B` | `pwr_FAC2_FAC1` | NOT DONE | |
|
| `$BF7B` | `pwr_FAC2_FAC1` | NOT DONE | |
|
||||||
| `$BFB4` | `toggle_sign_FAC1` | DONE | |
|
| `$BFB4` | `toggle_sign_FAC1` | DONE | From the Microsoft BASIC, original name: NEGOP |
|
||||||
| `$BFED` | `exp_FAC1` | NOT DONE | |
|
| `$BFED` | `exp_FAC1` | NOT DONE | |
|
||||||
| `$E043` | `poly1_FAC1` | PARTIAL | not fully tested yet |
|
| `$E043` | `poly1_FAC1` | PARTIAL | not fully tested yet |
|
||||||
| `$E059` | `poly2_FAC1` | PARTIAL | not fully tested yet |
|
| `$E059` | `poly2_FAC1` | PARTIAL | not fully tested yet |
|
||||||
|
|||||||
@@ -3,29 +3,23 @@
|
|||||||
;; #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 - toggle FAC1 sign (if not 0)
|
; Math package - toggle FAC1 sign (if not 0)
|
||||||
;
|
;
|
||||||
|
; This is verified to be identical to the original Microsoft implementation where it was named NEGOP.
|
||||||
|
;
|
||||||
; See also:
|
; See also:
|
||||||
; - [CM64] Computes Mapping the Commodore 64 - page 117
|
; - [CM64] Computes Mapping the Commodore 64 - page 117
|
||||||
; - https://www.c64-wiki.com/wiki/Floating_point_arithmetic
|
; - https://www.c64-wiki.com/wiki/Floating_point_arithmetic
|
||||||
;
|
;
|
||||||
|
|
||||||
toggle_sign_FAC1:
|
toggle_sign_FAC1:
|
||||||
|
lda FAC1_exponent
|
||||||
lda FAC1_exponent
|
beq NEGRTS
|
||||||
beq toggle_sign_FAC1_end ; do not toggle the sign if value is 0
|
lda FAC1_sign
|
||||||
|
eor #$FF
|
||||||
; FALLTROUGH
|
sta FAC1_sign
|
||||||
|
NEGRTS:
|
||||||
toggle_sign_FAC1_skipcheck: ; entry for other routines
|
rts
|
||||||
|
|
||||||
lda FAC1_sign
|
|
||||||
eor #$FF
|
|
||||||
sta FAC1_sign
|
|
||||||
|
|
||||||
; FALLTROUGH
|
|
||||||
|
|
||||||
toggle_sign_FAC1_end:
|
|
||||||
|
|
||||||
rts
|
|
||||||
+2
-1
@@ -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 5
|
#define NUM_CHUNKS 6
|
||||||
// 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,
|
||||||
|
0xBFB4, 0xBFBE,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user