Add FINLOG
This commit is contained in:
1 parent
9d385f7aa6
commit
a5d92887c2
6 files changed
+42
-11
No files matched your search
@@ -240,7 +240,7 @@ Floating point mathematical routines - not official, but well known and broadly
|
|||||||
| `$BC9B` | `QINT` | NOT DONE | convert FAC1 to 32 bit signed integer |
|
| `$BC9B` | `QINT` | NOT DONE | convert FAC1 to 32 bit signed integer |
|
||||||
| `$BCCC` | `int_FAC1` | DONE | |
|
| `$BCCC` | `int_FAC1` | DONE | |
|
||||||
| `$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` | NOT DONE | |
|
| `$BD7E` | `FINLOG` | DONE | |
|
||||||
| `$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 | |
|
||||||
|
|||||||
@@ -50,11 +50,8 @@ FIN_loop:
|
|||||||
sbc #48 ; Convert to number
|
sbc #48 ; Convert to number
|
||||||
sta FIN_DIGIT
|
sta FIN_DIGIT
|
||||||
jsr mul10_FAC1
|
jsr mul10_FAC1
|
||||||
jsr mov_FAC1_FAC2
|
|
||||||
lda FIN_DIGIT
|
lda FIN_DIGIT
|
||||||
jsr convert_A_to_FAC1
|
jsr FINLOG
|
||||||
jsr add_FAC2_FAC1
|
|
||||||
|
|
||||||
lda FIN_DECFOUND ; Have we passed the decimal sign?
|
lda FIN_DECFOUND ; Have we passed the decimal sign?
|
||||||
bpl FIN_next
|
bpl FIN_next
|
||||||
inc FIN_NUMDEC
|
inc FIN_NUMDEC
|
||||||
|
|||||||
@@ -4,15 +4,16 @@
|
|||||||
;; #LAYOUT# * * #IGNORE
|
;; #LAYOUT# * * #IGNORE
|
||||||
|
|
||||||
;
|
;
|
||||||
; Math package - add an ASCII digit 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
|
||||||
;
|
;
|
||||||
; See also:
|
; See also:
|
||||||
; - [CM64] Computes Mapping the Commodore 64 - page 113
|
; - [CM64] Computes Mapping the Commodore 64 - page 113
|
||||||
;
|
;
|
||||||
|
|
||||||
; XXX implement, test
|
|
||||||
|
|
||||||
|
|
||||||
FINLOG:
|
FINLOG:
|
||||||
|
pha
|
||||||
+STUB_IMPLEMENTATION
|
jsr mov_FAC1_FAC2
|
||||||
|
pla
|
||||||
|
jsr convert_A_to_FAC1
|
||||||
|
jsr add_FAC2_FAC1
|
||||||
|
rts
|
||||||
File renamed without changes.
@@ -0,0 +1,3 @@
|
|||||||
|
PLA + JSR $BC3C
|
||||||
|
|
||||||
|
Pull accumulator + call well known floating point function
|
||||||
@@ -500,5 +500,35 @@ print "COMPARE"
|
|||||||
compare $61 $61 $1001
|
compare $61 $61 $1001
|
||||||
print "END"
|
print "END"
|
||||||
|
|
||||||
|
print "TEST: FINLOG 1.0 + 1"
|
||||||
|
fill $61 $66 81 80 00 00 00 00
|
||||||
|
r A=1
|
||||||
|
r PC=$BD7E
|
||||||
|
ret
|
||||||
|
fill $1001 $1006 82 80 00 00 00 00
|
||||||
|
print "COMPARE"
|
||||||
|
compare $61 $66 $1001
|
||||||
|
print "END"
|
||||||
|
|
||||||
|
print "TEST: FINLOG 1.0 + 0"
|
||||||
|
fill $61 $66 81 80 00 00 00 00
|
||||||
|
r A=0
|
||||||
|
r PC=$BD7E
|
||||||
|
ret
|
||||||
|
fill $1001 $1006 81 80 00 00 00 00
|
||||||
|
print "COMPARE"
|
||||||
|
compare $61 $66 $1001
|
||||||
|
print "END"
|
||||||
|
|
||||||
|
print "TEST: FINLOG 2.0 + 9"
|
||||||
|
fill $61 $66 82 80 00 00 00 00
|
||||||
|
r A=9
|
||||||
|
r PC=$BD7E
|
||||||
|
ret
|
||||||
|
fill $1001 $1006 84 B0 00 00 00 00
|
||||||
|
print "COMPARE"
|
||||||
|
compare $61 $66 $1001
|
||||||
|
print "END"
|
||||||
|
|
||||||
|
|
||||||
q
|
q
|
||||||
Reference in new issue
Block a user