SlideShare a Scribd company logo
1 of 18
VCET-EEE Dept created by C.GOKUL AP/EEE
Instruction set of 8086 Microprocessor (Classification of Instructions)
 Data Transfer Instructions
 Arithmetic Instructions
 Bit Manipulation Instructions
 Program Execution Transfer Instructions
 String Instructions
 Processor Control Instructions
1. DATA TRANSFER INSTRUCTIONS
These instructions are used to transfer data from source to destination.
The operand can be a constant, memory location, register or I/O port
address.
Mnemonic Meaning Format Operation
MOV Move Mov D,S (S)  (D)
XCHG Exchange XCHG D,S (S) (D)
LEA Load Effective
Address
LEA Reg16,EA EA  (Reg16)
LDS Load Register
And DS
LDS Reg16,MEM32 (MEM32)  (Reg16)
(Mem32+2)  (DS)
LES Load Register
&ES
LES Reg16,MEM32 (MEM32)  (Reg16)(Mem32+2)
 (DS)
i. MOV Des, Src
Src operand can be register, memory location or immediate operand.
VCET-EEE Dept created by C.GOKUL AP/EEE
Des can be register or memory operand.
Both Src and Des cannot be memory location at the same time.
E.g.: MOV CX, 037A H , MOV AL, BL
ii. PUSH Operand
It pushes the operand into top of stack.
E.g.: PUSH BX
iii. POP Des
It pops the operand from top of stack to Des.
Des can be a general purpose register, segment register (except CS) or memory
location.
E.g.: POP AX
iv. XCHG Des, Src
 This instruction exchanges Src with Des.
 It cannot exchange two memory locations directly.
E.g.: XCHG DX, AX
v. IN Accumulator, Port Address
 It transfers the operand from specified port to accumulator register.
E.g.: IN AX, 0028 H
vi. OUT Port Address, Accumulator
 It transfers the operand from accumulator to specified port.
E.g.: OUT 0028 H, AX
vii. LDS Des, Src
 It loads 32-bit pointer from memory source to destination register and DS.
 E.g: LDS BX, [0301 H]
viii. LES Des, Src
 It loads 32-bit pointer from memory source to destination register and ES.
VCET-EEE Dept created by C.GOKUL AP/EEE
ix LAHF
 It copies the lower byte of flag register to AH.
x SAHF
 It copies the contents of AH to lower byte of flag register.
xi PUSHF
 Pushes flag register to top of stack.
xii POPF
 Pops the stack top to flag register.
