Live data from Hacker News

Steve Wozniak's floating point routines for the 6502

tinyletter.com

161–170 of 182 posts

Re: Steve Wozniak's floating point routines for the 6502

#161

Woz was scary good at both hw and sw (author of Apple BASIC.) If you have time, go through his various Apple documents online. I believe he was never the same after his small plane crashed. (Back then, wealthy people used small planes like ATVs, and had about the same safety record.) I worked with another hw engineer of similar ability back in the 80s. Mind-blowing watching him just pick up a pen and draw out a compl…

I wonder why rich people have such a high urge to fly small airplanes. It seems to expose you to a lot of risk, which you could easily avoid (I’ve lived a considerable number of years without facing a single situation where I was likely to fly an airplane).

For some people risk isn't something to be avoided at all costs. It's a challenge to overcome. It's the same principal when you watch an amazing ski jump, musician, or gymnastics routine--taming the chaos.

This is a fundamental drive in many people that calls on something innate.

Re: Steve Wozniak's floating point routines for the 6502

#162

Woz was scary good at both hw and sw (author of Apple BASIC.) If you have time, go through his various Apple documents online. I believe he was never the same after his small plane crashed. (Back then, wealthy people used small planes like ATVs, and had about the same safety record.) I worked with another hw engineer of similar ability back in the 80s. Mind-blowing watching him just pick up a pen and draw out a compl…

I wonder why rich people have such a high urge to fly small airplanes. It seems to expose you to a lot of risk, which you could easily avoid (I’ve lived a considerable number of years without facing a single situation where I was likely to fly an airplane).

It's fun!

Re: Steve Wozniak's floating point routines for the 6502

#163

While I think Woz sets a good example, they're human - and I'm sure they've done and/or said things that are less than one might expect and which one probably wouldn't approve of or condone - or perhaps which one might even condemn. I'd caution against canonising people - it sets too high a standard; which no one real can meet.

Except for the Woz

Re: Steve Wozniak's floating point routines for the 6502

#164
post #98
post #70

Earlier quoted context omitted.

"A human with a skillet" -- oh, I'm guessing skillset is what you meant to say. I was feeling old and thinking I was ignorant of some new slang there for a few seconds. :-D

Well, there are youtube tutorials on how to solder SMD parts in in skillet, so you were not that far off ;-)

That's pretty funny, because doing some sort of electronic wizardry with a stove and a cast iron skillet is one of the other things that crossed my mind in that brief moment of confusion.

And it is totally something I could see Woz doing. :-D

Re: Steve Wozniak's floating point routines for the 6502

#165
Floating point can be tricky.

I competed in the first couple years of Sparkfun's autonomous vehicle competition. My robot had a keypad where you could enter GPS coordinates for waypoints. The microcontroller I was using had 32-bit soft floating point routines in its standard library, but I had to code my own string-to-float routine. (I think only float-to-string was provided, but not the inverse.)

Every year, the robot worked in Oklahoma but in Colorado would make a wild turn and head the wrong way. The morning of the last time I competed I realized the problem was in my string to floating point conversion code. I had made a programming assumption which was mathematically incorrect. It happened to work in Oklahoma because the fractional part of the GPS coordinates at home were in a range that didn't trigger the bug.

I also realized it meant the conversion algorithm was more subtle than I had assumed, and there was no way I was going to be able to figure out the correct algorithm in the field, under time pressure. In those years I either didn't yet have a smartphone, or I looked and couldn't find code on the web for my microcontroller.

(And I couldn't just drop in some C code - it was a Parallax Propeller and my robot's code was in the Spin language. Quirks of the chip made it unusually hard to port C to it and so C compilers for the Propeller were still what I would consider "experiemental" - or were when I started the project.)

