Register |
Mnemonic |
Description |
Program Counter |
PC |
The PC is incremented by 1 at the end of each execution step. |
Instruction Register |
IR |
The IR stores the opcode of the instruction currently being executed. |
Accumulator |
AC |
The AC stores values currently being operated upon by the CPU. |
Memory Address Register |
MAR |
The MAR stores the memory address currently in use by the CPU. |
Memory Buffer Register |
MBR |
The MBR stores values being transfered from memory to the CPU and vice versa. |
Input Register |
IN |
When an INPUT instruction is executed, the first character in the input area is copied to IN. |
Output Register |
OUT |
At the end of each execution step, if the value of OUT is nonzero, it is copied to the output area in the form of a Unicode character. The register is then set to 0. |
Status Register |
STA |
STA shows the status of the currently running program. A value of 0 indicates normal operation, while a value of 1 means execution has halted. |
Instruction |
Opcode |
Mnemonic |
Description |
Load |
0x1 |
LOAD X |
Loads the value at address X into the AC. |
Store |
0x2 |
STORE X |
Stores the contents of the AC at address X . |
Add |
0x3 |
ADD X |
Adds the value at address X to the value in the AC. |
Subtract |
0x4 |
SUBT X |
Subtracts the value at address X from the value in the AC. |
Input |
0x5 |
INPUT |
Copies the value from the Input register to the AC. |
Output |
0x6 |
OUTPUT |
Copies the value in the AC to the Output register. |
Halt |
0x7 |
HALT |
Halts execution. |
Skip Conditionally |
0x8 |
SKIPCOND X |
Skips the next instruction based on the values of the AC and the highest two bits of X (the bits immediately after the opcode).
Bits |
Condition |
00 |
AC < 0 |
01 |
AC = 0 |
10 |
AC > 0 |
|
Jump |
0x9 |
JUMP X |
Loads the value of X into the PC. |
Clear |
0xA |
CLEAR |
Sets the AC to 0. |
Add Indirect |
0xB |
ADDI X |
Adds a value to the AC, where X is an address whose value is the address of the value to add. |
Jump Indirect |
0xC |
JUMPI X |
Loads a value into the PC, where X is an address whose value is the address of the value to load. |
Load Indirect |
0xD |
LOADI X |
Loads a value into the AC, where X is an address whose value is the address of the value to load. |
Store Indirect |
0xE |
STOREI X |
Stores the value of the AC in memory, where X is an address whose value is the address at which to store it. |
Jump and Store |
0xF |
JNS X |
Stores the value of the PC at address X and jumps to address X + 1 . |