
Intel 4004 programming manual (1973) [pdf] - noncoml
http://bitsavers.trailing-edge.com/pdf/intel/MCS4/MCS-4_Assembly_Language_Programming_Manual_Dec73.pdf
======
anyfoo
Thanks, this clears up some of the strange wonderment with the Intel 4004. For
example, I never knew what the "status characters" in the data RAM chips were
for. This manual suggests to use them to store sign and exponent, or program
RAM addresses. They seem to be general purpose, though.

Note that there is separate "program RAM" and "data RAM", the latter having a
more complicated structure with the aforementioned status characters. It's
surprisingly complicated to address any RAM on the 4004, with both types of
RAM having separate quirks for doing so.

There are also plenty of other oddities, like I/O ports on both RAM and ROM
chips, dedicated instructions for e.g. "keyboard processing" but no AND or OR
instruction (with horrifyingly long examples on how to implement them in this
document), and some instruction names for seemingly straightforward things
that are completely unintuitive.

It's well worth exploring.

~~~
userbinator
The 4004 is often described as the world's first microprocessor, but it has
more in common with contemporary microcontrollers --- programmable, yet not
really general-purpose. The Von Neumann architecture and specialised
instructions are examples of this.

~~~
wfraser
You mean Harvard architecture?

------
userbinator
A 4 bit datapath may seem very limiting, but note that 4-bit microcontrollers
are still produced in massive quantities today, used in devices which you may
not even be aware of as having a microcontroller:
[https://en.wikichip.org/wiki/4-bit_architecture](https://en.wikichip.org/wiki/4-bit_architecture)

~~~
tomcam
I had know idea they were still popular! Thanks

~~~
tomcam
It is a special kind of online community that downvotes someone for liking the
idea of four-bit integrated circuits. I will try to regain my lost karma by
upvoting a chip at the 32- or 64-bit level.

------
zwieback
I like all the tables at the end, the manual for one of the first calculator
ICs of course predates handheld calculators that convert between hex and
decimal.

------
noncoml
We've come a long way, but it is really cool how easy is to tell that it is
the x86-64's ancestor.

~~~
drallison
Noncoml, did you really read the manual? The 4004 is unrelated to the x86-64.

Perhaps you are confusing it with the 8008 which is related to the 8080 which
is related to the 8086 which is related to the 80286, 80386, 80486, and so
forth.

~~~
noncoml
Hmm, I don't know. Especially the way the segregate RAM into banks reminds me
a lot of the x86 segments with their direct and indirect addressing modes.

Also a lot of instructions have similar names: CLC

You are right, it is not a true ancestor, but ready through the manual, it did
seem to me that it was designed by the same people.

To be honest I haven't dig into other CPU families, so maybe these were pretty
common.

But I can definitely see 4004 DNA in x86.

~~~
kens
The CLC - clear carry - instruction predates the 4004. The PDP-11 for instance
used it. I think you're seeing patterns that aren't really there.

One thing the 4004 and 8008 _do_ have in common is a similar floor plan for
the chips. They both have the ALU on the left, data bus along the top,
instruction decoding in the middle, registers on the right, and on-chip stack
on the right. Other processors of that era (e.g. 6800, 6502, 8080) have very
different layouts so it's not just coincidence. Texas Instruments produced the
TMC 1795, a chip equivalent to the 8008 (before the 8008), and it also has a
completely different layout.

If you look lower-level, at e.g. the ALU implementation or the register
implementation or the pin drivers, there's less similarity. I would have
expected they would essentially cut-and-paste some of these low-level pieces,
but they are more different than I would expect.

