One Instruction Computer


The One Instruction Computer has only one instruction:
subz A,B,C
The effect of this instruction is to replace the contents of memory at location A with the difference of the contents of memory at A and B, and if the result is zero, branch to the instruction at memory location C. (Otherwise the instruction at the next higher memory address is the next instruction.) In a C-like pseudo-code where PC is the ``program counter'' where the address of the current instruction is kept, this performs:
mem[A] = mem[A] - mem[B];
if (mem[A] == 0) {
        PC = C;
} else {
        PC = PC + 1;
}

[ CSE 80 | ACS home | CSE home | CSE calendar | bsy's home page ]
picture of bsy

bsy@cse.ucsd.edu, last updated Wed Oct 16 22:37:34 PDT 1996.

email bsy