/4004-assembler

intel 4004 assembler in javascript (for learning)

Primary LanguageJavaScript

js-4004-assembler

js-4004-assembler is an assembler for Intel 4004 microprocessor, written in javascript. Despite being the first 4-bit microprocessor from Intel, the 4004 has a surprisingly complex opcodes. However, the opcode table is simple enough. Also, it is important to mention that this assembler only accepts numbers for registers and conditions, instead of names or symbols. It is a very crude assembler.

demo


The source file test.asm with 4004 instructions.


Run assembler as node main <destination> <source>.
Here it is node main test.bin test.asm.


test.asm is converted into test.bin.


test.bin contains machine code for 4004.