Add tan_FAC1
This commit is contained in:
1 parent
7563da19ab
commit
a25b4da210
10 files changed
+46
-19
No files matched your search
@@ -255,7 +255,7 @@ Floating point mathematical routines - not official, but well known and broadly
|
|||||||
| `$E0BE` | `rnd_generate` | DONE | |
|
| `$E0BE` | `rnd_generate` | DONE | |
|
||||||
| `$E264` | `cos_FAC1` | PARTIAL | needs `sin_FAC1` |
|
| `$E264` | `cos_FAC1` | PARTIAL | needs `sin_FAC1` |
|
||||||
| `$E26B` | `sin_FAC1` | NOT DONE | some work already started |
|
| `$E26B` | `sin_FAC1` | NOT DONE | some work already started |
|
||||||
| `$E2B4` | `tan_FAC1` | NOT DONE | |
|
| `$E2B4` | `tan_FAC1` | PARTIAL | not fully tested yet |
|
||||||
| `$E30E` | `atn_FAC1` | NOT DONE | |
|
| `$E30E` | `atn_FAC1` | NOT DONE | |
|
||||||
|
|
||||||
<br />
|
<br />
|
||||||
|
|||||||
@@ -1,18 +0,0 @@
|
|||||||
;; #LAYOUT# STD * #TAKE
|
|
||||||
;; #LAYOUT# * BASIC_0 #TAKE
|
|
||||||
;; #LAYOUT# * * #IGNORE
|
|
||||||
|
|
||||||
;
|
|
||||||
; Math package - tangent of FAC1 in radians
|
|
||||||
;
|
|
||||||
; See also:
|
|
||||||
; - [CM64] Computes Mapping the Commodore 64 - page 210
|
|
||||||
; - https://www.c64-wiki.com/wiki/Floating_point_arithmetic
|
|
||||||
; - https://codebase64.org/doku.php?id=base:kernal_floating_point_mathematics
|
|
||||||
;
|
|
||||||
|
|
||||||
; XXX provide implementation
|
|
||||||
|
|
||||||
tan_FAC1:
|
|
||||||
|
|
||||||
+STUB_IMPLEMENTATION
|
|
||||||
File renamed without changes.
@@ -0,0 +1,27 @@
|
|||||||
|
;; #LAYOUT# STD * #TAKE
|
||||||
|
;; #LAYOUT# * BASIC_0 #TAKE
|
||||||
|
;; #LAYOUT# * * #IGNORE
|
||||||
|
|
||||||
|
;
|
||||||
|
; Math package - tangent of FAC1 in radians
|
||||||
|
;
|
||||||
|
; See also:
|
||||||
|
; - [CM64] Computes Mapping the Commodore 64 - page 210
|
||||||
|
; - https://www.c64-wiki.com/wiki/Floating_point_arithmetic
|
||||||
|
; - https://codebase64.org/doku.php?id=base:kernal_floating_point_mathematics
|
||||||
|
; - https://www.c64-wiki.com/wiki/TAN
|
||||||
|
|
||||||
|
; tan(x) = sin(x) / cos(x)
|
||||||
|
|
||||||
|
tan_FAC1:
|
||||||
|
jsr mov_r_FAC1_TMP1 ; TMP1 = x
|
||||||
|
jsr sin_FAC1 ; FAC1 = sin(x)
|
||||||
|
jsr mov_r_FAC1_TMP2 ; TMP2 = sin(x)
|
||||||
|
lda #TEMPF1
|
||||||
|
ldy #0
|
||||||
|
jsr mov_MEM_FAC1 ; FAC1 = x
|
||||||
|
jsr COS ; FAC1 = cos(x)
|
||||||
|
lda #TEMPF2
|
||||||
|
ldy #0
|
||||||
|
jsr mov_MEM_FAC2 ; FAC2 = sin(x)
|
||||||
|
jmp div_FAC2_FAC1 ; FAC1 = tan(x)
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
$00 + JSR $BBA2
|
||||||
|
|
||||||
|
Fragment + call to well known floating point function
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
CLC + RTS + JSR fragment
|
||||||
|
|
||||||
|
Fragment of ending one function and beginning the next
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
LDA #$57 + LDY #$00
|
||||||
|
|
||||||
|
Load address of known zero page temporary floating point register into YA
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
LDA #$57 + LDY #$00 + JSR $BBA2
|
||||||
|
|
||||||
|
Load adress of known temporary floating point register in zero page and call well known floating point function
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
LDA #$5C + LDY #$00
|
||||||
|
|
||||||
|
Load address of known zero page temporary floating point register into YA
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
$FF followed by multiple 0's
|
||||||
|
|
||||||
|
Meaningless - results of both ROM sets having empty space.
|
||||||
Reference in new issue
Block a user