SlideShare uma empresa Scribd logo
1 de 35
Intel 8086 CPU: An
Introduction
8086 Features
• 16-bit Arithmetic Logic Unit
• 16-bit data bus
• 20-bit address bus - 220 = 1,048,576 = 1 MB
The address refers to a byte in memory. In the 8086, bytes at even
addresses come in on the low half of the data bus (bits 0-7) and bytes at
odd addresses come in on the upper half of the data bus (bits 8-15).
The 8086 can read a 16-bit word at an even address in one operation and
at an odd address in two operations.
The least significant byte of a word on an 8086 family microprocessor is
at the lower address.
8086 Architecture
• The 8086 has two parts, the Bus Interface Unit (BIU) and the
Execution Unit (EU).
• The BIU fetches instructions, reads and writes data, and computes the
20-bit address.
• The EU decodes and executes the instructions using the 16-bit ALU.
• The BIU contains the following registers:
IP - the Instruction Pointer
CS - the Code Segment Register
DS - the Data Segment Register
SS - the Stack Segment Register
ES - the Extra Segment Register
The BIU fetches instructions using the CS and IP, written CS:IP, to construct
the 20-bit address. Data is fetched using a segment register (usually the DS)
and an effective address (EA) computed by the EU depending on the
addressing mode.
8086 Block Diagram
The EU contains the following 16-bit registers:
AX - the Accumulator
BX - the Base Register
CX - the Count Register
DX - the Data Register
SP - the Stack Pointer
BP - the Base Pointer
SI - the Source Index Register
DI - the Destination Register
These are referred to as general-purpose registers, although, as seen by
their names, they often have a special-purpose use for some instructions.
The AX, BX, CX, and DX registers can be considered as two 8-bit
registers, a High byte and a Low byte. This allows byte operations and
compatibility with the previous generation of 8-bit processors, the 8080
and 8085. The 8-bit registers are:
AX --> AH,AL
BX --> BH,BL
CX --> CH,CL
DX --> DH,DL
8086 Architecture ]
Default to stack segment
8086 Programmer’s Model
16-bit Registers
ES
CS
SS
DS
IP
AH
BH
CH
DH
AL
BL
CL
DL
SP
BP
SI
DI
FLAGS
AX
BX
CX
DX
Extra Segment
Code Segment
Stack Segment
Data Segment
Instruction Pointer
Accumulator
Base Register
Count Register
Data Register
Stack Pointer
Base Pointer
Source Index Register
Destination Index Register
BIU registers
(20 bit adder)
EU registers
16 bit arithmetic
FLAG REGISTER
8086 Architecture
The EU also contains the Flag Register which is a collection of condition
bits and control bits. The condition bits are set or cleared by the execution
of an instruction. The control bits are set by instructions to control some
operation of the CPU.
Bit 0 - CF Carry Flag - Set by carry out of msb
Bit 2 - PF Parity Flag - Set if result has even parity i.e. even no.s
of 1’s.
Bit 4 - AF Auxiliary Flag - for BCD arithmetic, set if carry from d
lowest nibble during add n borrow for d lowest nibble during sub.
Bit 6 - ZF Zero Flag - Set if result is zero
Bit 7 - SF Sign Flag = msb of result ,set whn the result of any
computation is negative.
Bit 8 - TF Single Step Trap Flag
Bit 9 - IF Interrupt Enable Flag
Bit 10 - DF String Instruction Direction Flag
Bit 11 - OF Overflow Flag
Bits 1, 3, 5, 12-15 are undefined.
Segments
Segment
Registers
EXTRA
64K Data
Segment
64K Code
Segment
CODE
STACK
DATA
MEMORY Address
000000H
0FFFFFH
Segments are < or = 64K,
can overlap, start at an address
that ends in 0H.
 CS:0
