Registers
R0 R1 R2 R3
0 0 0 0
Memory
  0 1 2 3 4 5 6 7 8 9
00 0 0 0 0 0 0 0 0 0 0
10 0 0 0 0 0 0 0 0 0 0
20 0 0 0 0 0 0 0 0 0 0
30 0 0 0 0 0 0 0 0 0 0

Instructions

Instruction Description Example
MOV destination,source Copies the constant or the value from the address pointed by source to the address pointed by destination, destination cannot be a constant. MOV #5,23 - Copies 23 to the memory cell with address 5.
MOV R1,#15 - Copies value from memory cell with address 15 to register R1.
ADD destination,source Adds destination and source and stores the result in register or address pointed by destination, because of that destination cannot be a constant. ADD R0,5 - Adds the content of register R0 and constant 5 and stores the result in register R0.
SUB destination,source Subtracts source from destination and stores the result in register or address pointed by destination, because of that destination cannot be a constant. SUB R0,5 - Subtracts 5 from the content of register R0 and stores the result in register R0.
MUL destination,source Multiplies destination and source and stores the result in register or address pointed by destination, because of that destination cannot be a constant. MUL R0,5 - Multiplies the content of register R0 and constant 5 and stores the result in register R0.
DIV destination,source Divides destination by source and stores the result in register or address pointed by destination, because of that destination cannot be a constant. DIV R0,5 - Divides the content of register R0 by constant 5 and stores the result in register R0.
JMP line Causes jump to the specified line JMP 0 - Jumps to the first instruction.
JZ line Conditional jump. Causes jump to the specified line, only if the result of last instruction was equal to 0. JZ 0 - Jumps to the first instruction.
JNZ line Conditional jump. Causes jump to the specified line, only if the result of last instruction was not equal to 0. JNZ 0 - Jumps to the first instruction.
JG line Conditional jump. Causes jump to the specified line, only if the result of last instruction was greater than 0 ( > ). JG 0 - Jumps to the first instruction.
JNG line Conditional jump. Causes jump to the specified line, only if the result of last instruction was not greater than 0 ( <= ). JNG 0 - Jumps to the first instruction.
JL line Conditional jump. Causes jump to the specified line, only if the result of last instruction was less than 0 ( < ). JL 0 - Jumps to the first instruction.
JNL line Conditional jump. Causes jump to the specified line, only if the result of last instruction was not less than 0 ( >= ). JNL 0 - Jumps to the first instruction.

Addresses

Format Description Example
#value Describes memory address. Accepted values are 0 - 39. #1 - Address of the second byte in the memory.
Rvalue Describes processor register. Accepted values are 0 - 3. R2 - Third processor register.
@Rvalue Describes memory address, which is stored in the given processor register. Accepted values are 0 - 3. @R2 - Assuming that R2 contains 1, it will be the address of the second byte in the memory.