2. ARITHMETIC INSTRUCTIONS
Mnemonic Meaning Format Operation
SUB Subtract SUB D,S (D) - (S)  (D)
Borrow  (CF)
SBB Subtract with
borrow
SBB D,S (D) - (S) - (CF)  (D)
DEC Decrement by
one
DEC D (D) - 1  (D)
NEG Negate NEG D
DAS Decimal adjust
for subtraction
DAS Convert the result in AL to
packed decimal format
AAS ASCII adjust
for subtraction
AAS (AL) difference (AH) dec by 1 if
borrow
ADD Addition ADD D,S (S)+(D)  (D)
carry  (CF)
VCET-EEE Dept created by C.GOKUL AP/EEE
ADC Add with carry ADC D,S (S)+(D)+(CF)  (D)
carry  (CF)
INC Increment by
one
INC D (D)+1  (D)
AAA ASCII adjust
for addition
AAA If the sum is >9, AH
is incremented by 1
DAA Decimal adjust
for addition
DAA Adjust AL for decimal
Packed BCD
i. ADC Des, Src:
It adds the two operands with CF.
It effects AF, CF, OF, PF, SF, ZF flags.
E.g ADC AL, 74H ADC DX, AX
ii. ADD Des, Src
It adds a byte to byte or a word to word.
It effects AF, CF, OF, PF, SF, ZF flags.
E.g ADD AL, 74H ADD DX, AX
iii. SUB Des, Src
It subtracts a byte from byte or a word from word.
It effects AF, CF, OF, PF, SF, ZF flags.
For subtraction, CF acts as borrow flag.
iv. SBB Des, Src
It subtracts the two operands and also the borrow from the result
Eg: SBB AL, 74H SBB DX, AX
v. INC Src
It increments the byte or word by one.
VCET-EEE Dept created by C.GOKUL AP/EEE
It effects AF, OF, PF, SF, ZF flags. CF is not effected
vi. DEC Src
It decrements the byte or word by one.
It effects AF, OF, PF, SF, ZF flags. CF is not effected
vii. AAA (ASCII Adjust after Addition)
The data entered from the terminal is in ASCII format
o AAS (ASCII Adjust after Subtraction)
o AAM (ASCII Adjust after Multiplication)
o AAD (ASCII Adjust Before Division)
viii. DAA (Decimal Adjust after Addition)
It is used to make sure that the result of adding two BCD numbers is adjusted to
be a correct BCD number.
It only works on AL register
ix. DAS (Decimal Adjust after Subtraction)
It is used to make sure that the result of subtracting two BCD numbers is
adjusted to be a correct BCD number.
It only works on AL register.
x. NEG Src
It creates 2’s complement of a given number.
That means, it changes the sign of a number.
xi. CMP Des, Src
It compares two specified bytes or words.
The Src and Des can be a constant, register or memory location.
Both operands cannot be a memory location at the same time.
The comparison is done simply by internally subtracting the source from
destination.
The value of source and destination does not change, but the flags are modified
to indicate the result.
VCET-EEE Dept created by C.GOKUL AP/EEE
xii. MUL Src
It is an unsigned multiplication instruction.
It multiplies two bytes to produce a word or two words to produce a double word.
AX = AL * Src
DX : AX = AX * Src
This instruction assumes one of the operand in AL or AX.
Src can be a register or memory location.
xiii. IMUL Src:
It is a signed multiplication instruction
xiv. DIV Src :
It is an unsigned division instruction.
It divides word by byte or double word by word.
The operand is stored in AX, divisor is Src and the result is stored as:
AH = remainder AL = quotient
xv. IDIV Src:
It is a signed division instruction
xvi. CBW (Convert Byte to Word)
This instruction converts byte in AL to word in AX.
The conversion is done by extending the sign bit of AL throughout AH.
xvii. CWD (Convert Word to Double Word)
This instruction converts word in AX to double word in DX : AX
The conversion is done by extending the sign bit of AX throughout DX
VCET-EEE Dept created by C.GOKUL AP/EEE
Multiplication and Division Examples
VCET-EEE Dept created by C.GOKUL AP/EEE
VCET-EEE Dept created by C.GOKUL AP/EEE
MULTIPLICATION AND DIVISION:
Multiplication
(MUL or IMUL)
Multiplicand Operand
(Multiplier)
Result
Byte*Byte AL Register or memory AX
Word*Word AX Register or memory DX :AX
Dword*Dword EAX Register or memory EAX :EDX
Division
(DIV or IDIV)
Dividend Operand
(Divisor)
Quotient: Remainder
Word/Byte AX Register or Memory AL : AH
Dword/Word DX:AX Register or Memory AX : DX
Qword/Dword EDX: EAX Register or Memory EAX : EDX
VCET-EEE Dept created by C.GOKUL AP/EEE
3. Bit Manipulation Instructions
These instructions are used at the bit level.
These instructions can be used for:
Testing a zero bit
Set or reset a bit
Shift bits across registers
Mnemonic Meaning Format Operation
AND
OR
XOR
NOT
Logical AND
Logical Inclusive OR
Logical Exclusive OR
LOGICAL NOT
AND D,S
OR D,S
XOR D,S
NOT D
(S) · (D) → (D)
(S) + (D) → (D)
(S) (D) → (D)
(D) → (D)
i. AND
Especially used in clearing certain bits (masking)
xxxx xxxx AND 0000 1111 = 0000 xxxx
(clear the first four bits B7-B4)
–Examples: AND BL, 0FH
ii. OR
Used in setting certain bits
xxxx xxxx OR 0000 1111 = xxxx 1111
(Set the upper four bits B4-B0)
iii. XOR
Used in Inverting bits
xxxx xxxx XOR 0000 1111 = xxxx x’x’x’x’ (Invert the upper four bits B4-B0)
VCET-EEE Dept created by C.GOKUL AP/EEE
Example: Clear bits 0 and 1, set bits 6 and 7, invert bit 5 of register CL:
AND CL, FCH ; 1111 1100B
OR CL, C0H ; 1100 0000B
XOR CL, 20H ; 0010 0000B
iv. SHL
The SHL (shift left) instruction performs a logical left shift on the destination
operand, filling the lowest bit with 0.
Example:
mov DL,4
shl DL,1 RESULT  DL =10 ( 4 * 21
= 8 )
v. SHR
The SHR (shift right) instruction performs a logical right shift on the destination
operand. The highest bit position is filled with a zero
Example:
mov DL,8
shr DL,1 RESULT  DL =4 ( 8 / 21
= 4 )
vi. SAR
performs a right arithmetic shift on the destination operand
Example:
mov DL,-8
sar DL,2 RESULT  DL = - 2 ( - 8 / 22
= - 2 )
vii. ROL
ROL (rotate) shifts each bit to the left
The highest bit is copied into both the Carry flag and into the lowest bit
No bits are lost
Example:
VCET-EEE Dept created by C.GOKUL AP/EEE
Example:
viii. ROR
ROR (rotate right) shifts each bit to the right
The lowest bit is copied into both the Carry flag and into the highest bit
No bits are lost
ix. RCL
RCL (rotate carry left) shifts each bit to the left
Copies the Carry flag to the least significant bit
Copies the most significant bit to the Carry flag
x. ROR Instruction
ROR (rotate right) shifts each bit to the right
The lowest bit is copied into both the Carry flag and into the highest bit
VCET-EEE Dept created by C.GOKUL AP/EEE
No bits are lost
xi. RCR
RCR (rotate carry right) shifts each bit to the right
Copies the Carry flag to the most significant bit
Copies the least significant bit to the Carry flag
VCET-EEE Dept created by C.GOKUL AP/EEE
4. PROGRAM EXECUTION TRANSFER INSTRUCTIONS
These instructions cause change in the sequence of the execution of instruction.
This change can be through a condition or sometimes unconditional.
The conditions are represented by flags.
i. CALL Des
This instruction is used to call a subroutine or function or procedure.
The address of next instruction after CALL is saved onto stack.
ii. RET
It returns the control from procedure to calling program.
Every CALL instruction should have a RET.
iii. JMP Des
This instruction is used for unconditional jump from one place to another
iv. Jxx Des
All the conditional jumps follow some conditional statements or any
instruction that affects the flag
Mnemonic meaning condition
JA Above CF=0 and ZF=0
JB Above or Equal CF=0
JB Below CF=1
JBE Below or Equal CF=1 or ZF=1
JC Carry CF=1
JCXZ CX register is Zero (CF or ZF)=0
VCET-EEE Dept created by C.GOKUL AP/EEE
JE Equal ZF=1
JG Greater ZF=0 and SF=OF
JGE Greater or Equal SF=OF
JL Less (SF XOR OF) = 1
Mnemonic meaning condition
JLE Less or Equal ((SF XOR OF) or ZF) = 1
JNA Not Above CF =1 or Zf=1
JNAE Not Above nor Equal CF = 1
JNB Not Below CF = 0
JNBE Not Below nor Equal CF = 0 and ZF = 0
JNC Not Carry CF = 0
JNE Not Equal ZF = 0
JNG Not Greater ((SF XOR OF) or ZF)=1
JNGE Not Greater nor Equal (SF XOR OF) = 1
JNL Not Less SF = OF
VCET-EEE Dept created by C.GOKUL AP/EEE
Mnemonic meaning format Operation
LOOP Loop Loop short-
label
(CX)  (CX) – 1
Jump to location given
by short-label if CX ≠ 0
LOOPE/
LOOPZ
Loop while
equal/ loop
while zero
LOOPE/LOOPZ
short-label
(CX)  (CX) – 1
Jump to location given
by short-label if CX ≠ 0
and ZF=1
LOOPNE/
LOOPNZ
Loop while
not equal/
loop while
not zero
LOOPNE/LOO
PNZ short-
label
(CX)  (CX) – 1
Jump to location given
by short-label if CX ≠ 0
and ZF=0
v. Loop Des:
This is a looping instruction.
The number of times looping is required is placed in the CX register.
With each iteration, the contents of CX are decremented.
ZF is checked whether to loop again or not.
5. STRING INSTRUCTIONS
String in assembly language is just a sequentially stored bytes or words.
There are very strong set of string instructions in 8086.
By using these string instructions, the size of the program is considerably
reduced.
VCET-EEE Dept created by C.GOKUL AP/EEE
CMPS Des, Src:
o It compares the string bytes or words.
SCAS String:
It scans a string.
It compares the String with byte in AL or with word in AX.
MOVS / MOVSB / MOVSW
It causes moving of byte or word from one string to another.
In this instruction, the source string is in Data Segment and destination string is
in Extra Segment.
SI and DI store the offset values for source and destination index.
REP (Repeat):
This is an instruction prefix.
It causes the repetition of the instruction until CX becomes zero.
E.g.: REP MOVSB STR1, STR2
a. It copies byte by byte contents.
b. REP repeats the operation MOVSB until CX becomes zero.
6. PROCESSOR CONTROL INSTRUCTIONS
These instructions control the processor itself.
8086 allows to control certain control flags that:
causes the processing in a certain direction
processor synchronization if more than one microprocessor attached.
STC:
o It sets the carry flag to 1.
VCET-EEE Dept created by C.GOKUL AP/EEE
CLC:
o It clears the carry flag to 0.
CMC:
o It complements the carry flag.
STD:
o It sets the direction flag to 1.
o If it is set, string bytes are accessed from higher memory address to
lower memory address.
CLD:
o It clears the direction flag to 0.
o If it is reset, the string bytes are accessed from lower memory address to
higher memory address.
HLT instruction – HALT processing
The HLT instruction will cause the 8086 to stop fetching and
executing instructions.
NOP instruction
this instruction simply takes up three clock cycles and does no
processing.
LOCK instruction
This is a prefix to an instruction. This prefix makes sure that during
execution of the instruction, control of system bus is not taken by other
microprocessor.
WAIT instruction
This instruction takes 8086 to an idle condition. The CPU will not do any
processing during this.
ESC instruction
whenever this instruction executes, the microprocessor does NOP or
access a data from memory for coprocessor. This instruction passes the information
to 8087 math processor. Six bits of ESC instruction provide the opcode to
coprocessor.
when 8086 fetches instruction bytes, co-processor also picks up these
bytes and puts in its queue. The co-processor will treat normal 8086 instructions as
NOP. Floating point instructions are executed by 8087 and during this 8086 will be in
WAIT.