Segment Starting address is segment
register value shifted 4 place to the left.
8086 Memory Terminology
CODE
DATA
STACK
EXTRA
0100H
B200H
CF00H
FF00H
DS:
SS:
ES:
CS:
01000H
B2000H
CF000H
FF000H
10FFFH
C1FFFH
DEFFFH
FFFFFH
00000HSegment
Registers
Memory Segments
Segments are < or = 64K and can overlap.
Note that the Code segment is < 64K since 0FFFFFH is the highest address.
The Code Segment
The offset is the distance in bytes from the start of the segment.
The offset is given by the IP for the Code Segment.
Instructions are always fetched with using the CS register.
The physical address is also called the absolute address
00000H
Memory
Segment Register
Offset
Physical or
Absolute Address
0
+
CS:
IP
0400H
0056H
4000H
4056H
4000
0056
40056H
CS:IP = 4000:0056
Logical Address
FFFFFH
Left-shift 4 bits
The Data Segment
Data is usually fetched with respect to the DS register.
The effective address (EA) is the offset.
The EA depends on the addressing mode.
Memory
Segment Register
Offset
Physical Address
+
DS:
EA
05C0
0050
05C00H
05C50H
05C0 0
0050
05C50H
DS:EA
00000H
FFFFFH
Pin Diagram
S5 : current status of IF
S6 : always LOW
Pin Description
___
BHE
A0 Indication
0 0 Whole
word(AD15-AD0)
0 1 Upper byte (AD15
–AD0)from or to
odd address
1 0 Lower byte (AD7 –
AD0)from or to
even address
1 1 None
Pin Description Continued…
QS1 QS1 Characteristics
0 0 No operation
0 1 First byte of opcode from queue
1 0 Empty the queue
1 1 Subsequent byte from queue
QS1 and QS2 Signals
S2 S1 S0 Characteristics
0 0 0
Interrupt
acknowledge
0 0 1 Read I/O port
0 1 0 Write I/O port
0 1 1 Halt
1 0 0 Code access
1 0 1 Read memory
1 1 0 Write memory
1 1 1 Passive State
S0, S1 and S2 Signals
Hindu College, Amritsar.
Minimum mode signals
MINIMUM MODE 8086 SYSTEM
Read Cycle timing Diagram for Minimum Mode
Maximum Mode 8086 System
Read Cycle timing Diagram for Maximum Mode
Write Cycle timing Diagram for Maximum Mode
Addressing Modes
DATA1 DW 25H DATA1 is defined as a word (16-bit) variable, i.e., a
memory location that contains 25H.
DATA2 EQU 20H DATA2 is not a memory location but a constant.
Direct Addressing
MOV AX,DATA1 [DATA1]  AX, the contents of DATA1 is put into AX.
The CPU goes to memory to get data. 25H is put in AX.
Immediate Addressing
MOV AX,DATA2 DATA2 = 20H  AX, 20H is put in AX.
Does not go to memory to get data.
Data is in the instruction.
MOV AX, OFFSET DATA1 The offset of SAM is just a number.
The assembler knows which mode to encode by the way the operands SAM and
FRED are defined.
Assembler directive, DW = Define Word
Addressing Modes
Register Addressing MOV AX,BX AX BX
Register Indirect Addressing MOV AX,[BX] AX DS:BX
Can use BX or BP -- Based Addressing (BP defaults to SS)
or DI or SI -- Indexed Addressing
The offset or effective address (EA) is in the base or index register.
Register Indirect with Displacement MOV AX,SAM[BX]
AX DS:BX + Offset SAMIndexed with displacement
Based with displacement
Based-Indexed Addressing MOV AX,[BX][SI] EA = BX + SI
Based-Indexed w/Displacement MOV AX,SAM[BX][DI]
EA = BX + DI + offset SAM
AX DS:EA
where EA = BX + offset SAM
Addressing Modes
Branch Related Instructions
Intrasegment
(CS does not change)
Direct -- IP relative displacement
new IP = old IP + displacement
Allows program relocation with
no change in code.
Indirect -- new IP is in memory or a register.
All addressing modes apply.
Intersegment Direct -- new CS and IP are encoded in
(CS changes) the instruction.
Indirect -- new CS and IP are in memory.
All addressing modes apply
except immediate and register.
NEAR JUMPS and CALLS
FAR
Assembly Language
The Assembler is a program that reads the source
program as data and translates the instructions into
binary machine code. The assembler outputs a listing of
the addresses and machine code along with the
source code and a binary file (object file) with the
machine code.
Most assemblers scan the source code twice -- called a
two-pass assembler.
• The first pass determines the locations of the labels
or identifiers.
• The second pass generates the code.
Assembly Language
To locate the labels, the assembler has a location
counter. This counts the number of bytes required by
each instruction.
• When the program starts a segment, the location
counter is zero.
• If a previous segment is re-entered, the counter
resumes the count.
• The location counter can be set to any offset by the
ORG directive.
In the first pass, the assembler uses the location counter
to construct a symbol table which contains the offsets or
values of the various labels.
The offsets are used in the second pass to generate
operand addresses.
adc Add with carry flag
add Add two numbers
and Bitwise logical AND
call Call procedure or function
cbw Convert byte to word (signed)
cli Clear interrupt flag (disable interrupts)
cwd Convert word to doubleword (signed)
cmp Compare two operands
dec Decrement by 1
div Unsigned divide
idiv Signed divide
imul Signed multiply
in Input (read) from port
inc Increment by 1
int Call to interrupt procedure
Instruction Set
iret Interrupt return
j?? Jump if ?? condition met
jmp Unconditional jump
lea Load effective address offset
mov Move data
mul Unsigned multiply
neg Two's complement negate
nop No operation
not One's complement negate
or Bitwise logical OR
out Output (write) to port
pop Pop word from stack
popf Pop flags from stack
push Push word onto stack
Instruction Set (Contd.)
pushf Push flags onto stack
ret Return from procedure or function
sal Bitwise arithmetic left shift (same as shl)
sar Bitwise arithmetic right shift (signed)
sbb Subtract with borrow
shl Bitwise left shift (same as sal)
shr Bitwise right shift (unsigned)
sti Set interrupt flag (enable interrupts)
sub Subtract two numbers
test Bitwise logical compare
xor Bitwise logical XOR
Instruction Set (Contd.)
Conditional Jumps
Name/Alt Meaning Flag setting
JE/JZ Jump equal/zero ZF = 1
JNE/JNZ Jump not equal/zero ZF = 0
JL/JNGE Jump less than/not greater than or = (SF xor OF) = 1
JNL/JGE Jump not less than/greater than or = (SF xor OF) = 0
JG/JNLE Jump greater than/not less than or = ((SF xor OF) or ZF) = 0
JNG/JLE Jump not greater than/ less than or = ((SF xor OF) or ZF) = 1
JB/JNAE Jump below/not above or equal CF = 1
JNB/JAE Jump not below/above or equal CF = 0
JA/JNBE Jump above/not below or equal (CF or ZF) = 0
JNA/JBE Jump not above/ below or equal (CF or ZF) = 1
JS Jump on sign (jump negative) SF = 1
JNS Jump on not sign (jump positive) SF = 0
JO Jump on overflow OF = 1
JNO Jump on no overflow OF = 0
JP/JPE Jump parity/parity even PF = 1
JNP/JPO Jump no parity/parity odd PF = 0
JCXZ Jump on CX = 0 ---
More Assembler Directives
ASSUME Tells the assembler what segments to use.
SEGMENT Defines the segment name and specifies that the
code that follows is in that segment.
ENDS End of segment
ORG Originate or Origin: sets the location counter.
END End of source code.
NAME Give source module a name.
DW Define word
DB Define byte.
EQU Equate or equivalence
LABEL Assign current location count to a symbol.
$ Current location count

