I/O I/O I/O I/O Vdd CM TEST RESET
-- -- -- -- -- -- -- --
| | | | | | | | | | | | | | | |
--- -- -- -- -- -- -- -- ---
| 16 15 14 13 12 11 10 9 |
| |
| ## ### ### ## |
| ### ## ## ## ## ### |
-- # ## ## ## ## ## # ## |
| # ## ## ## ## ## # ## |
| # ## ## ## ## ## # ## |
-- ####### ## ## ## ## ####### |
| ## ## ## ## ## ## |
| ## ### ### ## |
| |
| 1 2 3 4 5 6 7 8 |
--- -- -- -- -- -- -- -- ---
| | | | | | | | | | | | | | | |
-- -- -- -- -- -- -- --
D0 D1 D2 D3 Vss Ph1 Ph2 SYNC
Development in progress. (Check dev branch)
Simple emulator of the Intel 4004 chip.
The Intel 4004 was the first computer that I made an emulator, unfortunately I lost the code. Since then I have been studying and assembling small emulators and studying the architecture of computers and embedded devices. After a long time I am going back to the emulators, and the first one that I will focus on development is the Intel 4004, because it is a simple device with a few instructions (46 instructions).
This program has an emulator, assembly and disassembler integrated for the Intel 4004. Its objective is to be faithful, as far as possible, to the original hardware, following the specifications of the documents of its time.
Intel 4004 is a 4-bit CPU released by Intel in 1971, which was the first commercial programmable microprocessor.
If you don't know anything about intel 4004, your wikipedia page is a good place to start.
Brief history of the Intel 4004. Intel's First Microprocessor
Recommended online emulator: Emulator - Assembler - Disassembler
This emulator does not strictly follow the specifications of the original 4004, having some facilities and conveniences not present in the documentation.
MCS-4 Assembly Language Programming Manual - December 1973*
After download the executable for your system, open a terminal (or promt) and execute it. You have some modes:
You can use --help
to see the options in more detail.
Execute a 4004 program instruction by instruction, view the registers and memory on a CLI ASCII view.
Compile a program to Intel 4004 binary.
Decompile a binary file to a text file with the assembley instruction.
You have two options to compile.
Inside the root dir of the project.
mkdir build && cd build
cmake ..
make
That create the executable 4004_emulator
.
Not fully suported by now
Inside the root dir of the project to compile for you machine.
zig build
Need to be Zig 0.13.0
The zig build system and C compiler is used to gennerate the release executables.