More Related Content

What's hot

Assembly language 8086
Assembly language 8086Assembly language 8086
Assembly language 8086John Cutajar
 
8086-instruction-set-ppt
 8086-instruction-set-ppt 8086-instruction-set-ppt
8086-instruction-set-pptjemimajerome
 
Assembly Language Lecture 5
Assembly Language Lecture 5Assembly Language Lecture 5
Assembly Language Lecture 5Motaz Saad
 
Unit 3 – assembly language programming
Unit 3 – assembly language programmingUnit 3 – assembly language programming
Unit 3 – assembly language programmingKartik Sharma
 
Instruction set of 8086
Instruction set of 8086Instruction set of 8086
Instruction set of 8086Akhila Rahul
 
Logic, shift and rotate instruction
Logic, shift and rotate instructionLogic, shift and rotate instruction
Logic, shift and rotate instructionkashif Shafqat
 
Operation of 8255A
Operation of 8255AOperation of 8255A
Operation of 8255AAnuj Yadav
 
Arrays and addressing modes
Arrays and addressing modesArrays and addressing modes
Arrays and addressing modesBilal Amjad
 
8257 DMA Controller
8257 DMA Controller8257 DMA Controller
8257 DMA ControllerShivamSood22
 
Ascii adjust & decimal adjust
Ascii adjust & decimal adjustAscii adjust & decimal adjust
Ascii adjust & decimal adjustTech_MX
 
Instruction sets of 8086
Instruction sets of 8086Instruction sets of 8086
Instruction sets of 8086Mahalakshmiv11
 
8237 dma controller
8237 dma controller8237 dma controller
8237 dma controllerTech_MX
 
Interrupts on 8086 microprocessor by vijay kumar.k
Interrupts on 8086 microprocessor by vijay kumar.kInterrupts on 8086 microprocessor by vijay kumar.k
Interrupts on 8086 microprocessor by vijay kumar.kVijay Kumar
 
Pin digram of 8086
Pin digram of 8086Pin digram of 8086
Pin digram of 8086RJ
 