Mais conteúdo relacionado

Mais procurados

8086 Microprocessor powerpoint
8086  Microprocessor  powerpoint8086  Microprocessor  powerpoint
8086 Microprocessor powerpointRandhir Kumar
 
Flags registor of 8086 processor
Flags registor of 8086 processorFlags registor of 8086 processor
Flags registor of 8086 processorFazle Akash
 
8086-microprocessor
8086-microprocessor8086-microprocessor
8086-microprocessorjhcid
 
8086 Microprocessor by Nitish Nagar
8086 Microprocessor by Nitish Nagar8086 Microprocessor by Nitish Nagar
8086 Microprocessor by Nitish NagarNitish Nagar
 
Internal architecture-of-8086
Internal architecture-of-8086Internal architecture-of-8086
Internal architecture-of-8086Estiak Khan
 
Register Organisation of 8086 Microprocessor
Register Organisation of 8086 MicroprocessorRegister Organisation of 8086 Microprocessor
Register Organisation of 8086 MicroprocessorNikhil Kumar
 
Register Organisation of 8086 Microprocessor
Register Organisation of 8086 MicroprocessorRegister Organisation of 8086 Microprocessor
Register Organisation of 8086 MicroprocessorNikhil Kumar
 
Microprocessor & Assembly language by team blackhole
Microprocessor & Assembly language by team blackholeMicroprocessor & Assembly language by team blackhole
Microprocessor & Assembly language by team blackholeMd Abdus Sobur Sikdar
 
