Program Execute

The PC (Program Counter) points at the next instruction to be executed, which may, depending on its opcode: load a value directly into the high bits of a register, load a value directly into the low bits of a register, load a value from an address offseted to the SP (Segment Pointer), store a value from a register to an address offseted to the SP (Segment Pointer), or perform an arithmetic operation on one or more registers potentially storing the result in another register.

Register Value
PC0000 0000 0000 0000 0000 0000 0000 0000
SP0000 0000 0000 0000 0000 0000 0000 0000
FP0000 0000 0000 0000 0000 0000 0000 0000
R10000 0000 0000 0000 0000 0000 0000 0000
R20011 0101 0111 1100 1110 0010 0110 0110
R30000 0000 0000 0000 0000 0000 0000 0000
R40000 0000 0000 0000 0000 0000 0000 0000
R50000 0000 0000 0000 0000 0000 0000 0000
PC
Program Counter
SP
Segment Pointer
FP
Frame Pointer
[0000 0000 0000 0000 0000 0000 0000 0000]
[Opcode... Reg  Reg  Reg  Spr  Spr  Spr ]
[Opcode... Reg  Address offset to SP    ]
[Opcode... Reg  Value                   ]


0001 Add $r1  $r2  $r3 Spare
0011 Sub $r1  $r2  $r3 Spare
0010 Div $r1  $r2  $r3 Spare
0011 Mul $r1  $r2  $r3 Spare
     8   4    4    4   12

1001 LoadDH $r? $value
1010 LoadDL $r? $value
1011 Load   $r? $addr (address added to SP)
1100 Store  $r? $addr (address added to SP)
1101 Jmp    $r?       (set PC = register)
     8      4   20

Address Value stored at address
32 bit address 32 bit value
0x0000 00000000 1001 1010 0000 0000 0000 0000 0000
0x0000 00040000 1010 1010 0000 0000 0000 0000 0000
0x0000 00080000 1001 0010 0000 0000 0000 0001 0000
0x0000 00120000 1101 0001 0000 0000 0000 0000 0000
0x0000 00160011 0101 0111 1100 1110 0010 0110 0110
0x0000 00000000 0000 0000 0000 0000 0000 0000 0000
0x0000 00000000 0000 0000 0000 0000 0000 0000 0000
0x0000 00000000 0000 0000 0000 0000 0000 0000 0000
0x0000 00000000 0000 0000 0000 0000 0000 0000 0000
0x0000 00000000 0000 0000 0000 0000 0000 0000 0000
0x0000 00000000 0000 0000 0000 0000 0000 0000 0000
0x0000 00000000 0000 0000 0000 0000 0000 0000 0000
0x0000 00000000 0000 0000 0000 0000 0000 0000 0000
0x0000 00000000 0000 0000 0000 0000 0000 0000 0000
0x0000 00000000 0000 0000 0000 0000 0000 0000 0000
0x0000 00000000 0000 0000 0000 0000 0000 0000 0000
...
0xFFFF FFFF

References