8086 Interrupts & With DOS and BIOS by vijay
8086 Interrupts &  With DOS and BIOS  by vijay8086 Interrupts &  With DOS and BIOS  by vijay
8086 Interrupts & With DOS and BIOS by vijayVijay Kumar
 

What's hot (20)

Assembly language 8086
Assembly language 8086Assembly language 8086
Assembly language 8086
 
8086-instruction-set-ppt
 8086-instruction-set-ppt 8086-instruction-set-ppt
8086-instruction-set-ppt
 
Assembly Language Lecture 5
Assembly Language Lecture 5Assembly Language Lecture 5
Assembly Language Lecture 5
 
Unit 3 – assembly language programming
Unit 3 – assembly language programmingUnit 3 – assembly language programming
Unit 3 – assembly language programming
 
Instruction set of 8086
Instruction set of 8086Instruction set of 8086
Instruction set of 8086
 
Logic, shift and rotate instruction
Logic, shift and rotate instructionLogic, shift and rotate instruction
Logic, shift and rotate instruction
 
Operation of 8255A
Operation of 8255AOperation of 8255A
Operation of 8255A
 
Rotate instructions
Rotate instructionsRotate instructions
Rotate instructions
 
Arrays and addressing modes
Arrays and addressing modesArrays and addressing modes
Arrays and addressing modes
 
8257 DMA Controller
8257 DMA Controller8257 DMA Controller
8257 DMA Controller
 
Ascii adjust & decimal adjust
Ascii adjust & decimal adjustAscii adjust & decimal adjust
Ascii adjust & decimal adjust
 
8086 alp
8086 alp8086 alp
8086 alp
 
Assembly 8086
Assembly 8086Assembly 8086
Assembly 8086
 
Instruction sets of 8086
Instruction sets of 8086Instruction sets of 8086
Instruction sets of 8086
 
8237 dma controller
8237 dma controller8237 dma controller
8237 dma controller
 
Interrupts on 8086 microprocessor by vijay kumar.k
Interrupts on 8086 microprocessor by vijay kumar.kInterrupts on 8086 microprocessor by vijay kumar.k
Interrupts on 8086 microprocessor by vijay kumar.k
 
Pin digram of 8086
Pin digram of 8086Pin digram of 8086
Pin digram of 8086
 
DAA AND DAS
DAA AND DASDAA AND DAS
DAA AND DAS
 
8086 micro processor
8086 micro processor8086 micro processor
8086 micro processor
 
8086 Interrupts & With DOS and BIOS by vijay
8086 Interrupts &  With DOS and BIOS  by vijay8086 Interrupts &  With DOS and BIOS  by vijay
8086 Interrupts & With DOS and BIOS by vijay
 

Viewers also liked

Instruction Set of 8086 Microprocessor
Instruction Set of 8086 MicroprocessorInstruction Set of 8086 Microprocessor
Instruction Set of 8086 MicroprocessorAshita Agrawal
 
Instruction set of 8086
Instruction set of 8086Instruction set of 8086
Instruction set of 8086aviban
 
8086 microprocessor-architecture
8086 microprocessor-architecture8086 microprocessor-architecture
8086 microprocessor-architectureprasadpawaskar
 
(246431835) instruction set principles (2) (1)
(246431835) instruction set principles (2) (1)(246431835) instruction set principles (2) (1)
(246431835) instruction set principles (2) (1)Alveena Saleem
 
8086 instruction set
8086 instruction set8086 instruction set
8086 instruction setjemimajerome
 
Programming Notes
Programming NotesProgramming Notes
Programming Notesbillhicks69
 
17443 microprocessor
17443   microprocessor17443   microprocessor
17443 microprocessorsoni_nits
 
2 input output dan internal memori
2 input output dan internal memori2 input output dan internal memori
2 input output dan internal memoriSimon Patabang
 
10 8086 instruction set
10 8086 instruction set10 8086 instruction set
10 8086 instruction setShivam Singhal
 
8086 module 1 & 2 work
8086 module 1 & 2   work8086 module 1 & 2   work
8086 module 1 & 2 workSuhail Km
 

Viewers also liked (20)

Instruction Set of 8086 Microprocessor
Instruction Set of 8086 MicroprocessorInstruction Set of 8086 Microprocessor
Instruction Set of 8086 Microprocessor
 
Instruction set of 8086
Instruction set of 8086Instruction set of 8086
Instruction set of 8086
 
EE2356 Microprocessor and Microcontroller Lab Manuel
EE2356 Microprocessor and Microcontroller Lab ManuelEE2356 Microprocessor and Microcontroller Lab Manuel
EE2356 Microprocessor and Microcontroller Lab Manuel
 
Microprocessor interview questions
Microprocessor interview questionsMicroprocessor interview questions
Microprocessor interview questions
 
8086 microprocessor-architecture
8086 microprocessor-architecture8086 microprocessor-architecture
8086 microprocessor-architecture
 
(246431835) instruction set principles (2) (1)
(246431835) instruction set principles (2) (1)(246431835) instruction set principles (2) (1)
(246431835) instruction set principles (2) (1)
 
8086 instruction set
8086 instruction set8086 instruction set
8086 instruction set
 
8086 Microprocessor
8086 Microprocessor8086 Microprocessor
8086 Microprocessor
 
Programming Notes
Programming NotesProgramming Notes
Programming Notes
 
17443 microprocessor
17443   microprocessor17443   microprocessor
17443 microprocessor
 
EE6502 Microprocessor & Microcontroller Regulation 2013
EE6502 Microprocessor & Microcontroller Regulation 2013EE6502 Microprocessor & Microcontroller Regulation 2013
EE6502 Microprocessor & Microcontroller Regulation 2013
 