Pin Description and Register Organization of 8086 Microprocessor
Pin Description and Register Organization of 8086 MicroprocessorPin Description and Register Organization of 8086 Microprocessor
Pin Description and Register Organization of 8086 MicroprocessorMuthusamy Arumugam
 
INTEL 8086 MICROPROCESSOR
INTEL 8086 MICROPROCESSORINTEL 8086 MICROPROCESSOR
INTEL 8086 MICROPROCESSORSagar Kuntumal
 
Intel 8086 microprocessor
Intel 8086 microprocessorIntel 8086 microprocessor
Intel 8086 microprocessorRavi Yasas
 

Mais procurados (20)

8086 Microprocessor powerpoint
8086  Microprocessor  powerpoint8086  Microprocessor  powerpoint
8086 Microprocessor powerpoint
 
Flags registor of 8086 processor
Flags registor of 8086 processorFlags registor of 8086 processor
Flags registor of 8086 processor
 
8086 new
8086 new8086 new
8086 new
 
Lecture2
Lecture2Lecture2
Lecture2
 
8086-microprocessor
8086-microprocessor8086-microprocessor
8086-microprocessor
 
8086 Microprocessor by Nitish Nagar
8086 Microprocessor by Nitish Nagar8086 Microprocessor by Nitish Nagar
8086 Microprocessor by Nitish Nagar
 
Internal architecture-of-8086
Internal architecture-of-8086Internal architecture-of-8086
Internal architecture-of-8086
 
8086
80868086
8086
 
Register Organisation of 8086 Microprocessor
Register Organisation of 8086 MicroprocessorRegister Organisation of 8086 Microprocessor
Register Organisation of 8086 Microprocessor
 
Amp
AmpAmp
Amp
 
Register Organisation of 8086 Microprocessor
Register Organisation of 8086 MicroprocessorRegister Organisation of 8086 Microprocessor
Register Organisation of 8086 Microprocessor
 
Microprocessor & Assembly language by team blackhole
Microprocessor & Assembly language by team blackholeMicroprocessor & Assembly language by team blackhole
Microprocessor & Assembly language by team blackhole
 
Pin Description and Register Organization of 8086 Microprocessor
Pin Description and Register Organization of 8086 MicroprocessorPin Description and Register Organization of 8086 Microprocessor
Pin Description and Register Organization of 8086 Microprocessor
 
8086
80868086
8086
 
Module 1 8086
Module 1 8086Module 1 8086
Module 1 8086
 
INTEL 8086 MICROPROCESSOR
INTEL 8086 MICROPROCESSORINTEL 8086 MICROPROCESSOR
INTEL 8086 MICROPROCESSOR
 
8086 ppt
8086 ppt8086 ppt
8086 ppt
 
8086 architecture
8086 architecture8086 architecture
8086 architecture
 
Intel 8086 microprocessor
Intel 8086 microprocessorIntel 8086 microprocessor
Intel 8086 microprocessor
 
8086 conti
8086 conti8086 conti
8086 conti
 

Semelhante a Intel 8086 CPU: An Introduction to Architecture and Instruction Set

8086 Register organization and Architecture details
8086 Register organization and Architecture details8086 Register organization and Architecture details
8086 Register organization and Architecture detailsMahendraMunirathnam1
 
SAURABH MITRA-8086 MICROPROCESSOR
SAURABH MITRA-8086 MICROPROCESSORSAURABH MITRA-8086 MICROPROCESSOR
SAURABH MITRA-8086 MICROPROCESSORSAURABH MITRA
 