The incorrect floating point code had been one of the first things I'd written - it'd been responsible for my robot crashing every year, including that morning. (I'd blamed hardware, upgraded the GPS unit, improved sensors, etc.)

One year later to the day, this was all on my mind again because I couldn't make it to the competition that year, and I had a shower thought. I had had a KNOWN GOOD floating point conversion routine on my hard drive and running inside my microcontroller that whole time!! I was using a Propeller GPS library. GPS data comes in NEMA strings which are... strings! By necessity, there was a private routine in the GPS object which had to be doing the conversion. I went and looked - yes, all I would have had to do was change this private routine to "public" and I could have called it.

Re: Steve Wozniak's floating point routines for the 6502

#166

Earlier quoted context omitted.

And if you don't have a 32-bit Windows system, you could always just run Windows 95 on your browser https://win95.ajf.me/win95.html

Why bother with Windows in that case? Just emulate DOS directly.

Not as cool though!

Re: Steve Wozniak's floating point routines for the 6502

#167
post #99

Earlier quoted context omitted.

A keyboard is actually a good place to learn some hardware stuff. You can (relatively) easily build a keyboard from scratch and program the chip (excluding USB, which is another can of worms). They are lots of tutorials and documentation online to get you started on it

Did early 8 bitters actually have a keyboard controller, or was it shift registers hooked directly to the cpu or something. Tried googling and didn't turn up much.

[deleted]

Re: Steve Wozniak's floating point routines for the 6502

#168

Woz was scary good at both hw and sw (author of Apple BASIC.) If you have time, go through his various Apple documents online. I believe he was never the same after his small plane crashed. (Back then, wealthy people used small planes like ATVs, and had about the same safety record.) I worked with another hw engineer of similar ability back in the 80s. Mind-blowing watching him just pick up a pen and draw out a compl…

I'm trying to view your comment in perspective. Aren't there a lot of Chinese folks with similar skills, nowadays? I mean, there are a lot of cheap devices on the Chinese market, with an overall complexity greater than Apple ][. Yes, these systems are mostly glued together from SoC devices, but the Apple ][ was also built around a (then) sophisticated building block, 6502.

There are probably many more people in the industry today who are stronger in a single domain but far fewer who have expertise in multiple domains. Woz has serious skills in software, digital and analog circuits. You might say 'so what's the big deal? Just get three people to replicate the skillset'... this works for some things but not for others. Without the cross-domain expertise, there are things that even a small team of three just won't see / think to try that a single person would. So while your team of three was still trying to understand the problem, Woz would likely have designed a more elegant solution using a smaller/cheaper BoM than they would eventually come up with. (Woz wasn't just extremely competent in multiple domains, he also worked very fast)

Re: Steve Wozniak's floating point routines for the 6502

#169
post #99

Earlier quoted context omitted.

A keyboard is actually a good place to learn some hardware stuff. You can (relatively) easily build a keyboard from scratch and program the chip (excluding USB, which is another can of worms). They are lots of tutorials and documentation online to get you started on it

Did early 8 bitters actually have a keyboard controller, or was it shift registers hooked directly to the cpu or something. Tried googling and didn't turn up much.

Keyboard interaction on the Apple II is entirely CPU-dependent, memory-mapped, and works like this: when a key is pressed, the ASCII code of the character is put at $C000, with the high bit set (a consequence of this is that there is no way for the computer to know that you pushed the shift key, for instance, or to tell the difference between typing Return or typing Control-M). Your program is responsible for checking $C000 from time to time. When the high bit is set, you read the character and access memory location $C010, which clears the $C000 high bit. Interrupts are not used at all, despite the 6502 supporting them, probably because disk and cassette IO is similarly done under CPU control with tight timing tolerances, and getting an interrupt in the middle of writing data would wreak havoc.

Details on page 16 of http://www.classiccmp.org/cini/pdf/Apple/Apple%20II%20Refere...

An exception is the "Reset" key which is hard-wired to the reset pin of the 6502. On early Apple II models, pushing "Reset", which is located just above Return, had disastrous consequences. People used to put a washer under the Reset key to make it harder to push by accident. Magazines published a simple hardware mod that required Control to be held at the same time as Reset, and later versions of the Apple II came with the mod built-in.

The Apple IIe keyboard adds two "apple" keys on both sides of the space bar which are dealt with in a completely different way, and are mapped to the same locations as the two joystick/paddle buttons. This was useful for playing games which required repetitive button-mashing, as it is easier to type a key quickly than to push a joystick button quickly. Since I was used to controlling the joystick with one hand and pushing a key on the keyboard with another hand, I had no problem adapting to early Macintosh software that required shift-click, option-click and command-click to overcome the limitation of a one-button mouse.

"The Macintosh mouse has four buttons, it's just that three of them are on the keyboard."

Re: Steve Wozniak's floating point routines for the 6502

#170
post #54

See also his (probably better known) 16-bit VM, Sweet 16. Published in Byte November, 1977: https://archive.org/details/byte-magazine-1977-11/page/n147 http://amigan.1emu.net/kolsen/programming/sweet16.html

Woz says the article you linked in Byte is a followup to the OP. Good find.
Post reply on HN