FORTH for the PC-G850(V)(S)
|
11-29-2022, 07:56 PM
Post: #10
|
|||
|
|||
RE: FORTH for the PC-G850(V)(S)
I've written new IEEE 754 floating point routines from scratch in Z80 for Forth850. I wasn't happy with the Z80 floating point libraries I found on GitHub and elsewhere, which appear to have sizable code bases and are heavy on memory access and use. The new Z80 floating point routines I wrote operate with Z80 registers only, including the shadow registers, except for a one push-pop pair to pass a value from a shadow register pair to a register pair. The shadow registers are available for use with the PC-G850 (i.e. not used by interrupts). So let's put them to work. The new math.asm Z80 library:
I may extend the library to support INF/NAN and banker's rounding to make it compliant with IEEE 754. Right now, the only observable difference is the rounding (lack thereof). Consistency of the numerical treatment is important. The Forth code for the Sine plot shown in the picture: Code: 3.14159265E0 2CONSTANT PI Code: : FSIN ( r1 -- r2 ) \ only valid for -2pi <= r1 <= 2pi I've updated the forth850-full version with the new features. The binary is about 10K, so there is plenty of space left on the machine. I've tested the implementation extensively and will continue to do so in the near future. - Rob "I count on old friends to remain rational" |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)