Professional Documents
Culture Documents
INSTRUCTION SET
THEORY
Instruction Set:
An Instruction is a binary pattern designed inside a microprocessor to perform a
specific operation. The entire group of instructions that a Microprocessor supports is
called an Instruction Set.This set of instructions written in a sequence is called a
program.
Instruction Set:
There are 6 types of Instructions namely,
1. Data Transfer
2. Arithmetic
3. Logical/Bit Manipulation
4. String
5. Branch
6. Process Control
Mnemonic Purpose
MOV
Moves the source to the
destination
PUSH
Pushes into stack
POP
Pops from the stack
XCHG
Contents of the src and dest will be
exchanged
LEA
It loads the effective address into
the DX
LOS
It loads the OS
Syntax
MOV dest, src
PUSH src
POP src
XCHG dest, src
LEA DX, [BP]
Arithmetic Instructions:
Instruction Name
Add
Add with carry
Increment
ASCII adjust for
addition
Subtraction
Subtract with
borrow
Decrement
Negative
Compare
Mnemonic
ADD
ADC
INC
AAA
AAS
SUB
SBB
DEC
NEG
CMP
MUL
Purpose
It is to add two nos
It adds the content with carry
It is used to increment
ASCII adjust for addition(works
only with AL)
Subtracts two numbers
Subtracts the contents with
borrow
Decrement the given register
Negates the given byte/word
Compare two numbers, affect
CR, ZF and SF
ASCII adjust for
subtraction(works only with AL)
Multiply two numbers(in this,
one operand is always in AX)
Syntax
ADD AX, BX
ADC AX, BX
INC AX
SUB AX, BX
SBB AX, BX
DEC AX
NEG AX
CMP AX, BX
MUL BX
INTRODUCTION TO 8086
Instruction Name
Signed
Multiplication
ASCII adjustment
after
multiplication
Division
INSTRUCTION SET
THEORY
Mnemonic Purpose
Syntax
IMUL
Multiply signed numbers. In this
IMUL BX
one is always present in AL/AX
(accumulator)
AAM
ASCII adjustment after
multiplication (works only with AL)
DIV
Signed Division
IDIV
ASCII adjustment
after division
Convert byte to
word
Convert word to
double word
AAD
CBW
CWD
DIV BX
IDIV BX
Mnemonic Purpose
AND
Perform logical AND of SRC and
DEST. Answer is stored in dest
OR
Performs logical OR of SRC and
DEST. Answer is stored in dest.
XOR
Performs logical XOR of SRC and
DEST. Answer is stored in dest.
Syntax
AND dest, src
Not
NOT
NOT SRC
SHL
shift arithmetic
left.
SAL
SHR
shift arithmetic
right
SAR
rotate left
ROL
rotate right
ROR
RCL
Or
Exor
RCR
OR dest, src
XOR dest, src
SHL Reg,
Count
SHR Reg,
Count
INTRODUCTION TO 8086
INSTRUCTION SET
THEORY
String Instructions:
Instruction Name
Move
Compare
Scan
Load
Store
Mnemonic
MOVSB/MOVSW
CMPSB/CMPSW
SCASB/SCASW
LODSB/LODSW
STOSB/STOSW
Purpose
Move String byte/word
Compare string byte/word
Scan string bye/word
Load string byte/word
Store string byte/word
Branch Instructions:
Instruction Name
Jump
Call
Mnemonic Purpose
JMP
Jump to a address
CALL
Call a program/procedure/subroutine from the
given address
Return
RET
Procedure, which is called, will always end with a
return
Jump if Zero
JE/JZ
Jump if equal/zero (ZF = 1)
Jump if not Zero
JNE/JNZ
Jump is not equal/zero (ZF = 0)
Jump if above zero JNBE/JA
Jump if not below nor equal/ jump above (CF, ZF=0)
Jump if not below JNB/JAE
Jump if not below/ jump if not below nor equal
(CF=0)
Jump if below
JB/JNAE
Jump below/ jump if not above nor equal (CF=0)
Jump if not Above JBE/JNA
Jump if below or equal/ jump if no above (CF, ZF=1)
Jump if carry
JC
Jump if carry (CF=1)
Jump if no carry
JNC
Jump if no carry (CF=0)
Jump if not less
JGE/JNL
Jump if greater or equal/not less (SF=OF=0)
Jump if greater
JG/JNLE
Jump if greater/not less not equal (SF OF)+ ZF=0)
Jump if less
JL/JNGE
Jump if less/not less nor equal (SF, OF=0)
Jump if not
JLE/JNG
Jump if less or equal/not greater ((SF OF)+ ZF=1)
greater
Jump if not
JNO
Jump if not overflow (OF=0)
overflow
Jump if not parity JNP/JPO
Jump if not parity/odd (P=0)
Jump if not sign
JNS
Jump if not sign (SF=0)
Jump if overflow
JO
Jump if overflow (OF=1)
Jump if parity
JP/JPE
Jump if parity/parity even (P=1)
Jump if sign
JS
Jump if sign (SF=1)
Mnemonic
STC
CLC
CMC
STD
CLD
STI
CLI
Purpose
Set carry flag
Clear carry flag
Complement carry flag
Set direction flag
Clear direction flag
Set interrupt flag
Clear interrupt flag