There are many different types of microprocessor; there are complex ones, e.g. CISC – like x86, and there are reasonably simple ones e.g. RISC – ARM, and simpler variants like DLX. At the bottom of this pile are VERY simple ones; like subleq.
Subleq is a single processor instruction set; everything is then built on top of this. You can summarise how this instruction works as follows:
mem[inst.dst] = mem[inst.dst] – mem[inst.src]
if mem[inst.dst] <= 0:
ip = inst.jmp
ip = ip + sizeof(inst)
This particular implementation also supports dereferencing of memory. Basically, if inst.src or inst.dst is negative the respective term becomes:
The main differences between my implementation and everyone else is that:
Here are a few links to other information that I found interesting/useful.