CPU Opcodes for Intel i8008

In case you ever need them.

OpcodeOperand 1Operand 2MnemonicDesc
0000000X--HLTHalts the processor.
00DDD000--INrDDD = DDD + 1, except for A (as the CPU treats that as a HLT) and memory access.
00DDD001--DCrDDD = DDD - 1, except for A (as the CPU treats that as a HLT) and memory access.
00000010--RLCA = A >> 1, most significant bit overwrites the Carry flag, Carry flag overwrites the least significant bit
00CCC011--Rcc (Conditional RET)Overwrites PC with whatever is at the top of the call stack. Used to return from subroutines. Only executes if the specified condition is true.
00FFF100data-ADI, ACI, SUI, SBI, NDI, XRI, ORI, CPI dataPerforms the specified the ALU operation with an immediate operand.
00NNN101--RSTPushes the PC onto the call stack, then sets the PC value to NNN * 8. Used when handling interrupts.
00DDD110data-LrI dataLoads register DDD with a immediate value.
00XXX111--RETOverwrites PC with whatever is at the top of the call stack. Used to return from subroutines.
00001010--RRCSimilar to RLC, but shifts the other way. The least significant bit overwrites the Carry flag, and the Carry flag overwrites the most significant bit.
00010010--RALLike RLC, but the most significant bit overwrites the least significant bit, as well as the Carry flag.
00011010--RARLike RAL, but the other way around.
01CCC000addladdhJcc addr (Conditional Jump)Sets PC's value to the address formed by addl and addh.
0100PPP1--INP portA gets the value from the specified input port.
01PPPPP1--OUT portThe specified output port gets A's value.
01CCC010addladdhCcc addrSimilar to jump, but pushes the PC's value to the call stack first.
01XXX100addladdhJMP addrJumps unconditionally to the specified address.
01XXX110addladdhCAL addrCalls the specified subroutine unconditionally.
10FFFSSS--ADr, ACr, SUr, SBr, NDr, XRr, ORr, CPrPerforms the specified ALU operation with the register.
11DDDSSS--LdsDDD = SSS.
11111111--HLTSame as the first one.

3-bit values in instructions:

SSS/DDDidCCCFFF
A register000FC (Carry flag === false)ADI ADr (A = A + arg)
B register001FZ (Zero flag === false)ACI ACr (A = A + arg + Carry flag)
C register010FS (Sign flag === false)SUI SUr (A = A - arg)
D register011FP (Parity flag === false)SBI SBr (A = A - arg - Carry flag)
E register100TC (Carry flag === true)NDI NDr (A = A AND arg)
H register101TZ (Zero flag === true)XRI XRr (A = A XOR arg)
L register110TS (Sign flag === true)ORI ORr (A = A OR arg)
Memory Access111TP (Parity flag === true)CPI CPr (A - arg, return flags, but not value)

The i8008 has 7 general-purpose registers, with A being the accumulator, ALU instructions always use A as an operand and return the result in A. H and L are used in indirect addressing, where H and L are fused into a single 16-bit register (the two most significant bits are left out, as the 8008 had a 14-bit address bus), for memory access. The flags register has this format:

0000CPZS
. The Program Counter (PC) is used to access instructions, and there is a 7-level address call stack, with 14-bit address bus per call stack level.