added first stubs for math routines

This commit is contained in:
FeralChild64 committed 2020-01-28 18:33:52 +01:00
1 parent c41316d482
commit f9f13f8334
12 files changed
+173 -1

No files matched your search

+1
View File
@@ -11,6 +11,7 @@ SRCDIR_COMMON = c64/aliases
SRCDIR_BASIC = $(SRCDIR_COMMON) \
c64/basic \
c64/basic/,stubs \
c64/basic/,stubs_math \
c64/basic/commands \
c64/basic/init \
c64/basic/rom_revision
+50 -1
View File
@@ -144,7 +144,56 @@ For the current status of the low memory location implementation andd usage chec
<br />
### Unofficial BASIC routines/locations
### Math package
Floating point mathematical routines - not official, but well known and broadly used.
<br />
| Address | Name | Status | Remarks |
| :-------: | :----------- | :------: | :------------------------------------------------: |
| `$B1AA` | `FACINX` | NOT DONE | XXX - no stub added yet |
| `$B391` | `GIVAYF` | NOT DONE | XXX - no stub added yet |
| `$B7B5` | `STRVAL` | NOT DONE | XXX - no stub added yet |
| `$B850` | `FSUB` | NOT DONE | XXX - no stub added yet |
| `$B853` | `FSUBT` | NOT DONE | XXX - no stub added yet |
| `$B867` | `FADD` | NOT DONE | XXX - no stub added yet |
| `$B86A` | `FADDT` | NOT DONE | XXX - no stub added yet |
| `$B9EA` | `LOG` | NOT DONE | XXX - no stub added yet |
| `$BA28` | `FMULT` | NOT DONE | XXX - no stub added yet |
| `$BA8C` | `CONUPK` | NOT DONE | fetch FAC2 from RAM location |
| `$BAE2` | `MUL10` | NOT DONE | XXX - no stub added yet |
| `$BAFE` | `DIV10` | NOT DONE | XXX - no stub added yet |
| `$BB0F` | `FDIV` | NOT DONE | XXX - no stub added yet |
| `$BB12` | `FDIVT` | NOT DONE | XXX - no stub added yet |
| `$BBA2` | `MOVFM` | NOT DONE | fetch FAC1 from RAM location |
| `$BBD4` | `MOVMF` | NOT DONE | copy FAC1 to memory location, rounds if asked |
| `$BBFC` | `MOVEF` | NOT DONE | copy FAC2 to FAC1 |
| `$BC0F` | `MOVFA` | NOT DONE | copy FAC1 to FAC2, skips rounding |
| `$BC2B` | `SIGN` | NOT DONE | XXX - no stub added yet |
| `$BC39` | `SGN` | NOT DONE | XXX - no stub added yet |
| `$BC58` | `ABS` | NOT DONE | XXX - no stub added yet |
| `$BC5B` | `FCOMP` | NOT DONE | XXX - no stub added yet |
| `$BC9B` | `QINT` | NOT DONE | XXX - no stub added yet |
| `$BCCC` | `INT` | NOT DONE | XXX - no stub added yet |
| `$BCF3` | `FIN` | NOT DONE | XXX - no stub added yet |
| `$BDDD` | `FOUT` | NOT DONE | XXX - no stub added yet |
| `$BF71` | `SQR` | NOT DONE | XXX - no stub added yet |
| `$BF78` | `FPWR` | NOT DONE | XXX - no stub added yet |
| `$BF7B` | `FPWRT` | NOT DONE | XXX - no stub added yet |
| `$BFB4` | `NEGOP` | NOT DONE | XXX - no stub added yet |
| `$BFED` | `EXP` | NOT DONE | XXX - no stub added yet |
| `$E043` | `POLY1` | NOT DONE | XXX - no stub added yet |
| `$E059` | `POLY2` | NOT DONE | XXX - no stub added yet |
| `$E264` | `COS` | NOT DONE | XXX - no stub added yet |
| `$E26B` | `SIN` | NOT DONE | XXX - no stub added yet |
| `$E2B4` | `TAN` | NOT DONE | XXX - no stub added yet |
| `$E30E` | `ATN` | NOT DONE | XXX - no stub added yet |
<br />
### Other unofficial BASIC routines/locations
Not all of them - only these we want to have implemented.
+24
View File
@@ -0,0 +1,24 @@
// #LAYOUT# STD * #TAKE
// #LAYOUT# * BASIC_0 #TAKE
// #LAYOUT# * * #IGNORE
//
// Math package - fetch FAC2 from RAM location
//
// Input:
// - .A - address low byte
// - .Y - address high byte
//
// Output:
// - .A - FAC1 exponent (XXX really FAC1?)
//
// See also:
// - [CM64] Computes Mapping the Commodore 64 - page 114
// - https://www.c64-wiki.com/wiki/Floating_point_arithmetic
// - https://codebase64.org/doku.php?id=base:kernal_floating_point_mathematics
//
// XXX provide implementation
CONUPK:
STUB_IMPLEMENTATION()
+3
View File
@@ -0,0 +1,3 @@
This is an important floating point math routine, documented in many places.
XXX - try to find real-life example
+25
View File
@@ -0,0 +1,25 @@
// #LAYOUT# STD * #TAKE
// #LAYOUT# * BASIC_0 #TAKE
// #LAYOUT# * * #IGNORE
//
// Math package - copy FAC1 to memory location, rounds if asked
//
// Input:
// - .X - address low byte
// - .Y - address high byte
// - $70 - if MSB is set performs rouding
//
// Output:
// - .A - FAC1 exponent
//
// See also:
// - [CM64] Computes Mapping the Commodore 64 - page 114
// - https://www.c64-wiki.com/wiki/Floating_point_arithmetic
// - https://codebase64.org/doku.php?id=base:kernal_floating_point_mathematics
//
// XXX provide implementation
MOVMF:
STUB_IMPLEMENTATION()
+3
View File
@@ -0,0 +1,3 @@
This is an important floating point math routine, documented in many places.
XXX - try to find real-life example
+24
View File
@@ -0,0 +1,24 @@
// #LAYOUT# STD * #TAKE
// #LAYOUT# * BASIC_0 #TAKE
// #LAYOUT# * * #IGNORE
//
// Math package - fetch FAC1 from RAM location
//
// Input:
// - .A - address low byte
// - .Y - address high byte
//
// Output:
// - .A - FAC1 exponent, affects status flags
// - .Y - always 0
//
// See also:
// - https://www.c64-wiki.com/wiki/Floating_point_arithmetic
// - https://codebase64.org/doku.php?id=base:kernal_floating_point_mathematics
//
// XXX provide implementation
MOVFM:
STUB_IMPLEMENTATION()
+3
View File
@@ -0,0 +1,3 @@
This is an important floating point math routine, documented in many places.
XXX - try to find real-life example
+17
View File
@@ -0,0 +1,17 @@
// #LAYOUT# STD * #TAKE
// #LAYOUT# * BASIC_0 #TAKE
// #LAYOUT# * * #IGNORE
//
// Math package - copy FAC2 to FAC1
//
// See also:
// - [CM64] Computes Mapping the Commodore 64 - page 115
// - https://www.c64-wiki.com/wiki/Floating_point_arithmetic
// - https://codebase64.org/doku.php?id=base:kernal_floating_point_mathematics
//
// XXX provide implementation
MOVEF:
STUB_IMPLEMENTATION()
+3
View File
@@ -0,0 +1,3 @@
This is an important floating point math routine, documented in many places.
XXX - try to find real-life example
+17
View File
@@ -0,0 +1,17 @@
// #LAYOUT# STD * #TAKE
// #LAYOUT# * BASIC_0 #TAKE
// #LAYOUT# * * #IGNORE
//
// Math package - copy FAC1 to FAC2, skips rounding
//
// See also:
// - [CM64] Computes Mapping the Commodore 64 - page 115
// - https://www.c64-wiki.com/wiki/Floating_point_arithmetic
// - https://codebase64.org/doku.php?id=base:kernal_floating_point_mathematics
//
// XXX provide implementation
MOVFA:
STUB_IMPLEMENTATION()
+3
View File
@@ -0,0 +1,3 @@
This is an important floating point math routine, documented in many places.
XXX - try to find real-life example