Command |
Syntax |
Description |
MOV |
MOV reg, imm |
Push word onto stack, pop word off stack |
MOV |
MOV reg, reg |
Copies the value of the second register into the first register |
MOV |
MOV reg, reg |
Copies the value of the second register into the first register. Register must be the same size. |
ADD |
ADD reg, imm |
Adds the values of the immediate value to the register given |
ADD |
ADD reg, reg |
Adds the value of the second regiseter to the value of the first register |
SUB |
SUB reg, imm |
Subtracts the values of the immediate value to the register given |
SUB |
SUB reg, reg |
Subtracts the value of the second regiseter to the value of the first register |
MUL |
MUL reg |
Multiplies the value in the given register with the value of set register and is stored in a specific register. |
8-bit register are multiplied by AL and is stored in AX. |
16 bit register are multiplied with AX and stored in DX:AX. |
32 bit register are multiplied by EAX and stored in EDX:EAX. Immediate values can not be used. | -->
IN |
SUB reg, [DX] |
Takes input from the user and sets the register to the value |
OUT |
OUT [DX], reg |
Returns the value of the register |
JMP |
JUMP label |
Loops back to point of the label |
Example |
XYZ: MOV reg, reg |
JZ |
JZ label |
Works like the JMP command but only activates if the zero flag is set |
JS |
JS label |
Works like the JMP command but only activates if the sign flag is set |
JNZ |
JNZ label |
Works like the JMP command but only activates if the zero flag is not set |
JNS |
JNS label |
Works like the JMP command but only activates if the sign flag is not set |
INC |
INC register |
Increases the register by 1 |
DEC |
DEC register |
Decreases the register by 1 |
CMP |
CMP reg, reg |
Compares the two register and deterimens if the first is greater or larger than the second |
JL |
JL label |
Works like the JMP command but only activates if less than |
JLE |
JLE label |
Works like the JMP command but only activates if less than or equal to |
JG |
JG label |
Works like the JMP command but only activates if greater than |
JGE |
JGE label |
Works like the JMP command but only activates if greater than or equal too |
JE |
JE label |
Works like the JMP command but only activates if equal |
JNE |
JNE label |
Works like the JMP command but only activates if not equal to |
JNL |
JNL label |
Works like the JMP command but only activates if not less than |
JNLE |
JNLE label |
Works like the JMP command but only activates if not less than or equal to |
JNG |
JNG label |
Works like the JMP command but only activates if not greater than |
JNGE |
JNGE label |
Works like the JMP command but only activates if not greaeter than or equal |