Floating Point Routines for the 6502 (1976)
6502.org
6502.org
edit: I see from the link in the comment posted by ddingus that there is also an errata with a fix for the bug in the original code. http://codebase64.org/doku.php?id=base:errata_for_rankin_s_6...
There are some C compilers (http://www.6502.org/tools/lang/) for the processor, but it quickly becomes obvious just how poorly C fits. The 6502 is basically a processor that forces one to code with a bytecode + interpreter or in native assembly.
Which brings me back to the zero page. It is is both the solution to getting anything complex done. And simultaneously the problem because there isn't a good way to allocate space there (because the zero page locations are encoded directly in the instructions).
(Trying to allocate space there dynamically is certainly a fool's errand, of course.)
(Just to add to this, that hundred or so free bytes in the $0300 page IIRC was also a problem. Lots of utilities used it, so I remember there being a lot of conflicts there too).
I think the format was: 1 bit sign, 7 bit exponent, 32 bit mantissa.
(This code is for the version of BBC BASIC that shipped with Acorn's Master 128.)
http://codebase64.org/doku.php?id=base:6502_6510_maths
Tons of great little tricks in there. 6502 math coding is kind of fun in this way.
A look at old games, such as "Elite" ( http://www.iancgbell.clara.net/elite/) show many trade offs being used to make simple wireframe 3D plausible at some few frames per second.
https://news.ycombinator.com/item?id=2064030
To compare, modern Intel i7 processors have around 2 billion (some less, some more).
Yet there was customer demand for floating-point and Apple ended up contracting Microsoft's BASIC (which included FP) as Applesoft. Supposedly this was because "Wozniak—the only person who understood Integer BASIC well enough to add floating point features—was busy with the Disk II drive and controller and with Apple DOS, Apple turned to Microsoft."
It's hard for me to imagine that Apple didn't have a single engineer that could incorporate these already-written-by-Woz routines into Woz's Integer BASIC.
Reference: http://en.wikipedia.org/wiki/Applesoft_BASIC
I still have one. It's setup to play some old games and I will write programs on it from time to time.
The kids enjoyed it. Grand kids will one day. Maybe...
* BASIC FLOATING POINT ROUTINES
* FOR 6502 MICROPROCESSOR
* BY R. RANKIN AND S. WOZNIAK