Fast Floating Point Revision F: Marslett's Math ROM Source Released

At the end of April 2021 luckybuck of the AtariWiki team announced that the source code of Fast Floating Point, Revision F had been found and could be published. Charles W. Marslett wrote it in 1981, and it was sold as Newell Industries' Fastchip, a replacement for the floating-point ROM in the Atari 400/800. Marslett checked the release and agreed to it being in the public domain. Robert "Bob" Puff had translated the original AMAC source to MAC/65 format, and drac030 found the final byte that needed changing. The archive file, faschips.arc, came from a University of Michigan software archive.

What the package does

The Atari OS keeps its floating-point routines (the "math pack") in ROM at $D800–$DFFF. Atari BASIC and other languages call them for every non-integer calculation. Marslett's version keeps every entry point at the same address, such as AFP, FASC, FADD, FMUL, FDIV, PLYEVL, EXP and LOG, so existing software runs unchanged, only faster. The announcement claimed up to 3.5 times the speed of the original. To use it you replace the floating-point part of the OS: burn a new OS ROM, or patch a copy of the OS running in RAM on an XL/XE.

The fine print

The forum quickly added some caveats:

  • It isn't really new code. drac030 compared it with the binary that had circulated for years as "Revision E" (available on his own website since about 2008). The two were identical apart from a few filler bytes; the "E" label came from two missing comment lines at the top of the source. Faicuai compared it with a 1984 Newell FastFP ROM dump and found only the first six bytes differ. What is new is a complete, authorised source.
  • XL/XE OS checksums. On an XL OS ROM the checksum at $C000 must be recalculated after patching in the new routines.
  • Turbo-BASIC XL incompatibility. Its LOG, CLOG and power functions read constants inside the original math pack. Marslett's package keeps those constants at different addresses, so the results come out wrong.
  • Speed in practice. One tester saw no difference in a quick BASIC timing test in Altirra. Faicuai's FPTEST34.BAS benchmark, which combines speed and precision in one index, scored about 2.9× for Atari BASIC rev. C with Rev. F against the stock math pack. The same BASIC with Altirra's floating-point routines scored about 5.5×; those routines are a little slower but much more precise.

The thread also corrected the AtariWiki description: the routines use polynomial approximations, not CORDIC. The author of the OS++ replacement OS explained that it uses an 8th-order minimax polynomial for logarithms instead of Atari's 10th-order series, which is both more accurate and faster.

Why it matters

Fastchip was an early third-party upgrade to the Atari OS ROMs, and having its full source means it can be studied, reassembled and compared with later replacements such as the Altirra math pack. Anyone building a custom OS ROM now has the commented original.

Getting it

The announcement pointed to AtariWiki. While the wiki was briefly offline, luckybuck attached FastChip-final.atr to the "FAST FLOATING POINT, Revision F is found!" thread in AtariAge's 8-bit programming forum. Before burning an XL ROM, fix the checksum, and don't use the ROM with Turbo-BASIC XL.

Credits