Historians Recreate Source Code of First 4004 Application
mcpublic writes "The team of 'digital archaeologists' who developed the technology behind the Intel Museum's 4004 microprocessor exhibit have done it again. 36 years after Intel introduced their first microprocessor on November 15, 1971, these computer historians have turned the spotlight on the first application software ever written for a general-purpose microprocessor: the Busicom 141-PF calculator. At the team's web site you can download and play with an authentic calculator simulator that sports a cool animated flowchart. Want to find out how Busicom's Masatoshi Shima compressed an entire four-function, printing calculator into only 1,024 bytes of ROM? Check out the newly recreated assembly language "source code," extensively analyzed, documented, and commented by the team's newest member: Hungary's Lajos Kintli. 'He is an amazing reverse-engineer,' recounts team leader Tim McNerney, 'We understood the disassembled calculator code well enough to simulate it, but Lajos really turned it into "source code" of the highest standards.'"
Somewhere around 1975 or 1976 I wrote software for a 4004 (using a teletype connected to a modem connected to a mainframe someplace that had the assembler) to run a X-Y table. You would place a wafer with thick-film resistors on it and it would test each one to make sure it was within tolerance and if it wasn't it would mark it with magnetic ink. I think we were probably still using the infamous 1702 EPROMs but there might have been something newer at that time.
You can still run it on the latest Intel x86 chips. ;)
"Historians Recreate Source Code of First 404 Error Message"
(truth be told, quick scanning the headlines, that's what my brain registered)
intellectual property law is philosophically incoherent. it is your moral duty to ignore it or sabotage it
No: 4-bit devices are outside the range of Linux.
proud caffeine whore
"...an authentic calculator simulator..."
What the hell is an authentic simulator?
The original lacked a gui.
And scientific functions.
And the ability to convert hex.
And store/recall.
The original had 4 functions. This one has at least 40. Would you rather the MS guys spend time seeing if they can force their 114k application down into 10k, or perhaps writing an operating system that doesn't suck?
That sounds like a dare to me.
If you build it, nerds will come. Soylentnews.org
It'd be an improvement if MS did either.
I'm pretty sure it had a GUI. I'f I were to guess, I'd say it was buttons...possibly with numbers on them.
The Kruger Dunning explains most post on
Quick, someone send this over to the folks who wrote Excel!
Hello world!
A feeling of having made the same mistake before: Deja Foobar
58008
The Kruger Dunning explains most post on
Here's a real dare: have linux work on a 1-bit turing machine that has no registers
proud caffeine whore
I once reverse engineered the classic id software game Commander Keen. John Carmack did some cool stuff in that code.. each sprite had two function pointers in it, one was called when the sprite came into contact with another sprite, the other was called every frame to animate the sprite (he called it the "think" function). When you killed a monster the sprite was replaced with a "body" which was just like a sprite but had a few less fields (so it took up less memory). One of the neatest things he did was use this exact same framework of sprites and bodies to animate the "static" parts of the game. For example, the color coded doors that you have to get the key cards to open were sprites with a contact function that checked if the player had the right key card, at which time they would "die" and be replaced by a body that had a think function would make them slide out of the way.
For anyone who would like to take a look, I've put the re-engineered source code up.
How we know is more important than what we know.
That is the correct answer - all modern calculators are descended from a competitor's model which incorrectly calculated 9+9 to be 18.
Control is an illusion, order our comforting lie. From chaos, through chaos, into chaos we fly
Take a look at this set of videos from MIT's 6.004 Computation Structures class. They basically walk through the design of a simple 32-bit CPU from transistors, to gates, to functional blocks, to a full processor.
Anyway, reading about how hard it was to recreate the source code from the 4004 makes me wonder how easily we could find source code for some apps from even a decade ago. Lots of companies have gone bankrupt / discontinued products / been sold / etc, and we all know that lots of people aren't good about backing up their code. It's neat to go to the Linux Kernel Archives and look at the Historic Linux sources.
--
Educational microcontroller kits for the digital generation.
'He is an amazing reverse-engineer,' recounts team leader Tim McNerney, 'We understood the disassembled calculator code well enough to simulate it, but Lajos really turned it into "source code" of the highest standards.'
No disrespect to Lajos, but have we really fallen so far in programming standards that it's considered "amazing" to disassemble a 1024 byte program? Back in my day (and stay the hell off my lawn!) we used to disassemble programs all the time. I reverse engineered the operating system for a computer I developed for because we wanted to hook into places that weren't accessible.
Disassembly is apparently a lost art in these decadent days of some programmers never using anything but scripting languages (e.g., Java, Python, Perl) and having no clue what goes on under the hood.
Sometimes it's best to just let stupid people be stupid.
I think you will find that was a PUI (physical user interface)
You could read the documentation. You want 9+ 9+ = At the end you did 9+9+9 You could look at what's on the tape. IHBTHIND
Ever dream you could fly? Get up from the Flight Sim. I Fly
Did it, but the ATI drivers still sucked.
A lot of people don't know this, but Windows' Calc.exe actually implements arbitrary precision math. Don't believe me? Calculate 20000!, or calculate 1/3 and repeatedly multiply by 10 and subtract 3.
:)
Try that in 1024 bytes
So you are saying that nobody had the source backed up anywhere? We have come so far, yet haven't gone very far at all...
http://Communityville.com - A free place for new and old neighborhood webmasters to hang out.
'leet speak first turned the world upside down as a joke about "BOOBLESS". I wonder if the 4004 could run a softporn text adventure game like that.
--
make install -not war
[reminisce] Back in 1972 I did the first uP project at Cornell using a 4004. No assembler, no emulator, not even a PROM programmer. Just a list of op-codes and a sheet of paper that I wrote H or L for every bit of the PROM. That got sent to a electronics distributor that would program the part. Unfortunately, I can't claim to have done the first OPERATING uP project at Cornell! [/reminisce]
(This sig intentionally left blank)
whah! ah! ah! ah! ah! ah!
Your comment violated the "postercomment" compression filter. Try less whitespace and/or less repetition. Comment aborted.
I found a buffer overflow. Exploit code to follow...
The KDE guys have gotten theirs to about 5k with a somewhat more functionality than Window's.
In 1970 the PDP series from DEC, e.g. PDP-8, had an interpreted (and used interactively) language called FOCAL, arrays (even sparse ones), real numbers, usual math and other functions, for loops, if statements blah blah blah... all the usual stuff - the entire interpreter *and* runtime was programmed in a total of 2K instructions (and they were primitive instructions). That was normal for the time.
The tyrant will always find a pretext for his tyranny - Aesop
File version 6.0.6000.16386
Size: 172 KB (176,128 bytes)
kinda puts things in perspective, doesn't it?
ah, "progress"
intellectual property law is philosophically incoherent. it is your moral duty to ignore it or sabotage it
Of course if you had bothered to read the article, you'd know that it doesn't work like todays calculators but like the old adding machines:
"The electronic calculators that accountants used 35 years ago worked differently than the familiar four-function calculator we use today. These were designed to behave much like mechanical adding machines of the 1960's. After every number you want to add to the total, you need to press +, so = doesn't work like you'd expect. Here are some examples:
To add three numbers: 61 + 79 + 83 + = (if you forget the last +, the 83 won't get added)
To subtract two numbers: 2007 + 1971 - =
To multiply two numbers: 125 x 5 = (this is more like we're used to)
To divide two numbers: 625 / 5 = "
Knowledge is how to play a game, intelligence is how to win, wisdom is knowing what game to play.
You can run it in real time!
Knowledge is how to play a game, intelligence is how to win, wisdom is knowing what game to play.
People used to consider square wave logic charts a programming tool back then, too.
Do not mock my vision of impractical footwear
I kind of wish their Excel could do at least 200!
Or at least that it would do "=(10.1)-10-0.1" properly
Obama likes poor people so much, he wants to make more of them.
Yep, the old Microsoft was great. The new Microsoft is just plain retarded.
Any tard can slap new eyecandy on a tired old app, especially when you're selling it to even bigger tards.
Windows Calc is quite possibly the most abused utility in my arsenal, even more than Notepad.
-Billco, Fnarg.com
And by a whole lot more you mean 4 times more, right?
You need the protected mode capabilities. Won't even work on a 286 which doesn't have true protected mode.
Yeah, but I bet they do that by relying on shared libraries. The size of the executable doesn't really tell us much these days
It is obvious this Kintli fellow has violated the DMCA
the law by reverse engineering a piece of commercially sold software. Since this was not done for
the purpose of interoperability, the law should be called in!
If the answer is war, you are asking the wrong question
Whats your point? Windows suddenly doesnt have shared libraries? :P
Or is there a reason why the Windows calculator cant use them but the KDE one can?
Of all major operating systems, UNIX is the only one originally meant for gaming.
My point is that executable size is not by itself a useful basis for comparison of the resources used by a program or how easy it was to write. If you compare two stand-alone programs, you can reasonably say that one is more compact than the other, and it will very likely be true that the smaller program required greater skill to write. If you compare a program that makes extensive use of libraries with one that doesn't, you can't make the same comparison. The shorter program was very likely the easier one to write because all the real work is done by the libraries, and there is no way to tell, just by looking at the programs themselves, which uses more memory.
For example, I am told that Internet Explorer is actually a rather modest shell and that much of the work is done by system calls. If this is true, IE is much smaller than say Firefox or Konqueror, but not in a meaningful way. Certainly, this would not be a reasonable basis for claiming that IE is coded more compactly and cleverly than the others.
How has no one mentioned this yet? - Don't blame me too much, I just copied and pasted from: http://downlode.org/Etext/power.html
The Feeling Of Power
by Isaac Asimov
Jehan Shuman was used to dealing with the men in authority on long-embattled earth. He was only a civilian but he originated programming patterns that resulted in self-directing war computers of the highest sort. Generals, consequently listened to him. Heads of congressional committees too.
There was one of each in the special lounge of New Pentagon. General Weider was space-burned and had a small mouth puckered almost into a cipher. He smoked Denebian tobacco with the air of one whose patriotism was so notorious, he could be allowed such liberties.
Shuman, tall, distinguished, and Programmer-first-class, faced them fearlessly.
He said, "This, gentlemen, is Myron Aub."
"The one with the unusual gift that you discovered quite by accident," said Congressman Brant placidly. "Ah." He inspected the little man with the egg-bald head with amiable curiosity.
The little man, in return, twisted the fingers of his hands anxiously. He had never been near such great men before. He was only an aging low-grade technician who had long ago failed all tests designed to smoke out the gifted ones among mankind and had settled into the rut of unskilled labor. There was just this hobby of his that the great Programmer had found out about and was now making such a frightening fuss over.
General Weider said, "I find this atmosphere of mystery childish."
"You won't in a moment," said Shuman. "This is not something we can leak to the firstcomer. Aub!" There was something imperative about his manner of biting off that one-syllable name, but then he was a great Programmer speaking to a mere technician. "Aub! How much is nine times seven?"
Aub hesitated a moment. His pale eyes glimmered with a feeble anxiety.
"Sixty-three," he said.
Congressman Brant lifted his eyebrows. "Is that right?"
"Check it for yourself, Congressman."
The congressman took out his pocket computer, nudged the milled edges twice, looked at its face as it lay there in the palm of his hand, and put it back. He said, "Is this the gift you brought us here to demonstrate. An illusionist?"
"More than that, sir. Aub has memorized a few operations and with them he computes on paper."
"A paper computer?" said the general. He looked pained.
"No, sir," said Shuman patiently. "Not a paper computer. Simply a piece of paper. General, would you be so kind as to suggest a number?"
"Seventeen," said the general.
"And you, Congressman?"
"Twenty-three."
"Good! Aub, multiply those numbers, and please show the gentlemen your manner of doing it."
"Yes, Programmer," said Aub, ducking his head. He fished a small pad out of one shirt pocket and an artist's hairline stylus out of the other. His forehead corrugated as he made painstaking marks on the paper.
General Weider interrupted him sharply. "Let's see that."
Aub passed him the paper, and Weider said, "Well, it looks like the figure seventeen."
Congressman Brant nodded and said, "So it does, but I suppose anyone can copy figures off a computer. I think I could make a passable seventeen myself, even without practice."
"If you will let Aub continue, gentlemen," said Shuman without heat.
Aub continued, his hand trembling a little. Finally he said in a low voice, "The answer is three hundred and ninety-one."
Congressman Brant took out his computer a second time and flicked it. "By Godfrey, so it is. How did he guess?"
"No guess, Congressman," said Shuman. "He computed that result. He did it on this sheet of paper."
"Humbug," said the general impatiently. "A computer is one thing and marks on a paper are another."
"Explain, Aub," said Shuman.
"Yes, Programmer. Well, gentlemen, I write down seventeen, and just undernea
2^3 * 31 * 647
Wow, I didn't know this was so widespread.
It's better to vote for what you want and not get it than to vote for what you don't want and get it.
- E. Debs
I wonder why that acronym never caught on?
Same on Matlab and Octave.
at least python gives the higher precision
How about 256 bytes for a 3D rotating parallax tunnel fly-through !!!
LS
There is a fine line between being a cultivated citizen and being someone else's crop. - A. J. Patrick Liszkie
....and is requesting that you start on the IBM 5100 (the flux capacitor broke).
Never play chicken with a passive aggressive.
There were 85 left over bytes at the end (filled with NOP), so it was really only 939 bytes of ROM.
it doesn't work like todays calculators but like the old adding machines:
Millions of people still use calculators that behave exactly like that. All financial calculators work like that, and for good reason.
Dan East
Better known as 318230.
Easy fix:
$ clisp -q
[1]> (- 10.1d0 10 0.1d0)
-3.608224830031759d-16
[2]> (- 10.1d0 0.1d0 10)
0.0d0
-3.6082248300317588e-16 -3.60822483003176e-16 -3.6082248300318E-16 Err.... What??? They are the same answer, just printed at different points of rounding.
Opps, my self=idiot light just illuminated. 0
The important question is, why is Excel using floating-point for Math? There are plenty of decimal math libraries out there, and I'm sure Microsoft could bang out a pretty good one themselves if they cared enough to do so.
which has this calculator as the core of the calculator accessory, Excel, etc.
Wrong choice of words on my part. I meant like today's "standard" calculators, since that is what the 4004 is like and that is what the site talks about for comparison. Of course financial calculators still do it this way with positive/negative cash flows.
Thousands of people now and in the future would be interested in studying this code. Please dig up and post this work. Perhaps to one of the 'vintage computer' websites.
People are still writing assembler code for tiny microprocessors. However now it is being done for very inexpensive microcontrollers like the Atmel AVR and the Microchip PIC. This ICs have all their major components integrated (like program ROM, limited RAM, UARTs, and ADC) and sell for about $1-$2. This business is moving to C language as the 32-bit, 128Kbyte memory, 50MHz microcontrollers like the ARM fall below the $5 price.
But constructing code out of instruction sets one byte at a time is still done for very low-end devices like the Atmel Tiny11 that sells for about $0.30 each. At this price, they can replace 555 timers and TTL gates in updates of classic 1970's and 1980s electronic designs.
Comment removed based on user account deletion
Commodity CPUs have hardware support for floating point operations but not decimal operations, which means floating point is much faster than decimal.
Chernobyl 'not a wildlife haven' - BBC News
True, but-- we're talking about a spreadsheet. How much number-crunching capability do people need? I suspect that anyone whose computational requirements are sufficient enough to require real numerical horsepower already understands the limitations of floating-point math. Very few normal Excel users do, and I think, for them, a program that meets their expectations-- that is, a program that does arbitrary precision decimal math, accurately-- is more important than speed.
Just did that in Ubuntu 7.04's default GNOME calculator and got the answer "-0". Minus Zero. Cool!
Looks like a lot of software has issues with that equation.
You are not alone. This is not normal. None of this is normal.
Try doing the calculation manually, and don't round your answers; bet you can't beat Python's "precision"!
You are not alone. This is not normal. None of this is normal.