Here is a (relatively) simple CPU for you to play with;

To modify memory, simply click on the bits while the cpu is off. You can scroll through memory as well. To start executing instructions, turn the cpu switch on.

This cpu has three different instructions:
Instruction Code
add the value at the address held at (Instruction Pointer + 1)
to the value at the address held at (Instruction Pointer + 2)
   00000001
subtract the value at the address held at (Instruction Pointer + 2)
from the value at the address held at (Instruction Pointer + 1)
   00000010
move the value at the address held at (Instruction Pointer + 1)
to the value at the address held at (Instruction Pointer + 2)
   00000011

All of the instructions have a size of 3 bytes (operands included).This means that we increment the instruction pointer by 3 after each instruction is executed.

The instruction pointer can be accessed by addressing memory location 00000000.

<left 8/8

source code - donate - contact