Microprocessor Architecture.pptx
Microprocessor Architecture.pptxMicroprocessor Architecture.pptx
Microprocessor Architecture.pptxCaptain Price
 
8086 microprocessor pptx JNTUH ece 3rd year
8086 microprocessor pptx JNTUH ece 3rd year8086 microprocessor pptx JNTUH ece 3rd year
8086 microprocessor pptx JNTUH ece 3rd yearBharghavteja1
 
Microprocessor if deptt- 17th september 2021 (2)
Microprocessor if deptt- 17th september 2021 (2)Microprocessor if deptt- 17th september 2021 (2)
Microprocessor if deptt- 17th september 2021 (2)AISSMS
 
Unit IV 8086 complete ppt, architecture and instruction set.pptx
Unit IV 8086 complete ppt, architecture and instruction set.pptxUnit IV 8086 complete ppt, architecture and instruction set.pptx
Unit IV 8086 complete ppt, architecture and instruction set.pptxDrVikasMahor
 
Mastering Assembly Language: Programming with 8086
Mastering Assembly Language: Programming with 8086Mastering Assembly Language: Programming with 8086
Mastering Assembly Language: Programming with 8086sravanithonta79
 
introduction to Architecture of 8086 and it's application
introduction to Architecture of 8086 and it's applicationintroduction to Architecture of 8086 and it's application
introduction to Architecture of 8086 and it's applicationDrVikasMahor
 
physical_address segmentation.pdf
physical_address segmentation.pdfphysical_address segmentation.pdf
physical_address segmentation.pdfSwapnil511014
 
Intrl 8086 instruction set
Intrl 8086 instruction setIntrl 8086 instruction set
Intrl 8086 instruction setedwardkiwalabye1
 
3 organization of intel 8086
3 organization of intel 80863 organization of intel 8086
3 organization of intel 8086ELIMENG
 
26677766 8086-microprocessor-architecture
26677766 8086-microprocessor-architecture26677766 8086-microprocessor-architecture
26677766 8086-microprocessor-architectureSaurabh Jain
 

Semelhante a Intel 8086 CPU: An Introduction to Architecture and Instruction Set (20)

8086 Register organization and Architecture details
8086 Register organization and Architecture details8086 Register organization and Architecture details
8086 Register organization and Architecture details
 
SAURABH MITRA-8086 MICROPROCESSOR
SAURABH MITRA-8086 MICROPROCESSORSAURABH MITRA-8086 MICROPROCESSOR
SAURABH MITRA-8086 MICROPROCESSOR
 
Microprocessor Architecture.pptx
Microprocessor Architecture.pptxMicroprocessor Architecture.pptx
Microprocessor Architecture.pptx
 
8086 microprocessor pptx JNTUH ece 3rd year
8086 microprocessor pptx JNTUH ece 3rd year8086 microprocessor pptx JNTUH ece 3rd year
8086 microprocessor pptx JNTUH ece 3rd year
 
Microprocessor if deptt- 17th september 2021 (2)
Microprocessor if deptt- 17th september 2021 (2)Microprocessor if deptt- 17th september 2021 (2)
Microprocessor if deptt- 17th september 2021 (2)
 
Unit IV 8086 complete ppt, architecture and instruction set.pptx
Unit IV 8086 complete ppt, architecture and instruction set.pptxUnit IV 8086 complete ppt, architecture and instruction set.pptx
Unit IV 8086 complete ppt, architecture and instruction set.pptx
 
Mastering Assembly Language: Programming with 8086
Mastering Assembly Language: Programming with 8086Mastering Assembly Language: Programming with 8086
Mastering Assembly Language: Programming with 8086
 
lec 2.pptx
lec 2.pptxlec 2.pptx
lec 2.pptx
 
8086 PPt-2021.pptx
8086 PPt-2021.pptx8086 PPt-2021.pptx
8086 PPt-2021.pptx
 
introduction to Architecture of 8086 and it's application
introduction to Architecture of 8086 and it's applicationintroduction to Architecture of 8086 and it's application
introduction to Architecture of 8086 and it's application
 
physical_address segmentation.pdf
physical_address segmentation.pdfphysical_address segmentation.pdf
physical_address segmentation.pdf
 
8086
80868086
8086
 
