Reversing Sinclair's amazing 1974 calculator hack - half the ROM of the HP-35
files.righto.com
files.righto.com
Scientific calculators usually provide constants such as e and π but there was no space in the ROM for these constants. The Sinclair Scientific used the brilliant solution of printing the constants on the calculator's case
I guess the original creation but wow, now that is a dedicated hobbyist.
The Visual 6502 group enjoys dissolving old chips in acid, photographing the die, and reverse-engineering them.
Wow!
Unfortunately (or not, depending on your perspective) it's not just the Visual 6502 group that enjoys that. Any leading chip in the marketplace these days is almost immediately reverse engineered in this way. I haven't been in the chip business for a few years but I recall a company which offered this as a complete service - they'd send you detailed circuit schematics and so forth.
If you go back through their blog posts, they have some cool techniques for bypassing "security" metal meshes to read out the secure FLASH/ROM sections of chips.
IIRC, one of the guys behind FlyLogic was involved in the high-profile reverse engineering of satellite receivers (ie. satellite pirating).
And to reply to the parent comment - designing the calculator in the first place is much more amazing.
Unfortunately, as calculator prices collapsed, so did Sinclair Radionics' profits,
and the company was broken up in 1979 after heavy losses.
He fought Moore's law, and the law won.But this whole thing reminds me of Woz's work in the first Apples. Why wasn't his genius work similarly wiped out? Soon after the Apple, there were dozens - hundreds - of new personal computer manufacturers.
I think it's software. The value of a platform is what you can do with it. Software increases what you can do, therefore increases the value of the platform. There's increasing returns, so once it gets started, it gets harder and harder to stop.
Branding is also important (Jobs), which is why the Apple eventually fell to the "PC" - because the strongest computer brand in the world for decades was IBM.
Apple sued their clones out of existence. Might all be using Apple today if they had not.
Then they eventually switched to pc hardware themselves.
1. I wrote most of my high school reports on it.
2. I once wrote a set of WPL programs to automate the generation of multiple-choice tests, and sold it for $50 to my uncle who was a physics teacher.
3. Apple Writer was the second program I disassembled from beginning to end (the first was Locksmith Fast Disk Copy), learning a lot in the process.
You're welcome!
I know this is a predictable remark, but I miss the good old days. The Apple II was so simple and understandable that I was able to write a program that played two musical notes at once (I called it the "Electric Duet"), in tune, and a fairly tolerable sound, even though the speaker was driven by a TTL output (meaning no analog level control).
If the Apple II had had interrupts, my program would have stopped working. I know this because an Apple II successor supported a mouse, the mouse required an interrupt, and it ruined the performance of my program.
Oh, I almost forgot -- Tom Clancy wrote "The Hunt for Red October" on Apple Writer.
That program inspired me to (cough) take it apart and understand how something so cool could come out of the Apple II's speaker. That exercise taught me 6502 opcodes and I've been working in embedded systems ever since.
Near the end of the project, I had two problems: the music was slightly off-pitch -- middle A wasn't exactly 440 Hz -- and the number of machine cycles wasn't quite constant (it varied between 40 and 41 cycles depending on which branches the code took).
Finally I realized I could insert a single NOP (no-operation) instruction at a critical location. The NOP forced the number of cycles to be a constant, regardless of the path through the loop, and I then realized that it also slightly changed the output frequency to be tuned exactly right.
I will always remember that moment. :)
http://www.youtube.com/watch?v=6FDtXflMBmw
I searched for the original program online, but couldn't find it -- only the pirated version. By "pirated" I mean someone has removed my copyright notice and offered the program as their own, successfully replacing the original in all online archives.
Yeah, the Apple II era seems to have been particularly destructive with removing copyright notices in favor of "crack screens" and other drivel. Bleah.
More recently, I've been working on my own Apple II game (really). I'd like to release it fully open source, which makes it particularly challenging to use third-party libraries since open source wasn't really a "thing" when they were written. Some of them (notably old Beagle Bros. disks) have since been explicitly placed in the public domain.
So... I would very much like to have some Electric-Duet-based music and sound effects in my upcoming open source Apple II game. (Yes, I just typed that.) Would you be willing to relicense your amazing player routine under an open source license, or to place it in the public domain? I would, of course, give you full copyright attribution in the scrolling credits screen or wherever you'd like.
For what it's worth, the pirated version I had (back in the old days) had your name on it (plus a crack group's name and probably BBS phone number). I remember thinking "Hey, that's the Apple Writer guy, what else did he write?" and that's how I found GraFORTH. Bought Leo Brodie's book and had a blast learning the language, then actually implementing small Forth-like languages for the fun of it. There was a Byte book, "Threaded Interpretive Languages" that gave me several epiphanies about programming in general and language design in particular.
I used Apple Writer for years, until eventually my typing speed increased so much that the program couldn't keep up with me anymore when typing long paragraphs (the word wrap algorithm, that was run after each character, apparently took time proportional to the length of the current paragraph, with a big enough constant that my 1 MHz Apple II started dropping keystrokes regularly despite the program having a 32-character buffer). I eventually resorted to disabling word-wrap while typing, and re-enabling it prior to printing (Control-Z, I think it was). Later, I bought a Zip Chip that increased the computer speed to about 3.5 MHz, and the problem disappeared.
I wasn't using Apple Writer by then, because I had discovered another word processor, a weird, Rube Goldberg contraption called Gutenberg Sr. that used double-high-resolution graphics at a time when few programs did, and had a more powerful markup language (troff-inspired, I found out later), could two two-column printing and had some page layout capabilities, and had great support for printer-downloadable fonts, including user-defined ones. The interface was atrocious but the software itself was powerful.
http://www.atariarchives.org/deli/cottage_computer_programmi...
If so, how do I end up end where you are, in regards to wilderness programming and whatnot? Do you have a book (of any sort)? That's my dream.
> http://www.atariarchives.org/deli/cottage_computer_programmi...
Yep, that's me.
> If so, how do I end up end where you are, in regards to wilderness programming and whatnot?
Rather than try to duplicate my story, why not see how yours turns out? I bet it will be just as interesting.
> Do you have a book (of any sort)?
Only a free one about my around-the-world solo sail -- it includes lots of stories about my technological adventures:
http://arachnoid.com/sailbook/index.html
You can read it online or download a free Kindle file.
"Micromen" is a fantastic drama of the period...
Great idea, ahead of it's time engineering and attitude wise as well. Did not even have rare earth magnets, seen C5's with rare earth magnet motors instead of the stock motor and they are dangerously fast. Today we are slowly getting there, though cars still designed for everybody with a 4-5 member family with a boot of shopping all the time and the other end is a motorbike. Still a car/bike electric combinations do appear, albeit not mainstream and most put of from the safety of getting hit by others as you are smaller on the road effect. Which makes you think about the limitations of a vehicle that is surrounded by taller and larger ones, why we now start to believe in bike lanes. Which was a factor back then and why the C5 never kicked off enough to make the C10 and C15 go into production beyond the prototypes sadly and C5's started coming with a flag pole akin to a football/soccer corner post style pole and flag.
30 years later, and the electric car market is still miniscule.
There might start to be a market demand for them when petrol is at least twice as expensive as it is now. But there's some wiggle room to reduce the tax on it a lot.
I still feel though the whole electric vechile area needs more personal cheaper options and sadly even the electric bycicles options out there are not exactly cheap and flooding the markets.
The US however will be absolutely devastated.
Not that Research fared much better!
A good question. I'd say that the Apple II family survived longer than it deserved to because the hardware was so nice. Woz combined classical hacker insights with a look-and-feel quality ethic that the Commodores and Ataris couldn't live up to, being designed to target a price point beyond all else. Sure, those computers could do tricks with graphics and sound that the Apple couldn't match -- but if you wanted sharp, readable 80-column text for word processing or VisiCalc work, your only options were an Apple //e at $1500 or a similarly-equipped Tandy or IBM PC for well over $4000.
Apple's huge array of (relatively) low-cost peripherals also helped it compete against other platforms in the early days. These aspects weren't sexy but they were important to lots of home and small-business users.
Famously, the company was also smart enough to target K-12 education, which cultivated their marketplace from the ground up. Once again, the impression of quality versus the low-cost 8-bit competitors would have helped them do that.
Combined with Tandy's failure to follow up, and Commodore's incessant bungling in the US market (such as repeatedly pissing off their dealer network by letting their dealers absorb unannounced price changes) and decision to send most of its stock to Europe where they got higher margins, that explains more of it than lack of alternatives.
In Europe, Apple remained virtually unheard of until the Mac compared to Commodore, Atari and homegrown brands.
Largely thanks to its European market, Commodore still massively outsold Apple in terms of units shipped up until well into the Mac got popular - it's just that by the time the IIe started getting traction, Commodore had abandoned the high end and gone for volume, and by the time they went after the high end again, it was 1985, and Commodore's brand and sales channel in the US was even more tied to the cheap gaming image.
But if you wanted sharp, readable 80-column text you had several alternatives at the time of the IIe launch, at around the same price range, both from Commodore and others (from Commodore, the later entrants in the PET range - one is actually on display in my local library - as well as the ill fated Commodore B128-80)
Most of the other entrants that could compete for productivity applications in the same price range were from small unknown companies or insufficiently compatible with anything to get enough software, though, and so had little chance.
IBM's deeply entrenched position in supply office equipment (pre-PC computers, sure, but lots beside) to business played a role in securing PC dominance over Apple in the personal computing market, but so did the fact IBM didn't protect the PC from clones (IIRC, this was not intended) or acquire exclusive rights to DOS, which resulted in both more variety and more low-price options in the "IBM PC-compatible" family.
Software brings the real value to hardware.
Apple was niche and mostly unknown in the UK at the time. The Apple II never really made it here.
I can still remember humping various PETs in and out of Olympia for trade shows - and I still recall the various tricks you used to make sure that disks copied correctly.
Not even remotely true. There was a large homegrown industry (I worked in Cambridge at the time). Sinclair was a well-known early player but many others grew up at the same time and independantly. For a time it was known as the "Cambridge Phenomenon". What did spring from Sinclair was Acorn. If anything kick started the UK microcomputer industry it was the Cambridge University Computer Lab where Sinclair and others got much of their talent.
In short, it was a toy. Anyone basing one's academic grade on this thing was a fool. You really did have to spend the money for an HP-35, or the later Texas Instruments SR-5x calculators that were less expensive.
The 6502 is notable for its highly-efficient and patented (https://www.google.com/patents/US3991307) decimal arithmetic mode. I'll write up its interesting circuits sometime. One consequence of the patent is the processor in the NES video game is a 6502 clone that lacks decimal mode.
[1] http://www.visual6502.org/wiki/index.php?title=6502DecimalMo...
Quite true. The sexy multiplier chips from TRW (http://en.wikipedia.org/wiki/TRW_Inc. ) were still a few years off, and not intended for mere calculators. Same for the Intel x87 floating point co-processors (http://en.wikipedia.org/wiki/8087).
Nowadays the silicon real-estate cost for floating point math is trivial, and chip area is filled out with RAM cache for lack of anything better to do ...
40 years ago these calculators were looked upon with a bit of skepticism. Engineers that were used to seeing the log tables with their own eyes and hand-manipulating slide rules were being asked to trust the results coming out of these calculators.
And lives depended on it, really. If you were a civil engineer designing a bridge and you needed to be absolutely sure the numbers you were using were accurate to 7 places and totally correct, would you suddenly put all your faith in this small brown box with no way to examine the inner workings?
HP went through a lot to build that trust and it was rightly earned. HP's reputation for building solid accurate calculators kept that business going for decades to come.
This is dealt with by:
1. running the results through the inverse equations to verify that you get the inputs back again
2. calculating the results using an independent method to verify them
3. having a different group of people independently check your numbers
4. have your results pass a "reasonableness" test, i.e. do they make sense
5. put the resulting design on a test rig and verify the numbers experimentally
How do I know this? I worked on critical flight control systems for Boeing.
Any engineer who just punches numbers into a calculator and bets lives on the results ought to be fired.
I'm sorry to be so blunt about this, but I feel strongly about it. I too often run into engineers that either argue that they can design a perfect system that is not subject to human error, or they try to shift responsibility onto other people or organizations.
The real sticking point was getting a real arctan2 function (returning the angle in the range [0,360]). He really liked some BBC Basic programs I hacked up. Fun times.
I also owned a Sinclair ZX-80 (aka Timex) computer, later upgraded to a ZX-81 ROM with 16kB of memory.
Overall, Sinclair's problem seems to have been going a little too far in the "worse is better" direction with every product.
This makes chess on a 1k zx81 including display seem like bloat-ware now :).
Nowadays we have more storage on the keyboard controller chips, heck the older ones during the 90's had 4 KB storage, so almost 10x more ROM alone to work with - for a keyboard.
Tho in 1974 Sinclair could've fit it in a 37-char title.
You could build it on top of Android, and have the software be open-source while making money from selling the hardware (so you could run it on a touchscreen, but if you wanted a keyboard you'd buy the calculator).
For tasks that need to be done away from a computer sure a calculator is handy but that has rather dwindled down to basic calculations. Schoolwork sure calculators are great but I never needed more than my HP-48 and when I did it was usually an assignment meant more for MATLAB/Mathematica.
Now for your point of building it on top of android, what I want is not another device but I want a new calculator built for android. Everyone has a smartphone these days why should I have to buy a calculator when I have a strong computer in my pocket. We just need an interface for smartphones and the appropriately strong (Programmable) back end.
This looks nice but I don't have an iPhone https://itunes.apple.com/us/app/nd1/id368497993?mt=8
http://www.hpl.hp.com/hpjournal/pdfs/IssuePDFs/1972-06.pdf
The article goes into a lot of detail on the HP-35 internals, so it's worth a look.
thats my calculator hack
(The main benefit is that (R)PN is parenthesis-free, so it makes it easier for a calculator to process expressions with multiple operators. The use in programming languages is nonexistent but to make clear that +, *, .. are just like any other function call, where you would naturally use polish notation.)
There's even a "Reverse Polish Lisp" on HP calculators!
[1] http://en.wikipedia.org/wiki/List_of_programming_languages_b...
It's a great choice for tightly constrained devices, though far fewer devices have such constraints now. The mental overhead of having to track stack-effects for each function makes it difficult to scale to large systems and maintain productivity, but if you're trying to eke every iota of power out of a chip with a tiny amount of ROM, it's hard to beat a direct-threaded (or token-threaded...) Forth.
> The main benefit is that (R)PN is parenthesis-free
... so what you're saying is Lisp has all those parenthesis just to troll us?
Seriously though, using PN can make implementing parsers a lot simpler as it makes the grammar less ambiguous.
Sorry for OT.
All thing look really amaizing. I'd love to see more in this topic.
RPN vs Infix/Algebraic used to be a holy-war topic. Like emacs vs vi, or iPhone vs Android.
Once you go RPN, you can never go back again.
I've forgotten it all now, of course. How often do I need to calculate something?