Professional Ethics
Professional EthicsProfessional Ethics
Professional Ethics
 
ELECTRICAL SYSTEMS
ELECTRICAL SYSTEMSELECTRICAL SYSTEMS
ELECTRICAL SYSTEMS
 
2 input output dan internal memori
2 input output dan internal memori2 input output dan internal memori
2 input output dan internal memori
 
10 8086 instruction set
10 8086 instruction set10 8086 instruction set
10 8086 instruction set
 
EE6711 Power System Simulation Lab manual
EE6711 Power System Simulation Lab manualEE6711 Power System Simulation Lab manual
EE6711 Power System Simulation Lab manual
 
8085 alp programs
8085 alp programs8085 alp programs
8085 alp programs
 
8086 module 1 & 2 work
8086 module 1 & 2   work8086 module 1 & 2   work
8086 module 1 & 2 work
 
Principles of management
Principles of management Principles of management
Principles of management
 
Instruction set of 8086
Instruction set of 8086Instruction set of 8086
Instruction set of 8086
 

Similar to Instruction set of 8086 Microprocessor

Chap 3_2.ppt
Chap 3_2.pptChap 3_2.ppt
Chap 3_2.pptinian2
 
Ilfak Guilfanov - Decompiler internals: Microcode [rooted2018]
Ilfak Guilfanov - Decompiler internals: Microcode [rooted2018]Ilfak Guilfanov - Decompiler internals: Microcode [rooted2018]
Ilfak Guilfanov - Decompiler internals: Microcode [rooted2018]RootedCON
 
Instruction set-of-8086
Instruction set-of-8086Instruction set-of-8086
Instruction set-of-8086mudulin
 
EMBEDDED SYSTEMS 4&5
EMBEDDED SYSTEMS 4&5EMBEDDED SYSTEMS 4&5
EMBEDDED SYSTEMS 4&5PRADEEP
 
instruction-set-of-8086-mr-binu-joy3.ppt
instruction-set-of-8086-mr-binu-joy3.pptinstruction-set-of-8086-mr-binu-joy3.ppt
instruction-set-of-8086-mr-binu-joy3.pptssuser2b759d
 
Instructionsetof8086 180224060745(3)
Instructionsetof8086 180224060745(3)Instructionsetof8086 180224060745(3)
Instructionsetof8086 180224060745(3)AmitPaliwal20
 
Intel codetable
Intel codetableIntel codetable
Intel codetableJ R7
 
Low-level Shader Optimization for Next-Gen and DX11 by Emil Persson
Low-level Shader Optimization for Next-Gen and DX11 by Emil PerssonLow-level Shader Optimization for Next-Gen and DX11 by Emil Persson
Low-level Shader Optimization for Next-Gen and DX11 by Emil PerssonAMD Developer Central
 
8086 arch instns
8086 arch instns8086 arch instns
8086 arch instnsRam Babu
 
1344 Alp Of 8086
1344 Alp Of 80861344 Alp Of 8086
1344 Alp Of 8086techbed
 
Assembly Language Lecture 4
Assembly Language Lecture 4Assembly Language Lecture 4
Assembly Language Lecture 4Motaz Saad
 
Flag registers, addressing modes, instruction set
Flag registers, addressing modes, instruction setFlag registers, addressing modes, instruction set
Flag registers, addressing modes, instruction setaviban
 

Similar to Instruction set of 8086 Microprocessor (20)

Chap 3_2.ppt
Chap 3_2.pptChap 3_2.ppt
Chap 3_2.ppt
 
Instruction set
Instruction setInstruction set
Instruction set
 
8086 instruction set
8086 instruction set8086 instruction set
8086 instruction set
 
Lecture5
Lecture5Lecture5
Lecture5
 
Lecture5(1)
Lecture5(1)Lecture5(1)
Lecture5(1)
 
Ilfak Guilfanov - Decompiler internals: Microcode [rooted2018]
Ilfak Guilfanov - Decompiler internals: Microcode [rooted2018]Ilfak Guilfanov - Decompiler internals: Microcode [rooted2018]
Ilfak Guilfanov - Decompiler internals: Microcode [rooted2018]
 
Instruction set-of-8086
Instruction set-of-8086Instruction set-of-8086
Instruction set-of-8086
 
EMBEDDED SYSTEMS 4&5
EMBEDDED SYSTEMS 4&5EMBEDDED SYSTEMS 4&5
EMBEDDED SYSTEMS 4&5
 
instruction-set-of-8086-mr-binu-joy3.ppt
instruction-set-of-8086-mr-binu-joy3.pptinstruction-set-of-8086-mr-binu-joy3.ppt
instruction-set-of-8086-mr-binu-joy3.ppt
 
Instructionsetof8086 180224060745(3)
Instructionsetof8086 180224060745(3)Instructionsetof8086 180224060745(3)
Instructionsetof8086 180224060745(3)
 
[ASM]Lab4
[ASM]Lab4[ASM]Lab4
[ASM]Lab4
 
Al2ed chapter7
Al2ed chapter7Al2ed chapter7
Al2ed chapter7
 
Intel codetable
Intel codetableIntel codetable
Intel codetable
 
Low-level Shader Optimization for Next-Gen and DX11 by Emil Persson
Low-level Shader Optimization for Next-Gen and DX11 by Emil PerssonLow-level Shader Optimization for Next-Gen and DX11 by Emil Persson
Low-level Shader Optimization for Next-Gen and DX11 by Emil Persson
 
8086 arch instns
8086 arch instns8086 arch instns
8086 arch instns
 
1344 Alp Of 8086
1344 Alp Of 80861344 Alp Of 8086
1344 Alp Of 8086
 
