Assembly Instruction Set Categories and Functions

Posted by Anonymous and classified in Computers

Written on in English with a size of 5.73 KB

🧾 Data Transfer Instructions

These instructions are used to move data between registers, memory, and I/O ports.

InstructionUse
MOVTransfer data between registers or memory locations
PUSH / POPPerform stack operations (store/retrieve data)
XCHGExchange contents of two operands
IN / OUTInput from or output to a port
LEALoad Effective Address
LDS / LESLoad Pointer and Segment Register
XLATTranslate byte using a lookup table

➕ Arithmetic Instructions

These instructions perform basic mathematical operations.

InstructionUse
ADD / SUBAddition / Subtraction
ADC / SBBAdd/Subtract with Carry/Borrow
INC / DECIncrement / Decrement a value
MUL / IMULUnsigned / Signed Multiplication
DIV / IDIVUnsigned / Signed Division
NEGTwo's Complement (Negation)
CMPCompare operands (sets flags)
DAA / DASDecimal Adjust After Addition/Subtraction
AAA / AASASCII Adjust After Addition/Subtraction

🔣 Logical & Bitwise Instructions

These instructions perform logical and bit-level operations on data.

InstructionUse
AND, OR, XOR, NOTPerform Bitwise Logic Operations
TESTLogical AND (sets flags, no result stored)
SHL / SALShift Left (Logical/Arithmetic)
SHR / SARShift Right (Logical/Arithmetic)
ROL / RORRotate Left/Right
RCL / RCRRotate Through Carry Flag

🔁 Control Transfer Instructions

These instructions alter the flow of program execution.

InstructionUse
JMPPerform an Unconditional Jump
CALL / RETProcedure Call and Return
INT / IRETSoftware Interrupt and Return
JC, JNC, JZ, JNZ, etc.Conditional Jumps Based on Flags

🔄 Loop & Iteration Instructions

These instructions facilitate repetitive execution of code blocks.

InstructionUse
LOOPLoop using the CX register
LOOPZ / LOOPELoop while Zero Flag is Set
LOOPNZ / LOOPNELoop while Zero Flag is Clear
JCXZJump if CX Register is Zero

🧵 String Instructions

These instructions are designed for efficient manipulation of strings (sequences of bytes or words).

InstructionUse
MOVSB / MOVSWMove Byte/Word from Source to Destination
LODSB / LODSWLoad Byte/Word into AL/AX Registers
STOSB / STOSWStore Byte/Word from AL/AX Registers
SCASB / SCASWScan String for a Specific Value
CMPSB / CMPSWCompare 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.

InstructionUse
CLC, STC, CMCClear, Set, or Complement Carry Flag
CLD, STDClear or Set Direction Flag
CLI, STIClear or Set Interrupt Flag
LAHF, SAHFLoad/Store Flags to/from AH Register
PUSHF, POPFPush/Pop Flags to/from Stack

🛠️ Machine Control Instructions

These instructions manage the processor's state and operations.

InstructionUse
NOPPerform No Operation
HLTHalt the Processor
WAITWait for a Hardware Signal
LOCKLock Bus for Atomic Operations
ESCEscape to Coprocessor

Related entries: