Port and cleanup of the Motorola 68343 floating point library for the Sirichote 68008 kit
This library contains 68k assembly subroutines to compute with floating point numbers. It was originally written by Motorola about 40 years ago. It contains basic arithmetic, parsing and printing decimal, and several transcendental functions.
It uses a special 32 bit format to represent real numbers, called Fast Floating Point, which was apparently also used on Amiga computers in the 80s. The format is simpler (and faster) than the modern IEEE-754 single precision format, but has a more limited exponent range.
I use it to provide floating point numbers for Lox68k
- Build the Monitor ROM as described here
- Load project
MotoFFP.prjinto Ide68K and build it. - Execute
python makerom.pyto create mon_ffp.bin ROM image in the parallel rom directory.
- Burn this file into ROM or continue building the Lox68k project.
If you don't want to build the ROM yourself, a pre-built image mon_ffp.bin is included in
the release, containing both the Monitor and the FFP library.
The main incentive for resurrection of the Motorola FFP library was to provide floating point numbers for the Lox68k language, but of course you can utilize it for other projects as well.
The file test_ffp.asm shows how to call some routines from the library. Compile it in Ide68K
(without a project file), load it to the Kit and run it. It prints the result of the computation
to the terminal.
- Startup file
ffp_entry.asmdefines the branch entries into the library - Include file
ffp_math.incdefines official entrypoints for external library users
- Found at http://eab.abime.net/showthread.php?p=797994
- Original file http://eab.abime.net/attachment.php?attachmentid=30480&d=1328104342
- unpacked obscure
LZXarchive with online tool
- Removed unneeded IEEE files
IEFABS.SA,IEFADD.SA,IEFAFP.SAThere were no other IEEE files in the archive, probably got lost somewhere... - Removed unneeded program
FFPFPBCD.SA - Removed unneeded demo programs
FFPDEMO.SAandFFPCALC.SA - Removed
*.HTfiles - Renamed source files
*.SAto*.asm - Use
FFPMUL2instead ofFFPMULbecause of higher precision - Removed unsupported
TTL,PAGE,IDNT,OPT PCS,SECTION 9directives - Removed
ENDdirectives to combine all sources - Changed
MOVE.L #nn,DmtoMOVEQ #nn,Dmif value in range - Changed
ADD.s #ntoADDQ.s #nif value in range - Changed
SUB.s #ntoSUBQ.s #nif value in range - Use PC-relative addressing for constant tables
- Reactivated the CCR manipulation instructions, which weren't supported by ancient assembler
- Renamed some duplicated labels
- Removed 68010 compatibility code to save
SRon the stack - Created project file for defined order
- Allowed lower case
eas exponent marker inFFPAFP - Fixed overflow bugs in sinh and cosh
- Wrong docs on sinh, cosh, and tanh:
D3-D5are destroyed and must be saved