Sei sulla pagina 1di 11

Instruction Set

ASSEMBLY LANGUAGE PROGRAMMING


DATA TRANSFER
Opcode Function
MOV Moves byte or word
PUSH Pushes word onto stack
PUSHF Pushes flag onto stack
LAHF Moves flags into AH
SHAF Loads flags from AH
POP Pops word from stack
POPF Pops flags from stack
IN Inputs data to accumulator from I/O devices
OUT Outputs data from accumulator to I/O
devices
DATA TRANSFER (CONT.)
Opcode Function
XCHG Exchange bytes or words
XLAT Translate table lookup instruction
LEA Load effective address
LDS Loads DS and the operand with a 32-bit
address
LES Loads ES and the operand with a 32-bit
address
ARITHMETIC
Opcode Function
ADD Adds bytes or words
ADC Adds bytes or words plus carry flag
AAA Adjust ASCII after addition
DAA Adjust BCD after addition
INC Adds 1 to byte or word
SUB Subtracts bytes or words
SBB Subtract bytes or words minus carry flag
NEG Changes sign of byte or word (two’s
complement)
CMP Compares bytes or words
AAS Adjusts ASCII after subtraction
ARITHMETIC (CONT.)
Opcode Function
DAS Adjust BCD after subtraction
DEC Subtracts 1 from byte or word
MUL Multiples unsigned byte or word
IMUL Multiples signed byte or word
AAM Adjust ASCII after multiplication
DIV Divides unsigned byte or word
IDIV Divides signed byte or word
CBW Converts byte to word
CWD Converts word to double word
AAD Adjust ASCII before division
BIT MANIPULATION
Opcode Function
AND ANDs bytes or word
OR ORs bytes or word
XOR Exclusive-ORs bytes or words
NOT Inverts bytes or words
TEST Test bytes or words (AND)
SHL/SAL Shifts logical/arithmetic left
SHR Shifts logical right
SAR Shift arithmetic right
ROL Rotates byte or word left
RCL Rotates byte or word left through carry
ROR Rotates byte or word right
RCR Rotates byte or word right through carry
STRING INSTRUCTIONS
Opcode Function
MOVS Moves bytes or words
CMPS Compares bytes or words
SCAS Scans for byte or word
LODS Loads AL or AX with byte or word
STOS Stores AL or AX in byte or word
PROGRAM TRANSFER
Opcode Function
CALL Calls subroutine
RET Returns from subroutine
JMP Jumps to another part of program
INT 3 Type 3 interrupt
INTO Interrupts on overflow
IRET Interrupt return
JA/JNBE Jumps above/jumps not below or equal to
JAE/JNB Jumps above or equal to/jumps not below
JB/JNAE Jumps below/jumps not above or equal to
JBE/JNA Jumps below or equal to/jumps not above
JC Jumps carry set
PROGRAM TRANSFER (CONT.)
Opcode Function
JE/JZ Jumps equal/jumps zero
JG/JNLE Jumps greater/jumps not less than or equal to
JGE/JNL Jumps greater than or equal to/jumps not less
than
JL/JNGE Jumps less than/jumps not greater than or
equal to
JLE/JNG Jumps less than or equal to/jumps not greater
than
JNC Jumps no carry
JNE/JNZ Jumps not equal to/jumps not zero
JNO Jumps no overflow
PROGRAM TRANSFER (CONT.)
Opcode Function
JNP/JPO Jumps no parity/jumps parity odd
JNS Jumps no sign (positive)
JO Jumps on overflow
JP/JPE Jumps parity/jumps parity odd
JS Jump sign (negative)
LOOP Loops CX times
LOOPE/LOOPZ Loops while equal to/loops while zero
LOOPNE/LOOPNZ Loops while not equal to/loop while not
zero
JCXZ Jumps if CX = 0
PROCESSOR CONTROL
Opcode Function
STC Sets carry
CLC Clears carry
CMC Complements carry
STD Selects auto-decrement mode
CLD Selects auto-increment mode
STI Enables interrupts
CLI Disable interrupts
HLT Halts until a reset or an interrupt
WAIT Waits for TEST pin = 0
ESC Provides escape to coprocessor
LOCK Locks the bus during the next instruction
NOP Performs no operation

Potrebbero piacerti anche