Assembly Language Lecture 4
Assembly Language Lecture 4Assembly Language Lecture 4
Assembly Language Lecture 4
 
X86 operation types
X86 operation typesX86 operation types
X86 operation types
 
Flag registers, addressing modes, instruction set
Flag registers, addressing modes, instruction setFlag registers, addressing modes, instruction set
Flag registers, addressing modes, instruction set
 
mm_1.pdf
mm_1.pdfmm_1.pdf
mm_1.pdf
 

More from Velalar College of Engineering and Technology (10)

ACO, Firefly, Modified Firefly, BAT, ABC algorithms
ACO, Firefly, Modified Firefly, BAT, ABC algorithmsACO, Firefly, Modified Firefly, BAT, ABC algorithms
ACO, Firefly, Modified Firefly, BAT, ABC algorithms
 
Electric Energy Generation, Utilization and Conservation PROBLEMS
Electric Energy Generation, Utilization and Conservation PROBLEMSElectric Energy Generation, Utilization and Conservation PROBLEMS
Electric Energy Generation, Utilization and Conservation PROBLEMS
 
EE6702 Protection and Switchgear notes R2013
EE6702 Protection and Switchgear notes R2013EE6702 Protection and Switchgear notes R2013
EE6702 Protection and Switchgear notes R2013
 
Electrical machine Design problems with solutions
Electrical machine Design problems with solutionsElectrical machine Design problems with solutions
Electrical machine Design problems with solutions
 
Design of Electrical Machines Problems & Solutions
Design of Electrical Machines Problems & SolutionsDesign of Electrical Machines Problems & Solutions
Design of Electrical Machines Problems & Solutions
 
Protection and Switchgear
Protection and SwitchgearProtection and Switchgear
Protection and Switchgear
 
Electrical machines 2 AC Machines
Electrical machines 2 AC MachinesElectrical machines 2 AC Machines
Electrical machines 2 AC Machines
 
MICROPROCESSOR & MICROCONTROLLER 8086,8051 Notes
MICROPROCESSOR & MICROCONTROLLER 8086,8051 NotesMICROPROCESSOR & MICROCONTROLLER 8086,8051 Notes
MICROPROCESSOR & MICROCONTROLLER 8086,8051 Notes
 
Timing diagram 8085 microprocessor
Timing diagram 8085 microprocessorTiming diagram 8085 microprocessor
Timing diagram 8085 microprocessor
 
8085 instruction set
8085 instruction set8085 instruction set
8085 instruction set
 

Recently uploaded

Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Disha Kariya
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...Sapna Thakur
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
The byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxThe byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxShobhayan Kirtania
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...Pooja Nehwal
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 

Recently uploaded (20)

Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
The byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxThe byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptx
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 

