Assembly Instruction Set Categories and Functions
🧾 Data Transfer Instructions
These instructions are used to move data between registers, memory, and I/O ports.
Instruction | Use |
---|---|
MOV | Transfer data between registers or memory locations |
PUSH / POP | Perform stack operations (store/retrieve data) |
XCHG | Exchange contents of two operands |
IN / OUT | Input from or output to a port |
LEA | Load Effective Address |
LDS / LES | Load Pointer and Segment Register |
XLAT | Translate byte using a lookup table |
➕ Arithmetic Instructions
These instructions perform basic mathematical operations.
Instruction | Use |
---|---|
ADD / SUB | Addition / Subtraction |
ADC / SBB | Add/Subtract with Carry/Borrow |
INC / DEC | Increment / Decrement a value |
MUL / IMUL | Unsigned / Signed Multiplication |
DIV / IDIV | Unsigned / Signed Division |
NEG | Two's Complement (Negation) |
CMP | Compare operands (sets flags) |
DAA / DAS | Decimal Adjust After Addition/Subtraction |
AAA / AAS | ASCII Adjust After Addition/Subtraction |
🔣 Logical & Bitwise Instructions
These instructions perform logical and bit-level operations on data.
Instruction | Use |
---|---|
AND , OR , XOR , NOT | Perform Bitwise Logic Operations |
TEST | Logical AND (sets flags, no result stored) |
SHL / SAL | Shift Left (Logical/Arithmetic) |
SHR / SAR | Shift Right (Logical/Arithmetic) |
ROL / ROR | Rotate Left/Right |
RCL / RCR | Rotate Through Carry Flag |
🔁 Control Transfer Instructions
These instructions alter the flow of program execution.
Instruction | Use |
---|---|
JMP | Perform an Unconditional Jump |
CALL / RET | Procedure Call and Return |
INT / IRET | Software Interrupt and Return |
JC , JNC , JZ , JNZ , etc. | Conditional Jumps Based on Flags |
🔄 Loop & Iteration Instructions
These instructions facilitate repetitive execution of code blocks.
Instruction | Use |
---|---|
LOOP | Loop using the CX register |
LOOPZ / LOOPE | Loop while Zero Flag is Set |
LOOPNZ / LOOPNE | Loop while Zero Flag is Clear |
JCXZ | Jump if CX Register is Zero |
🧵 String Instructions
These instructions are designed for efficient manipulation of strings (sequences of bytes or words).
Instruction | Use |
---|---|
MOVSB / MOVSW | Move Byte/Word from Source to Destination |
LODSB / LODSW | Load Byte/Word into AL /AX Registers |
STOSB / STOSW | Store Byte/Word from AL /AX Registers |
SCASB / SCASW | Scan String for a Specific Value |
CMPSB / CMPSW | Compare Two Strings |
These instructions are often used with REP
, REPE
, or REPNE
prefixes for repetition.
🧩 Flag Manipulation Instructions
These instructions allow direct control over the processor's flag register.
Instruction | Use |
---|---|
CLC , STC , CMC | Clear, Set, or Complement Carry Flag |
CLD , STD | Clear or Set Direction Flag |
CLI , STI | Clear or Set Interrupt Flag |
LAHF , SAHF | Load/Store Flags to/from AH Register |
PUSHF , POPF | Push/Pop Flags to/from Stack |
🛠️ Machine Control Instructions
These instructions manage the processor's state and operations.
Instruction | Use |
---|---|
NOP | Perform No Operation |
HLT | Halt the Processor |
WAIT | Wait for a Hardware Signal |
LOCK | Lock Bus for Atomic Operations |
ESC | Escape to Coprocessor |