1/25/2024
Topic-II
8086 Microprocessor & it’s
Architecture
T1. Barry B. Brey, The Intel Microprocessors. Pearson, Eight Ed. 2009. Chapter 2
R1. Douglas V Hall, Microprocessor and Interfacing, TMH, Second Edition. Chapter 2
Lecture 5
ELECTRICAL ELECTRONICS COMMUNICATION INSTRUMENTATION
Segment Registers
1/25/2024 22
ELECTRICAL ELECTRONICS COMMUNICATION INSTRUMENTATION
1
1/25/2024
Stack Segment
The CPU use the stack for temporarily
storing important data. For example the
content of register that will be require
at later stage.
The stack grows down i.e. the data is
pushed onto the stack memory
locations with decreasing address.
When the data is required by CPU in
later stage they will be popped off from
the stack.
Microprocessor System Design 3-23
ELECTRICAL ELECTRONICS COMMUNICATION INSTRUMENTATION
Physical address calculation
• The total addressable memory size is 1Mega Byte memory.
•The complete 1MB memory is divided into 16 logical segments
and each segment contains 64Kbytes of memory.
•While addressing any location in the memory bank the physical
address is calculated from two parts ; the first is segment address
and the second is offset address.
ELECTRICAL ELECTRONICS COMMUNICATION INSTRUMENTATION
2
1/25/2024
8086 Memory Address Space
1/25/2024 25
ELECTRICAL ELECTRONICS COMMUNICATION INSTRUMENTATION
Physical address calculation
• At any given time the 8086 works with only four 64 KB
segments within this 1MB range.
• A 64 KB segment can be located anywhere within the 1 MB
space, but the address will always start at an address with zeros in
the lowest 4 bits.
ELECTRICAL ELECTRONICS COMMUNICATION INSTRUMENTATION
3
1/25/2024
8086 Memory Address Space
1/25/2024 27
ELECTRICAL ELECTRONICS COMMUNICATION INSTRUMENTATION
Physical address calculation
• This constraint was put on the location of segments so that it is
only necessary to store and manipulate 16- bit data .
• The part of the segment starting address that is stored in
segment registers is known as segment base address.
ELECTRICAL ELECTRONICS COMMUNICATION INSTRUMENTATION
4
1/25/2024
Programmer’s model of 8086
3-29
ELECTRICAL ELECTRONICS COMMUNICATION INSTRUMENTATION
Segmentation
Physical address = (<segment> * 16) + <offset>
= Segment address will shift left bitwise 4 times
+ offset address
3-30
ELECTRICAL ELECTRONICS COMMUNICATION INSTRUMENTATION
5
1/25/2024
Default 16-bit segment and offset
address combinations
SEGMENT OFFSET SPECIAL
PURPOSE
CS IP INSTRUCTION
ADDRESS
SS SP (or) BP STACK ADDRESS
DS BX, DI, SI, DATA ADDRESS
an 8-bit number,
16 bit number
ES DI STRING
for string Instructions DESTINATION
ADDRESS
1/25/2024 31
ELECTRICAL ELECTRONICS COMMUNICATION INSTRUMENTATION
Programmer’s Model
1/25/2024 32
ELECTRICAL ELECTRONICS COMMUNICATION INSTRUMENTATION
6
1/25/2024
Segmentation
1/25/2024 33
ELECTRICAL ELECTRONICS COMMUNICATION INSTRUMENTATION
Physical Address
1/25/2024 34
ELECTRICAL ELECTRONICS COMMUNICATION INSTRUMENTATION
7
1/25/2024
Advantage of Segmentation
• Allows the memory capacity to be 1MBytes although the
actual addresses to be handled are of 16-bit size.
• Allow the placing of code, data and stack portions of the
same program in different parts (segments) of memory, for
data and code protection
• Relocation: Permits a program and/or its data to be put into
different areas of memory each time the program is
executed.
• Program - Specify only offset
1/25/2024 35
ELECTRICAL ELECTRONICS COMMUNICATION INSTRUMENTATION
Arithmetic Logic Unit (ALU)
A B F Y
n bits n bits
0 0 0 A+B
0 0 1 A -B
Carry
0 1 0 A -1
Y= 0 ? F 0 1 1 A and B
1 0 0 A or B
A>B?
1 0 1 not A
Y
Signal F control which function will be conducted by ALU.
Signal F is generated according to the current instruction.
Basic arithmetic operations: addition, subtraction,
Basic logic operations: and, or, xor, shifting,
3-36
ELECTRICAL ELECTRONICS COMMUNICATION INSTRUMENTATION
8
1/25/2024
x86 -ISA
8086-80486 Programmer’s Model
BIU
1/25/2024 37
ELECTRICAL ELECTRONICS COMMUNICATION INSTRUMENTATION
Memory Addressing
• Real
- Access only 1MB of memory
- Only 20 Address lines required.
• Protected
- support multitasking
- memory management protection enabled
1/25/2024 38
ELECTRICAL ELECTRONICS COMMUNICATION INSTRUMENTATION
9
1/25/2024
Programmer’s Model BIU
1/25/2024 39
ELECTRICAL ELECTRONICS COMMUNICATION INSTRUMENTATION
Programmer’s Model- MPR
1/25/2024 40
ELECTRICAL ELECTRONICS COMMUNICATION INSTRUMENTATION
10
1/25/2024
End of Lecture 5
1/25/2024 41
ELECTRICAL ELECTRONICS COMMUNICATION INSTRUMENTATION
11