Microprocessor - 8086 Instruction Sets
Microprocessor - 8086 Instruction Sets
Microprocessor - 8086 Instruction Sets
String Instructions
Interrupt Instructions
MOV − Used to copy the byte or word from the provided source to the provided
destination.
PPUSH − Used to put a word at the top of the stack.
POP − Used to get a word from the top of the stack to the provided location.
OUT − Used to send out a byte or word from the accumulator to the provided port.
LEA − Used to load the address of operand into the provided register.
LDS − Used to load DS register and other provided register from the memory
LES − Used to load ES register and other provided register from the memory.
LAHF − Used to load AH with the low byte of the flag register.
PUSHF − Used to copy the flag register at the top of the stack.
POPF − Used to copy a word at the top of the stack to the flag register.
Arithmetic Instructions
These instructions are used to perform arithmetic operations like addition, subtraction,
multiplication, division, etc.
NPG − Used to negate each bit of the provided byte/word and add 1/2’s complement.
DIV − Used to divide the unsigned word by byte or unsigned double word by word.
IDIV − Used to divide the signed word by byte or signed double word by word.
CBW − Used to fill the upper byte of the word with the copies of sign bit of the lower byte.
CWD − Used to fill the upper word of the double word with the sign bit of the lower word.
Bit Manipulation Instructions
These instructions are used to perform operations where data bits are involved, i.e. operations
like logical, shift, etc.
AND − Used for adding each bit in a byte/word with the corresponding bit in another
byte/word.
OR − Used to multiply each bit in a byte/word with the corresponding bit in another
byte/word.
XOR − Used to perform Exclusive-OR operation over each bit in a byte/word with the
corresponding bit in another byte/word.
TEST − Used to add operands to update flags, without affecting operands.
SHL/SAL − Used to shift bits of a byte/word towards left and put zero(S) in LSBs.
SHR − Used to shift bits of a byte/word towards the right and put zero(S) in MSBs.
SAR − Used to shift bits of a byte/word towards the right and copy the old MSB into the
new MSB.
ROL − Used to rotate bits of byte/word towards the left, i.e. MSB to LSB and to Carry Flag
[CF].
ROR − Used to rotate bits of byte/word towards the right, i.e. LSB to MSB and to Carry
Flag [CF].
RCR − Used to rotate bits of byte/word towards the right, i.e. LSB to CF and CF to MSB.
RCL − Used to rotate bits of byte/word towards the left, i.e. MSB to CF and CF to LSB.
String Instructions
String is a group of bytes/words and their memory is always allocated in a sequential order.
INS/INSB/INSW − Used as an input string/byte/word from the I/O port to the provided
memory location.
OUTS/OUTSB/OUTSW − Used as an output string/byte/word from the provided memory
location to the I/O port.
SCAS/SCASB/SCASW − Used to scan a string and compare its byte with a byte in AL or
string word with a word in AX.
LODS/LODSB/LODSW − Used to store the string byte into AL or string word into AX.
Program Execution Transfer Instructions (Branch and Loop
Instructions)
These instructions are used to transfer/branch the instructions during an execution. It includes
the following instructions −
CALL − Used to call a procedure and save their return address to the stack.
JMP − Used to jump to the provided address to proceed to the next instruction.
JLE/JNG − Used to jump if less than/equal/if not greater than instruction satisfies.
STI − Used to set the interrupt enable flag to 1, i.e., enable INTR input.
CLI − Used to clear the interrupt enable flag to 0, i.e., disable INTR input.
LOOP − Used to loop a group of instructions until the condition satisfies, i.e., CX = 0
Interrupt Instructions
These instructions are used to call the interrupt during program execution.
INT − Used to interrupt the program during execution and calling service specified.
INTO − Used to interrupt the program during execution if OF = 1