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 Jumps to the specified line. JMP 0 - Jumps to the first instruction.
JZ line Conditional jump. Jumps 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. Jumps 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. Jumps 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. Jumps 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. Jumps 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. Jumps to the specified line, only if the result of last instruction was not less than 0 ( >= ). JNL 0 - Jumps to the first instruction.
INT 10 Asks the user for integer input and stores the result in R0. INT 10 - Ask for user input.
INT 20 Displays a dialog with the content of R0. INT 20 - Display the content of R0.
INT 50 Generates a random number between 0 and the content of R0 (exclusive) and stores the result back in R0. If R0 is less than 0 generates a number between 0 and 255 (inclusive). INT 50 - Generates a random number in R0.

Addresses

Format Description Example
#value Describes a memory address. Accepted values are 0 - 39. #1 - Address of the second byte in memory.
Rvalue Describes a processor register. Accepted values are 0 - 3. R2 - Third processor register.
@Rvalue Describes a 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 memory.