Intrl 8086 instruction set
Intrl 8086 instruction setIntrl 8086 instruction set
Intrl 8086 instruction set
 
3 organization of intel 8086
3 organization of intel 80863 organization of intel 8086
3 organization of intel 8086
 
8086 microprocessor
8086 microprocessor8086 microprocessor
8086 microprocessor
 
Advanced micro -processor
Advanced micro -processorAdvanced micro -processor
Advanced micro -processor
 
intel 8086 introduction
intel 8086 introductionintel 8086 introduction
intel 8086 introduction
 
26677766 8086-microprocessor-architecture
26677766 8086-microprocessor-architecture26677766 8086-microprocessor-architecture
26677766 8086-microprocessor-architecture
 
8086 architecture
8086 architecture8086 architecture
8086 architecture
 
Arch 8086
Arch 8086Arch 8086
Arch 8086
 

Último

Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxupamatechverse
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college projectTonystark477637
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSSIVASHANKAR N
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Dr.Costas Sachpazis
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130Suhani Kapoor
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations120cr0395
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlysanyuktamishra911
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingrknatarajan
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performancesivaprakash250
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...Call Girls in Nagpur High Profile
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSKurinjimalarL3
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxupamatechverse
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...RajaP95
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Call Girls in Nagpur High Profile
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINESIVASHANKAR N
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxAsutosh Ranjan
 

Último (20)

Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptx
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college project
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 
Roadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and RoutesRoadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and Routes
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptx
 
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
 
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 

