31 ms·
Steve Wozniak's floating point routines for the 6502
- sagebird 7y agoI jumped into reading this note without looking at the url or author and near the end I was wondering who wrote it -- Then I saw the reference to the SPI driver which was a dead give away for James Bowman. I am continuously impressed with his work in the embedded scene after discovering the gameduino. It feels like even though there are thousands of voices on the web I actually only care about what perhaps 50 people are writing.
- dilippkumar 7y agoI have never heard of James Bowman before. I’ll look into his writing some more. Would you mind pointing me to some more of these interesting writers?
- dekhn 7y agoI don't think many people realize that Woz's dad was an electrical engineer at Lockheed who would bring home computer manuals that Woz would read as a kid. This seems to be a fairly effective way to create world-changing computer engineers.
- dalbasal 7y agoBreeding?
- ggm 7y agoRegression tends to the mean. Imagine what Apple might have been if Woz's dad had been in the factory!
- taneq 7y ago'Tends', not 'is guaranteed to go'. Sometimes kids are much smarter than their parents.
- abecedarius 7y agoRegression to the mean works equally in both directions, yes. A tall kid likely has shorter parents (though still above-average), and so on.
- pkaye 7y agoSteve Jobs' father was a machinist for a firm that made lasers.
- ggm 7y agoThat mac is awesome -Look in here.. with your one remaining good eye...
- delinka 7y agoJobs would have found a similarly capable engineer. Apple wouldn't be much different. Imagine where Woz's life might have taken him had his dad worked elsewhere...
- hedora 7y agoThe Apple I was a hobby project developed before Woz met Jobs, if I remember right.
- dangwu 7y agoIf you gave computer manuals to kids today, they'd cry and beg for their phones back
- kart23 7y agoDont give them a phone in the first place
- lacampbell 7y agoWhat's your point? Most kids back then would have cried and begged for their comics back, or for the television to be switched back on.
- dangwu 7y agoI'm disagreeing with OP's suggestion that giving computer manuals to kids is a "fairly effective way to create world-changing computer engineers."
- fao_ 7y agoYou could give computer manuals, but you have to: a) praise achievement not intelligence and b) Create an interest first. Maybe make it seem like magic or show something that you can do with it.
- lacampbell 7y agoAnd I think it depends on the kid, and the fact that smart phones exists now makes little difference.
- darkpuma 7y agoWhen I was a kid, some of my friends would whine whenever their parents took away their gameboy. But I didn't have a gameboy, so I never had the opportunity to whine about it being taken.
- deleted 7y ago[deleted]
- deleted 7y ago
- bluedino 7y agoMy boss's son is like that. He has brought him into the office since he was a kid, he's 22 now and content to go home and read PLC manuals and such. He doesn't have any social skills and doesn't really interact with anyone except 2-3 people from work, it's kind of sad.
- commandlinefan 7y agoI learned to program on a 6502 when I was younger - it's a little depressing that computers went and got so fast that there's no real justification for doing this sort of thing any more in almost any domain (except, I guess, if you manage to land a position developing embedded I2C drivers).
- jhayward 7y agoJoin the ultra-low-power crowd! There are lots of fun things to make while trying to squeeze it in a couple of KB and a few kHz.
- chrischen 7y agoYes but there are new primitive domains to master, like driving a motor with an arduino, or programming FPGAs.
- djmips 7y agoI beg to differ; shader / GPU programming has been a haven for justification of programming 'that sort of thing'. Particularly on home consoles where the hardware doesn't change year on year but the need to improve is still prevalent.
- fzort 7y agoYou still need to know a bit of assembly to take advantage of SIMD (even when using compiler intrinsics). See for instance https://github.com/lemire/simdjson https://github.com/lemire/simdjson
- dev_dull 7y ago> They took the limitations of their computers as a challenge, sat down, and made these tiny machines do impressive things. Poets knew from long ago that using pentameter and constraints fosters creativity. Here we see the same principle applied in computing.
- np_tedious 7y ago> Within the Sonnet’s scanty plot of ground; Pleased if some Souls (for such there needs must be) Who have felt the weight of too much liberty, Should find brief solace there, as I have found. https://www.poetryfoundation.org/poems/52299/nuns-fret-not-at-their-convents-narrow-room https://www.poetryfoundation.org/poems/52299/nuns-fret-not-a...
- bencoder 7y agoThe craft/art still exists in the demoscene
- natashabaker 7y agoThis is what I love about the C256 project (https://c256foenix.com/ https://c256foenix.com/). From an interview with her: By limiting its resources, future developers will have to be clever to find new ways to create amazing things that early on we thought we could never do. Memory is cheap, so I could easily spend the same amount of money on a single chip that could have given me the chance to fill the memory space with RAM. But instead, I am choosing to use many chips with much lower capacity. It’s more limiting, but that’s the point."
- cmrdporcupine 7y agoIf you haven't, order a Rev C board and contribute! https://c256foenix.com/product/c256-foenix-rev-c-bare-board-with-floppy/ https://c256foenix.com/product/c256-foenix-rev-c-bare-board-...
- rswail 7y agoQ: Does the creation of Design admit constraint? Design depends largely on constraints. Q: What constraints? The sum of all constraints. Here is one of the few effective keys to the Design problem: the ability of the Designer to recognize as many of the constraints as possible; his willingness and enthusiasm for working within these constraints. Constraints of price, of size, of strength, of balance, of surface, of time, and so forth. Each problem has its own peculiar list. - Charles Eames
- redis_mlc 7y agoWoz 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 complete board schematic at lunch, then getting the working board back from mfg. the following week and launching it on the Space Shuttle.
- fao_ 7y ago> Woz was scary good at both hw and sw You damn-near gave me a heart attack then! :D I thought he had died for a moment, Phew!
- schmookeeg 7y agoA 50-hour pilot in a Bonanza A36TC is insane, I had no idea Woz landed off-airport. I do checkouts in Bonanzas, and the more typical A36TC/TN pilot has 500 hours' experience or more. (Some of us still use small planes like ATVs -- but if the description of Woz' experience in the incident is accurate, this is like taking a Lamborghini out with a fresh driving permit) [1] https://www.cultofmac.com/465778/today-in-apple-history-steve-wozniak-in-plane-crash/ https://www.cultofmac.com/465778/today-in-apple-history-stev...
- jeremyjh 7y ago
- simonebrunozzi 7y agoThe title says "Wozniac" but it really should be with a final "k", as in "Wozniak".
- JadeNB 7y agoAs, curiously, it is spelt everywhere in the article itself except the title.
- mothsonasloth 7y agoAs a senior Java / CPP developer, reading what Wozniak had written, it might have been some incantation in a forgotten language. I really wish I had done more embedded and assembly at school. I can't understand it or appreciate it. Maybe SW and HW shouldn't mix, bar a few visionaries who bridge both worlds?
- NonEUCitizen 7y agoWhy should SW and HW not mix?
- mothsonasloth 7y agoWell, my day to day job is writing applications that will be managed at runtime by a JVM on a Linux distro which is in turn virualised. I am so far away from the bits...
- bregma 7y agoHardware smells of rosin core and ozone. Software smells like someone hasn't showered or changed clothes in two weeks. Not a good mix.
- empath75 7y agoplay the zachtronics games if you want a taste of it.
- leoc 7y agoI'd say grab a free emulator for an 8-bit machine, like Fuse http://fuse-emulator.sourceforge.net/ http://fuse-emulator.sourceforge.net/ or VICE http://vice-emu.sourceforge.net/ http://vice-emu.sourceforge.net/ .
- unoti 7y agoI did assembly on 6502, 6809 family, and 68000 for quite a few years. While I did enjoy Tis-100 and other zachtronics titles, those are actually quite a bit more challenging than real assembly programming. In real assembly you’re pretty much never limited to like 1 or 2 bytes of ram to work with. Zachtronics games are more like puzzle games than a real taste of assembly. For a real taste of assembly, write a little game in real assembly, or maybe calculate Fibonacci numbers in 6809 assembly, or maybe play with Chip-8.
- WalterBright 7y agoHaving written a lot of 8 bit assembler for the 6800 microprocessor for 2K eproms, I can attest it is a very different skill from writing modern software.
- paulsmith 7y agoWould love to hear more about this - have you written on your experiences?
- WalterBright 7y agoNo, and sadly I've lost the code I wrote, I don't know what happened to it. Anyhow, programming an 8 bit 6800 for an embedded controller means keeping track of 6 or more things going on at the same time, while modern software focuses on one thing at a time and isolating it from everything else. Those things include the contents of each register, the stack level, the size of the code, interrupts going off, polling that has to be done, counting cycles, etc. Organizing code into functions is a luxury not usually affordable. It sounds tedious, but it was fun. I attached my own hard disk drive to my LSI-11, meaning I had to build an interface board and write a device driver. To figure out how to write the device driver, I dumped the floppy driver code. It was a marvel of tight engineering. The bootstrap loader was executing code only an instruction or two behind it getting loaded. I was just in awe.
- WalterBright 7y agoHere's a piece of assembler I wrote for the LSI-11: https://github.com/DigitalMars/Empire-for-PDP-11/blob/master/FIGHMV.MAC https://github.com/DigitalMars/Empire-for-PDP-11/blob/master...
- cmrdporcupine 7y agoIf you think about it, it's pretty crazy. Register allocation using graph colouring is an NP-complete problem. Writing assembler by hand, one is doing this constantly in one's head, and often with better results than a compiler would do.
- 7y ago
- justinjlynn 7y agoSteve Wozniak is one of the few people of note in the tech industry who, the more I learn about them, seems more and more worthy of my respect. When I hear others speak of their sense of humour, how they stuck by their friends even when those friends clearly took advantage of them, the work and exemplary engineering skill they so clearly poured into their projects, their financial success and, then after having enjoyed that success, their leaving that successful business behind to engage in improving things for the future - to invest in educating children - I feel a sense of loss. Steve Wozniak just seems like the kind of person one would be lucky to have the opportunity to have as a friend one could learn so much from. It's rare to feel that way about people one doesn't know first hand and, while it does feel like missing out, it's nice to have a prominent example of such a person, a financially successful person, within the tech industry - often a dark place indeed. A reminder that one doesn't have to be soulless in order to succeed in the valley - just skilled and, hopefully, lucky. "So shines a good deed in a weary world."
- canada_dry 7y agoMaybe not in the same category (i.e. electronic design), but the other guy that I admire the hell outof is Adam Savage. The guy is just bloody brilliant at D-I-Y and, like Woz, a down-to-earth-nice-guy. I've had the great pleasure of meeting both men and they dispelled the myth about meeting your heroes.
- blueberry_47 7y agoBUSTED
- spullara 7y agoMy wife follows him on 4square, now Swarm. I wish he would eat at better restaurants so we might enjoy his company in the world longer.
- BurningFrog 7y agoAside from being a saint, I think Woz singlehandedly jumpstarted the computer industry by 1-2 years with his genius early designs. It would be 2017 now if it wasn't for him!
- dang 7y agoA thread from 2014: https://news.ycombinator.com/item?id=7768465 https://news.ycombinator.com/item?id=7768465
- js2 7y agoSee 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 https://archive.org/details/byte-magazine-1977-11/page/n147 http://amigan.1emu.net/kolsen/programming/sweet16.html http://amigan.1emu.net/kolsen/programming/sweet16.html
- phs318u 7y agoWhat a great read. Thanks for that.
- beautifulfreak 7y agoWoz says the article you linked in Byte is a followup to the OP. Good find.
- ananonymoususer 7y agoThe 8051 platform can present even more challenges for assembly language code developers than the 6502. It has been over 35 years since I wrote any 6502 code, and over 30 years since I wrote any 8051 code, but I remember the biggest issue on 8051 was the lack of RAM. You get a total of 384 bytes of RAM (256 bytes of normal RAM and 128 bytes of "zero page" RAM). When I needed to write floating point math functions for the 8051, I realized that fixed point decimal math would meet my requirements. I took advantage of the large ROM space to store a bunch of constants (powers of 10) and the code I wrote operated on decimal ASCII strings. Because of the limited memory, all of my operators would destroy the second argument and replace it with the result. Code is available upon request.
- protomyth 7y agoYeah, Intel is an odd bunch. If I had to program an 8-bit machine again, I think the 6809 is still my favorite.
- ananonymoususer 7y agoThe 6809 was a great 8-bit microprocessor. Any CPU with a SEX instruction is okay in my book.
- ddingus 7y agoTotally. That one is beautiful, fast, fun, etc... I keep a Color Computer 3 because it has that excellent chip in it.
- constmu 7y agoThere are a couple of famous books for reading Steve Jobs' biography. Are there similarly good books to read about Steve Wozniak's biography?
- justinjlynn 7y agoWhile 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.
- pg_is_a_butt 7y agopeople are real, genius.
- vasco 7y agoPerhaps out of place but why are you consistently calling Woz "they"? I'm not a native speaker and it sounds very weird.
- justinjlynn 7y agoAs I'm not aware of what pronouns they personally prefer, I fall back to using the singular, gender-neutral, "they/them/their". It's a fairly new usage in colloquial English but I find it to be common enough so as to not impair understanding.
- bsaul 7y agocompletely off topic, but is this where we’re at now ? Calling someone « they » and thus create confusion, just in case he doesn’t belong to the 99.9% of the population who is just fine with his DNA, and eventhough he never expressed any kind of opinion leading you to think he isn’t fine with his gender ?
- foldr 7y agoSingular 'they' is pretty well established usage by now, regardless of gender considerations. Even people who complain about it still use it: https://stroppyeditor.wordpress.com/2015/04/21/everything-you-ever-wanted-to-know-about-singular-they/ https://stroppyeditor.wordpress.com/2015/04/21/everything-yo...
- ARandomerDude 7y agoHe was 2nd author on the paper. No doubt, Woz has a well-deserved reputation for brilliance, but I wonder about the 1st author's contributions too. Anyone familiar with Roy Rankin of Stanford? https://archive.org/details/dr_dobbs_journal_vol_01/page/n207 https://archive.org/details/dr_dobbs_journal_vol_01/page/n20...
- peteri 7y agoRoy contributed the log/exp routines. The code in the Apple II ROM are missing the log/exp routines and it's copyright just credits Woz.
- Udik 7y agoFor the two people who might not have seen it yet, here's that fabulous joint interview to Steve Jobs and Bill Gates, where they recount the story of the (missing) floating point routines in Woz's BASIC for the Apple, and how Microsoft came to rescue. https://www.youtube.com/watch?v=-LUGU0xprUo#t=14m20s https://www.youtube.com/watch?v=-LUGU0xprUo#t=14m20s The whole interview is fantastic.
- iainmerrick 7y agoI was always very impressed by the floating point routines in BBC Basic (also on the 6502). Anyone know who wrote those, and if they were derived from this work by Rankin and Wozniak? BBC Basic is the best all-round Basic of its era that I know of, with rich control flow features, proper recursion and built-in assembler. But I don't know how much was original work from Acorn and how much was borrowed from elsewhere. Are there any other 8-bit Basics that are especially good?
- vanderZwan 7y agoSophie Wilson apparently did most of the BBC Basic implementation, no idea if that also included the floating point routines. https://en.wikipedia.org/wiki/Sophie_Wilson https://en.wikipedia.org/wiki/Sophie_Wilson
- jackhack 7y agoHow curious that there's a reference to Jef Raskin on the facing page (p.205). Raskin, of course, was a visionary at Apple who would go on to advocate for a version of Macintosh quite different from what Steve Jobs envisioned (but which later appeared as the Cannon Cat). (a standalone system, but also an Apple ][ expansion card: https://en.wikipedia.org/wiki/Canon_Cat https://en.wikipedia.org/wiki/Canon_Cat ) And yes, Wozniak is one of the great engineers of our time. I cut my teeth on an Apple ][, and it was both amazing and mysterious to me then, as a child. Now, with 40 years of professional programming experience, the mystery is largely gone but my appreciation for the elegance of his design is only amplified. On the off-chance he'll see this: Mr. Wozniak, thank you for creating something that has give me a career and a lifetime of joy.
- phaedrus 7y agoFloating 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.
- michelinman 7y agoWoz ur the man.
- gomijacogeo 7y agoHe also wrote a nifty article back in '81 about calculating e to 118,000 decimal places. https://downloads.reactivemicro.com/Users/Grant_Stockley/Apple%202%20Woz%20e%20Calc%201981.pdf https://downloads.reactivemicro.com/Users/Grant_Stockley/App...
- Mauricio_ 7y ago"They presume a four-byte floating point operand consisting of a one-byte exponent ranging from -218 through +127..." Is this a mistake on the magazine?
- hi41 7y agoI need to confess. I am absolutely petrified by floating point. Is there a good resource I can learn it from.