4004

From Esolang
Jump to navigation Jump to search

4004 is a simpllified Intel 4004 microprocessor architecture invented by User:A that does not involve ROM manipulation.

Reference

Register groups:

Name	Size ( Bits )
Accumulator(AC or A)	4
Index Register(IR)	8
Program Counter( PC )	12
Stack Pointer( Stack )	12×3

Instruction set:

HEX	Mnemonics	Instruction word	Function
0	NOP	0000	None
1	CLB	0001	AC=0
2	IAC	0010	AC=AC+1
3	CMA	0111	AC=~AC
4	RAL	0100	Cyclic Left shift 1 bit{AC}
5	RAR	0101	Cyclic Right shift 1 bit{AC}
6	DAC	0110	AC=AC-1
7	JIN	0111	Jump to address stored in register R unconditionally.
8	INC	1000	R=R+1
9	ADD	1001	AC=AC+R
A	SUB	1010	AC=AC-R
B	LD	1011	AC=R
C	XCH	1100	Swap AC and R
D	JMS	1101	Jump to address stored in register R unconditionally, and preserve the original address into the stack SP.
E	ISZ	1110	Increment register R by 1, if the result is nonzero, jump to address A in ROM.
F	BBL	1111	Return via the stack address,AC=R