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.prj
into Ide68K and build it. - Execute
python makerom.py
to 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.asm
defines the branch entries into the library - Include file
ffp_math.inc
defines 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
LZX
archive with online tool
- Removed unneeded IEEE files
IEFABS.SA
,IEFADD.SA
,IEFAFP.SA
There were no other IEEE files in the archive, probably got lost somewhere... - Removed unneeded program
FFPFPBCD.SA
- Removed unneeded demo programs
FFPDEMO.SA
andFFPCALC.SA
- Removed
*.HT
files - Renamed source files
*.SA
to*.asm
- Use
FFPMUL2
instead ofFFPMUL
because of higher precision - Removed unsupported
TTL
,PAGE
,IDNT
,OPT PCS
,SECTION 9
directives - Removed
END
directives to combine all sources - Changed
MOVE.L #nn,Dm
toMOVEQ #nn,Dm
if value in range - Changed
ADD.s #n
toADDQ.s #n
if value in range - Changed
SUB.s #n
toSUBQ.s #n
if 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
SR
on the stack - Created project file for defined order
- Allowed lower case
e
as exponent marker inFFPAFP
- Fixed overflow bugs in sinh and cosh
- Wrong docs on sinh, cosh, and tanh:
D3-D5
are destroyed and must be saved