Intel 8086 CPU: An Introduction to Architecture and Instruction Set

  • 1.
  • 2. Intel 8086 CPU: An Introduction 8086 Features • 16-bit Arithmetic Logic Unit • 16-bit data bus • 20-bit address bus - 220 = 1,048,576 = 1 MB The address refers to a byte in memory. In the 8086, bytes at even addresses come in on the low half of the data bus (bits 0-7) and bytes at odd addresses come in on the upper half of the data bus (bits 8-15). The 8086 can read a 16-bit word at an even address in one operation and at an odd address in two operations. The least significant byte of a word on an 8086 family microprocessor is at the lower address.
  • 3. 8086 Architecture • The 8086 has two parts, the Bus Interface Unit (BIU) and the Execution Unit (EU). • The BIU fetches instructions, reads and writes data, and computes the 20-bit address. • The EU decodes and executes the instructions using the 16-bit ALU. • The BIU contains the following registers: IP - the Instruction Pointer CS - the Code Segment Register DS - the Data Segment Register SS - the Stack Segment Register ES - the Extra Segment Register The BIU fetches instructions using the CS and IP, written CS:IP, to construct the 20-bit address. Data is fetched using a segment register (usually the DS) and an effective address (EA) computed by the EU depending on the addressing mode.
  • 5. The EU contains the following 16-bit registers: AX - the Accumulator BX - the Base Register CX - the Count Register DX - the Data Register SP - the Stack Pointer BP - the Base Pointer SI - the Source Index Register DI - the Destination Register These are referred to as general-purpose registers, although, as seen by their names, they often have a special-purpose use for some instructions. The AX, BX, CX, and DX registers can be considered as two 8-bit registers, a High byte and a Low byte. This allows byte operations and compatibility with the previous generation of 8-bit processors, the 8080 and 8085. The 8-bit registers are: AX --> AH,AL BX --> BH,BL CX --> CH,CL DX --> DH,DL 8086 Architecture ] Default to stack segment
  • 6. 8086 Programmer’s Model 16-bit Registers ES CS SS DS IP AH BH CH DH AL BL CL DL SP BP SI DI FLAGS AX BX CX DX Extra Segment Code Segment Stack Segment Data Segment Instruction Pointer Accumulator Base Register Count Register Data Register Stack Pointer Base Pointer Source Index Register Destination Index Register BIU registers (20 bit adder) EU registers 16 bit arithmetic
  • 8. 8086 Architecture The EU also contains the Flag Register which is a collection of condition bits and control bits. The condition bits are set or cleared by the execution of an instruction. The control bits are set by instructions to control some operation of the CPU. Bit 0 - CF Carry Flag - Set by carry out of msb Bit 2 - PF Parity Flag - Set if result has even parity i.e. even no.s of 1’s. Bit 4 - AF Auxiliary Flag - for BCD arithmetic, set if carry from d lowest nibble during add n borrow for d lowest nibble during sub. Bit 6 - ZF Zero Flag - Set if result is zero Bit 7 - SF Sign Flag = msb of result ,set whn the result of any computation is negative. Bit 8 - TF Single Step Trap Flag Bit 9 - IF Interrupt Enable Flag Bit 10 - DF String Instruction Direction Flag Bit 11 - OF Overflow Flag Bits 1, 3, 5, 12-15 are undefined.
  • 9. Segments Segment Registers EXTRA 64K Data Segment 64K Code Segment CODE STACK DATA MEMORY Address 000000H 0FFFFFH Segments are < or = 64K, can overlap, start at an address that ends in 0H.  CS:0 Segment Starting address is segment register value shifted 4 place to the left.
  • 10. 8086 Memory Terminology CODE DATA STACK EXTRA 0100H B200H CF00H FF00H DS: SS: ES: CS: 01000H B2000H CF000H FF000H 10FFFH C1FFFH DEFFFH FFFFFH 00000HSegment Registers Memory Segments Segments are < or = 64K and can overlap. Note that the Code segment is < 64K since 0FFFFFH is the highest address.
  • 11. The Code Segment The offset is the distance in bytes from the start of the segment. The offset is given by the IP for the Code Segment. Instructions are always fetched with using the CS register. The physical address is also called the absolute address 00000H Memory Segment Register Offset Physical or Absolute Address 0 + CS: IP 0400H 0056H 4000H 4056H 4000 0056 40056H CS:IP = 4000:0056 Logical Address FFFFFH Left-shift 4 bits
  • 12. The Data Segment Data is usually fetched with respect to the DS register. The effective address (EA) is the offset. The EA depends on the addressing mode. Memory Segment Register Offset Physical Address + DS: EA 05C0 0050 05C00H 05C50H 05C0 0 0050 05C50H DS:EA 00000H FFFFFH
  • 14. S5 : current status of IF S6 : always LOW Pin Description
  • 15. ___ BHE A0 Indication 0 0 Whole word(AD15-AD0) 0 1 Upper byte (AD15 –AD0)from or to odd address 1 0 Lower byte (AD7 – AD0)from or to even address 1 1 None Pin Description Continued…
  • 16. QS1 QS1 Characteristics 0 0 No operation 0 1 First byte of opcode from queue 1 0 Empty the queue 1 1 Subsequent byte from queue QS1 and QS2 Signals
  • 17. S2 S1 S0 Characteristics 0 0 0 Interrupt acknowledge 0 0 1 Read I/O port 0 1 0 Write I/O port 0 1 1 Halt 1 0 0 Code access 1 0 1 Read memory 1 1 0 Write memory 1 1 1 Passive State S0, S1 and S2 Signals
  • 21. Read Cycle timing Diagram for Minimum Mode
  • 22.
  • 24. Read Cycle timing Diagram for Maximum Mode
  • 25. Write Cycle timing Diagram for Maximum Mode
  • 26. Addressing Modes DATA1 DW 25H DATA1 is defined as a word (16-bit) variable, i.e., a memory location that contains 25H. DATA2 EQU 20H DATA2 is not a memory location but a constant. Direct Addressing MOV AX,DATA1 [DATA1]  AX, the contents of DATA1 is put into AX. The CPU goes to memory to get data. 25H is put in AX. Immediate Addressing MOV AX,DATA2 DATA2 = 20H  AX, 20H is put in AX. Does not go to memory to get data. Data is in the instruction. MOV AX, OFFSET DATA1 The offset of SAM is just a number. The assembler knows which mode to encode by the way the operands SAM and FRED are defined. Assembler directive, DW = Define Word
  • 27. Addressing Modes Register Addressing MOV AX,BX AX BX Register Indirect Addressing MOV AX,[BX] AX DS:BX Can use BX or BP -- Based Addressing (BP defaults to SS) or DI or SI -- Indexed Addressing The offset or effective address (EA) is in the base or index register. Register Indirect with Displacement MOV AX,SAM[BX] AX DS:BX + Offset SAMIndexed with displacement Based with displacement Based-Indexed Addressing MOV AX,[BX][SI] EA = BX + SI Based-Indexed w/Displacement MOV AX,SAM[BX][DI] EA = BX + DI + offset SAM AX DS:EA where EA = BX + offset SAM
  • 28. Addressing Modes Branch Related Instructions Intrasegment (CS does not change) Direct -- IP relative displacement new IP = old IP + displacement Allows program relocation with no change in code. Indirect -- new IP is in memory or a register. All addressing modes apply. Intersegment Direct -- new CS and IP are encoded in (CS changes) the instruction. Indirect -- new CS and IP are in memory. All addressing modes apply except immediate and register. NEAR JUMPS and CALLS FAR
  • 29. Assembly Language The Assembler is a program that reads the source program as data and translates the instructions into binary machine code. The assembler outputs a listing of the addresses and machine code along with the source code and a binary file (object file) with the machine code. Most assemblers scan the source code twice -- called a two-pass assembler. • The first pass determines the locations of the labels or identifiers. • The second pass generates the code.
  • 30. Assembly Language To locate the labels, the assembler has a location counter. This counts the number of bytes required by each instruction. • When the program starts a segment, the location counter is zero. • If a previous segment is re-entered, the counter resumes the count. • The location counter can be set to any offset by the ORG directive. In the first pass, the assembler uses the location counter to construct a symbol table which contains the offsets or values of the various labels. The offsets are used in the second pass to generate operand addresses.
  • 31. adc Add with carry flag add Add two numbers and Bitwise logical AND call Call procedure or function cbw Convert byte to word (signed) cli Clear interrupt flag (disable interrupts) cwd Convert word to doubleword (signed) cmp Compare two operands dec Decrement by 1 div Unsigned divide idiv Signed divide imul Signed multiply in Input (read) from port inc Increment by 1 int Call to interrupt procedure Instruction Set
  • 32. iret Interrupt return j?? Jump if ?? condition met jmp Unconditional jump lea Load effective address offset mov Move data mul Unsigned multiply neg Two's complement negate nop No operation not One's complement negate or Bitwise logical OR out Output (write) to port pop Pop word from stack popf Pop flags from stack push Push word onto stack Instruction Set (Contd.)
  • 33. pushf Push flags onto stack ret Return from procedure or function sal Bitwise arithmetic left shift (same as shl) sar Bitwise arithmetic right shift (signed) sbb Subtract with borrow shl Bitwise left shift (same as sal) shr Bitwise right shift (unsigned) sti Set interrupt flag (enable interrupts) sub Subtract two numbers test Bitwise logical compare xor Bitwise logical XOR Instruction Set (Contd.)
  • 34. Conditional Jumps Name/Alt Meaning Flag setting JE/JZ Jump equal/zero ZF = 1 JNE/JNZ Jump not equal/zero ZF = 0 JL/JNGE Jump less than/not greater than or = (SF xor OF) = 1 JNL/JGE Jump not less than/greater than or = (SF xor OF) = 0 JG/JNLE Jump greater than/not less than or = ((SF xor OF) or ZF) = 0 JNG/JLE Jump not greater than/ less than or = ((SF xor OF) or ZF) = 1 JB/JNAE Jump below/not above or equal CF = 1 JNB/JAE Jump not below/above or equal CF = 0 JA/JNBE Jump above/not below or equal (CF or ZF) = 0 JNA/JBE Jump not above/ below or equal (CF or ZF) = 1 JS Jump on sign (jump negative) SF = 1 JNS Jump on not sign (jump positive) SF = 0 JO Jump on overflow OF = 1 JNO Jump on no overflow OF = 0 JP/JPE Jump parity/parity even PF = 1 JNP/JPO Jump no parity/parity odd PF = 0 JCXZ Jump on CX = 0 ---
  • 35. More Assembler Directives ASSUME Tells the assembler what segments to use. SEGMENT Defines the segment name and specifies that the code that follows is in that segment. ENDS End of segment ORG Originate or Origin: sets the location counter. END End of source code. NAME Give source module a name. DW Define word DB Define byte. EQU Equate or equivalence LABEL Assign current location count to a symbol. $ Current location count