NEHRU INSTITUTE OF ENGINEERING AND TECHNOLOGY
“Nehru Gardens” T. M. PALAYAM, COIMBATORE-105
(Approved by AICTE and Affiliated to Anna University, Chennai)
(Accredited by NAAC, Recognized by UGC with 2(f) and 12(B))
NBA Accredited UG Courses: AERO, CSE, MECH DEPARTMENT
OF COMPUTER SCIENCE AND ENGINEERING
EC8691 – MICROPROCESSORS AND
MICRO CONTROLLERS
Prepared by
G.Jeevanantham, AP/CSE,
NIET.
UNIT I THE 8086
MICROPROCESSOR
Introduction to 8086 – Microprocessor
architecture – Addressing modes - Instruction
set and assembler directives –
Assembly language programming –
Modular Programming - Linking and
Relocation - Stacks - Procedures – Macros –
Interrupts and interrupt service routines –
Byte and String Manipulation.
INSTRUCTION SET
OF 8086 MICRPOROCESSOR
• The INSTRUCTION set are
categorized into the following
types:
• Data transfer INSTRUCTIONS
• Arithmetic INSTRUCTIONS
• Logical INSTRUCTIONS
• Jump INSTRUCTIONS
• Shift and Rotate
DATA TRANSFER INSTRUCTIONS
• The data transfer instructions are used to
move data between internal registers or
between internal register and the memory.
i)MOV instruction
– MOV instruction is used to transfer data from
source operand to a destination operand
– Examples: MOV CX,DX MOV AX,3025H
DATA TRANSFER INSTRUCTIONS
ii) XCHG instruction
Example:
XCHG BX,AX
III) LEA instruction
Example:
LEA BX,[BETA]
IV) LDS instruction
Example:
LDS SI,[20]
V) LES instruction
Example:
LES DX,[BX]
ARITHMETIC INSTRUCTIONS
• Arithmetic instructions are used to do
arithmetic operation such as
• Addition
• Subtraction
• Multiplication
• Division
ARITHMETIC INSTRUCTIONS
• Addition
Instruction Examples
ADD AL,BL
ADD CX,DI ADC
AX,[BX] INC SP
ARITHMETIC INSTRUCTIONS
• SUBTRACT instruction
Examples
SUB AX, SP SUB DH,6F
SBB AX,BX DEC BH
ARITHMETIC INSTRUCTIONS
• MULTIPLICATION instructions
MUL CL
MUL CX IMUL CL
• DIVISION instructions DIV CL
IDIV SI
LOGICAL INSTRUCTION
• AND instruction
Example
AND AL,BL
• OR instruction
Example
OR SI,DX
• XOR instruction
XOR CH,OE
• NOT instruction
NOT CH
Shift and Rotate Instruction
• SHL instruction
SHL AX,1
• SHR instruction
SHR AX,CL
• ROL instruction
ROL AX,1
• ROR instruction
ROR AX,CL
Jump Instruction
• Jump instruction are used to change the
execution path of instruction in the
program.
i) Unconditional Jump Short Jump
Near Jump Far Jump
ii)Conditional Jump
String and String Handling
Instructions
• Move Operation: Move is a process of
moving a string of data from one Memory
Location to another.
Eg. MOVSB: This instruction moves a byte of
data from one memory location to another.
MOVSW: This instruction moves a word of
data from Source to Destination Operand.
String and String Handling
Instructions
• Compare Operation: Compare is a process of
comparing two elements in the same or
different string.
Eg. COMPSB: This instruction compares a byte
of data from one memory location to another.
COMPSW: This instruction compares a word of
data from one memory location to another.
String and String Handling
Instructions
• SCAN: SCAN is a process of comparing
elements of Destination string with
Accumulator.
Eg. SCASB: This instruction scans a byte of
data from Destination with Accumulator
Register.
SCASW: This instruction scans a word of data
from Destination with Accumulator Register.
String and String Handling
Instructions
• Load Operation: Load is a process of loading
string elements from Memory Location with
Accumulator.
Eg. LODSB: This instruction loads a byte of
data from Memory Location with
Accumulator.
LODSW: This instruction lods a word of data
from Memory Location with Accumulator.
String and String Handling
Instructions
• Store Operations: Store is a process of moving
string of elements from Accumulator to
Memory Location.
Eg.STOSB: This instruction stores a byte of
data from Accumulator to Memory Location.
STOSW: This instruction stores a word of data
from Accumulator to Memory Location.
String and String Handling
Instructions
• AUTO INDEXING: Auto Indexing is a
process of Incrementing or Decrementing the
content of Source Index or Destination Index.
Eg.CLD: When this instruction is executed
Direction Flag is cleared to zero. Now Auto
Incrementing Source Index or Destination
Index takes place.
Thank
You