Instruction set of 8086 Microprocessor

  • 1. VCET-EEE Dept created by C.GOKUL AP/EEE Instruction set of 8086 Microprocessor (Classification of Instructions)  Data Transfer Instructions  Arithmetic Instructions  Bit Manipulation Instructions  Program Execution Transfer Instructions  String Instructions  Processor Control Instructions 1. DATA TRANSFER INSTRUCTIONS These instructions are used to transfer data from source to destination. The operand can be a constant, memory location, register or I/O port address. Mnemonic Meaning Format Operation MOV Move Mov D,S (S)  (D) XCHG Exchange XCHG D,S (S) (D) LEA Load Effective Address LEA Reg16,EA EA  (Reg16) LDS Load Register And DS LDS Reg16,MEM32 (MEM32)  (Reg16) (Mem32+2)  (DS) LES Load Register &ES LES Reg16,MEM32 (MEM32)  (Reg16)(Mem32+2)  (DS) i. MOV Des, Src Src operand can be register, memory location or immediate operand.
  • 2. VCET-EEE Dept created by C.GOKUL AP/EEE Des can be register or memory operand. Both Src and Des cannot be memory location at the same time. E.g.: MOV CX, 037A H , MOV AL, BL ii. PUSH Operand It pushes the operand into top of stack. E.g.: PUSH BX iii. POP Des It pops the operand from top of stack to Des. Des can be a general purpose register, segment register (except CS) or memory location. E.g.: POP AX iv. XCHG Des, Src  This instruction exchanges Src with Des.  It cannot exchange two memory locations directly. E.g.: XCHG DX, AX v. IN Accumulator, Port Address  It transfers the operand from specified port to accumulator register. E.g.: IN AX, 0028 H vi. OUT Port Address, Accumulator  It transfers the operand from accumulator to specified port. E.g.: OUT 0028 H, AX vii. LDS Des, Src  It loads 32-bit pointer from memory source to destination register and DS.  E.g: LDS BX, [0301 H] viii. LES Des, Src  It loads 32-bit pointer from memory source to destination register and ES.
  • 3. VCET-EEE Dept created by C.GOKUL AP/EEE ix LAHF  It copies the lower byte of flag register to AH. x SAHF  It copies the contents of AH to lower byte of flag register. xi PUSHF  Pushes flag register to top of stack. xii POPF  Pops the stack top to flag register. 2. ARITHMETIC INSTRUCTIONS Mnemonic Meaning Format Operation SUB Subtract SUB D,S (D) - (S)  (D) Borrow  (CF) SBB Subtract with borrow SBB D,S (D) - (S) - (CF)  (D) DEC Decrement by one DEC D (D) - 1  (D) NEG Negate NEG D DAS Decimal adjust for subtraction DAS Convert the result in AL to packed decimal format AAS ASCII adjust for subtraction AAS (AL) difference (AH) dec by 1 if borrow ADD Addition ADD D,S (S)+(D)  (D) carry  (CF)
  • 4. VCET-EEE Dept created by C.GOKUL AP/EEE ADC Add with carry ADC D,S (S)+(D)+(CF)  (D) carry  (CF) INC Increment by one INC D (D)+1  (D) AAA ASCII adjust for addition AAA If the sum is >9, AH is incremented by 1 DAA Decimal adjust for addition DAA Adjust AL for decimal Packed BCD i. ADC Des, Src: It adds the two operands with CF. It effects AF, CF, OF, PF, SF, ZF flags. E.g ADC AL, 74H ADC DX, AX ii. ADD Des, Src It adds a byte to byte or a word to word. It effects AF, CF, OF, PF, SF, ZF flags. E.g ADD AL, 74H ADD DX, AX iii. SUB Des, Src It subtracts a byte from byte or a word from word. It effects AF, CF, OF, PF, SF, ZF flags. For subtraction, CF acts as borrow flag. iv. SBB Des, Src It subtracts the two operands and also the borrow from the result Eg: SBB AL, 74H SBB DX, AX v. INC Src It increments the byte or word by one.
  • 5. VCET-EEE Dept created by C.GOKUL AP/EEE It effects AF, OF, PF, SF, ZF flags. CF is not effected vi. DEC Src It decrements the byte or word by one. It effects AF, OF, PF, SF, ZF flags. CF is not effected vii. AAA (ASCII Adjust after Addition) The data entered from the terminal is in ASCII format o AAS (ASCII Adjust after Subtraction) o AAM (ASCII Adjust after Multiplication) o AAD (ASCII Adjust Before Division) viii. DAA (Decimal Adjust after Addition) It is used to make sure that the result of adding two BCD numbers is adjusted to be a correct BCD number. It only works on AL register ix. DAS (Decimal Adjust after Subtraction) It is used to make sure that the result of subtracting two BCD numbers is adjusted to be a correct BCD number. It only works on AL register. x. NEG Src It creates 2’s complement of a given number. That means, it changes the sign of a number. xi. CMP Des, Src It compares two specified bytes or words. The Src and Des can be a constant, register or memory location. Both operands cannot be a memory location at the same time. The comparison is done simply by internally subtracting the source from destination. The value of source and destination does not change, but the flags are modified to indicate the result.
  • 6. VCET-EEE Dept created by C.GOKUL AP/EEE xii. MUL Src It is an unsigned multiplication instruction. It multiplies two bytes to produce a word or two words to produce a double word. AX = AL * Src DX : AX = AX * Src This instruction assumes one of the operand in AL or AX. Src can be a register or memory location. xiii. IMUL Src: It is a signed multiplication instruction xiv. DIV Src : It is an unsigned division instruction. It divides word by byte or double word by word. The operand is stored in AX, divisor is Src and the result is stored as: AH = remainder AL = quotient xv. IDIV Src: It is a signed division instruction xvi. CBW (Convert Byte to Word) This instruction converts byte in AL to word in AX. The conversion is done by extending the sign bit of AL throughout AH. xvii. CWD (Convert Word to Double Word) This instruction converts word in AX to double word in DX : AX The conversion is done by extending the sign bit of AX throughout DX
  • 7. VCET-EEE Dept created by C.GOKUL AP/EEE Multiplication and Division Examples
  • 8. VCET-EEE Dept created by C.GOKUL AP/EEE
  • 9. VCET-EEE Dept created by C.GOKUL AP/EEE MULTIPLICATION AND DIVISION: Multiplication (MUL or IMUL) Multiplicand Operand (Multiplier) Result Byte*Byte AL Register or memory AX Word*Word AX Register or memory DX :AX Dword*Dword EAX Register or memory EAX :EDX Division (DIV or IDIV) Dividend Operand (Divisor) Quotient: Remainder Word/Byte AX Register or Memory AL : AH Dword/Word DX:AX Register or Memory AX : DX Qword/Dword EDX: EAX Register or Memory EAX : EDX
  • 10. VCET-EEE Dept created by C.GOKUL AP/EEE 3. Bit Manipulation Instructions These instructions are used at the bit level. These instructions can be used for: Testing a zero bit Set or reset a bit Shift bits across registers Mnemonic Meaning Format Operation AND OR XOR NOT Logical AND Logical Inclusive OR Logical Exclusive OR LOGICAL NOT AND D,S OR D,S XOR D,S NOT D (S) · (D) → (D) (S) + (D) → (D) (S) (D) → (D) (D) → (D) i. AND Especially used in clearing certain bits (masking) xxxx xxxx AND 0000 1111 = 0000 xxxx (clear the first four bits B7-B4) –Examples: AND BL, 0FH ii. OR Used in setting certain bits xxxx xxxx OR 0000 1111 = xxxx 1111 (Set the upper four bits B4-B0) iii. XOR Used in Inverting bits xxxx xxxx XOR 0000 1111 = xxxx x’x’x’x’ (Invert the upper four bits B4-B0)
  • 11. VCET-EEE Dept created by C.GOKUL AP/EEE Example: Clear bits 0 and 1, set bits 6 and 7, invert bit 5 of register CL: AND CL, FCH ; 1111 1100B OR CL, C0H ; 1100 0000B XOR CL, 20H ; 0010 0000B iv. SHL The SHL (shift left) instruction performs a logical left shift on the destination operand, filling the lowest bit with 0. Example: mov DL,4 shl DL,1 RESULT  DL =10 ( 4 * 21 = 8 ) v. SHR The SHR (shift right) instruction performs a logical right shift on the destination operand. The highest bit position is filled with a zero Example: mov DL,8 shr DL,1 RESULT  DL =4 ( 8 / 21 = 4 ) vi. SAR performs a right arithmetic shift on the destination operand Example: mov DL,-8 sar DL,2 RESULT  DL = - 2 ( - 8 / 22 = - 2 ) vii. ROL ROL (rotate) shifts each bit to the left The highest bit is copied into both the Carry flag and into the lowest bit No bits are lost Example:
  • 12. VCET-EEE Dept created by C.GOKUL AP/EEE Example: viii. ROR ROR (rotate right) shifts each bit to the right The lowest bit is copied into both the Carry flag and into the highest bit No bits are lost ix. RCL RCL (rotate carry left) shifts each bit to the left Copies the Carry flag to the least significant bit Copies the most significant bit to the Carry flag x. ROR Instruction ROR (rotate right) shifts each bit to the right The lowest bit is copied into both the Carry flag and into the highest bit
  • 13. VCET-EEE Dept created by C.GOKUL AP/EEE No bits are lost xi. RCR RCR (rotate carry right) shifts each bit to the right Copies the Carry flag to the most significant bit Copies the least significant bit to the Carry flag
  • 14. VCET-EEE Dept created by C.GOKUL AP/EEE 4. PROGRAM EXECUTION TRANSFER INSTRUCTIONS These instructions cause change in the sequence of the execution of instruction. This change can be through a condition or sometimes unconditional. The conditions are represented by flags. i. CALL Des This instruction is used to call a subroutine or function or procedure. The address of next instruction after CALL is saved onto stack. ii. RET It returns the control from procedure to calling program. Every CALL instruction should have a RET. iii. JMP Des This instruction is used for unconditional jump from one place to another iv. Jxx Des All the conditional jumps follow some conditional statements or any instruction that affects the flag Mnemonic meaning condition JA Above CF=0 and ZF=0 JB Above or Equal CF=0 JB Below CF=1 JBE Below or Equal CF=1 or ZF=1 JC Carry CF=1 JCXZ CX register is Zero (CF or ZF)=0
  • 15. VCET-EEE Dept created by C.GOKUL AP/EEE JE Equal ZF=1 JG Greater ZF=0 and SF=OF JGE Greater or Equal SF=OF JL Less (SF XOR OF) = 1 Mnemonic meaning condition JLE Less or Equal ((SF XOR OF) or ZF) = 1 JNA Not Above CF =1 or Zf=1 JNAE Not Above nor Equal CF = 1 JNB Not Below CF = 0 JNBE Not Below nor Equal CF = 0 and ZF = 0 JNC Not Carry CF = 0 JNE Not Equal ZF = 0 JNG Not Greater ((SF XOR OF) or ZF)=1 JNGE Not Greater nor Equal (SF XOR OF) = 1 JNL Not Less SF = OF
  • 16. VCET-EEE Dept created by C.GOKUL AP/EEE Mnemonic meaning format Operation LOOP Loop Loop short- label (CX)  (CX) – 1 Jump to location given by short-label if CX ≠ 0 LOOPE/ LOOPZ Loop while equal/ loop while zero LOOPE/LOOPZ short-label (CX)  (CX) – 1 Jump to location given by short-label if CX ≠ 0 and ZF=1 LOOPNE/ LOOPNZ Loop while not equal/ loop while not zero LOOPNE/LOO PNZ short- label (CX)  (CX) – 1 Jump to location given by short-label if CX ≠ 0 and ZF=0 v. Loop Des: This is a looping instruction. The number of times looping is required is placed in the CX register. With each iteration, the contents of CX are decremented. ZF is checked whether to loop again or not. 5. STRING INSTRUCTIONS String in assembly language is just a sequentially stored bytes or words. There are very strong set of string instructions in 8086. By using these string instructions, the size of the program is considerably reduced.
  • 17. VCET-EEE Dept created by C.GOKUL AP/EEE CMPS Des, Src: o It compares the string bytes or words. SCAS String: It scans a string. It compares the String with byte in AL or with word in AX. MOVS / MOVSB / MOVSW It causes moving of byte or word from one string to another. In this instruction, the source string is in Data Segment and destination string is in Extra Segment. SI and DI store the offset values for source and destination index. REP (Repeat): This is an instruction prefix. It causes the repetition of the instruction until CX becomes zero. E.g.: REP MOVSB STR1, STR2 a. It copies byte by byte contents. b. REP repeats the operation MOVSB until CX becomes zero. 6. PROCESSOR CONTROL INSTRUCTIONS These instructions control the processor itself. 8086 allows to control certain control flags that: causes the processing in a certain direction processor synchronization if more than one microprocessor attached. STC: o It sets the carry flag to 1.
  • 18. VCET-EEE Dept created by C.GOKUL AP/EEE CLC: o It clears the carry flag to 0. CMC: o It complements the carry flag. STD: o It sets the direction flag to 1. o If it is set, string bytes are accessed from higher memory address to lower memory address. CLD: o It clears the direction flag to 0. o If it is reset, the string bytes are accessed from lower memory address to higher memory address. HLT instruction – HALT processing The HLT instruction will cause the 8086 to stop fetching and executing instructions. NOP instruction this instruction simply takes up three clock cycles and does no processing. LOCK instruction This is a prefix to an instruction. This prefix makes sure that during execution of the instruction, control of system bus is not taken by other microprocessor. WAIT instruction This instruction takes 8086 to an idle condition. The CPU will not do any processing during this. ESC instruction whenever this instruction executes, the microprocessor does NOP or access a data from memory for coprocessor. This instruction passes the information to 8087 math processor. Six bits of ESC instruction provide the opcode to coprocessor. when 8086 fetches instruction bytes, co-processor also picks up these bytes and puts in its queue. The co-processor will treat normal 8086 instructions as NOP. Floating point instructions are executed by 8087 and during this 8086 will be in WAIT.