❑ INC op1
❍ Increase the value of the op1 by 1.
❑ DEC op1
❍ Decrease the value of the op1 by 1.
❑ ADD op1, op2
❍ Add the two operands and store the result in op1.
❑ SUB op1, op2
❍ Subtract op2 from op1 and store the result in op1.
❑ MUL op1
❍ Multiply op2 by EAX. If the result is overflowed, the upper 4 bytes of the result are stored in the EDX register and the lower 4 bytes are stored in EAX.
op1에 EAX를 곱한다. 결과값이 넘친다면 상위 4 Bytes는 EDX 레지스터에에 저장하고 하위 4 Bytes는 EAX에 저장한다.
op1에 EAX를 곱한다. 결과값이 넘친다면 상위 4 Bytes는 EDX 레지스터에에 저장하고 하위 4 Bytes는 EAX에 저장한다.
❑ DIV op1
❍ Divide 8 bytes(EDX: EAX) by op1. The quotient is stored in EAX and the rest in EDX.
8 Bytes(EDX:EAX)를 op1로 나눈다. 몫은 EAX에 저장되고 나머지는 EDX에 저장된다.
8 Bytes(EDX:EAX)를 op1로 나눈다. 몫은 EAX에 저장되고 나머지는 EDX에 저장된다.
❑ SHL/SHR op1, op2
❍ Performs a bit shift operation op2 times to left/right on op1.
op1에 좌측/우측으로 비트 쉬프트 연산을 op2회 수행한다.
op1에 좌측/우측으로 비트 쉬프트 연산을 op2회 수행한다.
❑ ROL/ROR op1, op2
❍ Performs a bit shift operation op2 times to left/right on op1. And the shifted value is rotated not discarding.
op1에 좌측/우측으로 비트 쉬프트 연산을 op2회 수행한다. 그리고 밀려난 값은 순환된다.
op1에 좌측/우측으로 비트 쉬프트 연산을 op2회 수행한다. 그리고 밀려난 값은 순환된다.
❑ LEA op1, op2
❍ Store the address of op2 to the op1.
❑ PUSHAL / POPAL
❍ Push/pop registers
* order : EAX - ECX - EDX - EBX - ESP - EBP - ESI - EDI
❑ CALL op1
❍ Push the return address to the stack and jump to the op1 function
* PUSH eip
JMP [op1]
JMP [op1]
❑ LEAVE
❍ Empty the current stack and assign the base address of the memory that called it to ebp.
* mov esp, ebp
pop ebp
pop ebp
❑ RET
❍ Store the value pointed to by ESP to EIP.
* Usually the return value is stored in EAX.
* POP EIP
❑ NOP
❍ Occupy 1 Byte and occupies empty space and do not anything.
❑ TEST op1, op2
❍ Perform AND operation on op1 and op2.
* This set OF=0, CF=0. And if the result is 0, ZF=1 otherwise ZF=0
* This doesn't save the result value.
❑ DWORD ptr SS:[ebp-4]
❍ DWORD ptr: Setting the size of the "SS:[ebp-4]".
❍ "SS:": Indicating the data of Stack segment.
❑ CMP op1, op2
❍ Subtract the op2 from the op1. This affects CF and ZF.
* This doesn't save the result value.
Result | ZF(Zero Flag) | CF(Carry Flag) |
op1 < op2
|
0
|
1
|
op1 > op2
|
0
|
0
|
op1 = op2
|
1
|
0
|
❑ JCC(Jump Condition Code)
❍ Changes the execution flow to op1 according to the conditions.
Command | Mean | Condition |
JA | Jump if (unsigned) above | (CF == 0) && (ZF == 0) |
JAE | Jump if (unsigned) above or equal | CF == 0 |
JB | Jump if (unsigned) below | CF == 1 |
JBE | Jump if (unsigned) below or equal | (CF == 1) || (ZF = 1) |
JC | Jump if carry flag set | CF == 1 |
JCXZ | Jump if CX is 0 | CX == 0 |
JE | Jump if equal | ZF == 1 |
JECXZ | Jump if ECX is 0 | ECX == 0 |
JG | Jump if (signed) greater | (ZF == 0) && (SF == OF) |
JGE | Jump if (signed) greater or equal | (SF == OF) |
JL | Jump if (signed) less | (SF != OF) |
JLE | Jump if (signed) less or equal | (ZF == 1) && (SF != OF) |
JNA | Jump if (unsigned) not above | (CF == 1) || (ZF = 1) |
JNAE | Jump if (unsigned) not above or equal | CF == 1 |
JNB | Jump if (unsigned) not below | CF == 0 |
JNBE | Jump if (unsigned) not below or equal | (CF == 0) && (ZF == 0) |
JNC | Jump if carry flag not set | CF == 0 |
JNE | Jump if not equal | ZF == 0 |
JNG | Jump if (signed) not greater | (ZF == 1) || (SF != OF) |
JNGE | Jump if (signed) not greater or equal | SF != OF |
JNL | Jump if (signed) not less | SF == OF |
JNLE | Jump if (signed) not less or equal | (ZF == 0) and (SF == OF) |
JNO | Jump if overflow flag not set | OF == 0 |
JNP | Jump if parity flag not set | PF == 0 |
JNS | Jump if sign flag not set | SF == 0 |
JNZ | Jump if not zero | ZF == 0 |
JO | Jump if overflow flag is set | OF == 1 |
JP | Jump if parity flag set | PF == 1 |
JPE | Jump if parity is equal | PF == 1 |
JPO | Jump if parity is odd | PF == 0 |
JS | Jump if sign flag is set | SF == 1 |
JZ | Jump if the result is zero | ZF == 1 |
LOOP: jump to op1 according to the conditions
Command | Mean | Condition |
LOOP op1 | CX = CX - 1 jump to op1 | Jump if CX != 0 |
LOOPNZ op1 LOOPNE op1 | Loop if not zero(equal). CX = CX - 1 jump to op1 | Jump if (CX != 0) && (ZF == 0) |
LOOPZ op1 LOOPE op1 | Loop if not zero(equal). CX = CX - 1 jump to op1 | Jump if (CX != 0) && (ZF == 1) |
※ Reference