You are on page 1of 22

Lecture # 3

Microprocessor Based
Systems
Topics to Cover:

 Software Model of The 8088/8086 µP


 Memory and I/O Space
 Registers: Segment Registers & Memory
Segmentation
 Generating a Physical Memory Address
 Example with Instruction Pointer
Software Model of
8088/8086 µP
In order to program µP, one have
to consider the processor view
as shown in fig:
 Remember our aim is to understand
the microprocessor operation from
a software point of view.
 For this, one does not need to know
all of its hardware architectural
features i.e. the functions,
interconnection and operation of the
internal circuits of microprocessors
may not need to consider at this
stage.
Software Model of
8088/8086 µP
Important to the Programmer:
 Registers: Various Registers within
the Device. Their Purpose,
Functions,Operating capabilities
and Limitations.
 Memory & I/O: Furthermore, it is
essential that the programmer know
how External Memory and
Input/Output Peripherals are
organized.
Software Model of
8088/8086 µP
Important to the Programmer:

 Combination of Registers &


Memory + I/O:
How information is arranged in
registers, memory and input/output.
And how memory and I/O are
addressed to obtain instructions and
data.
Software Model of
8088/8086 µP
 Internally, it contains Registers. All
the abbreviations in the figure are
actually the name of registers.
 Each Register is of 16-bit as
8086/8088 is of 16-bit.
 No of Registers: 13 + SR = 14

Registers names are:


Memory and I/O Space
Memory and I/O Space
Input/Output Address Space:
Software Model of 8088/8086
with Memory & I/O
Registers: Segment Registers &
Memory Segmentation
 Memory Segmentation:
 Although 8086/8088 µP can access
up to 1MByte of Memory. Not all
this memory is active at a time
due to lack of resources.
 Actually, 1 MByte of memory is
partitioned into 64K Segments.
Why??
 For the time being, remember
each register is of 16-bit, so one
can get maximum value of 2^16=
65536 = 64K.
 Only four of these 64K segments
are active at a time.
Registers: Segment Registers &
Memory Segmentation
 Memory Segmentation:
 Partitioned into 64K Segments.
 Only 4 Segments out of all
64K Segments will be active.

 Why?? Answer is:


 Segment Registers:
 Four Segment Register:
CS, DS, SS, ES
Segment Registers and
Memory Segmentation
 Code
Data Segment:
Stack
Extra Segment:
Segment:
Segment:
Stores
Stores
Also forInstructions
Program
Temporary
Data Data.
i.e. Codes
Storage.
Information
like Push, Pop, Jump, Call etc.  Actually, data
code
stores in the
memory.
 Data
Code Segment
Segment
Register contains
the Base
Address i.e.
Starting Address
on which the
instructions
data started to
started to enter.
enter.
Generating a Physical memory
Address
Generating a Physical
Memory Address

 Code Segment: Instruction Pointer


 Data Segment: Source/Destination
Index
 Stack Segment: Stack/Base Pointer
 Extra Segment: Like Data Segment
Generating a Physical memory
Address
Generating a Physical memory
Address
Generating a Physical memory
Address
Code Segment : Instruction
Pointer
Code Segment : Instruction Pointer

16 Bit
Address
in
Segment
Registers
20 Bit
Address
Bus
Code Segment : Instruction
Pointer
Code Segment : Instruction Pointer

Offset Address
Physical
Address

20 Bit
Base Address Address
Bus
Code Segment : Instruction
Pointer
CS: IP = 0000:0001

0001

0000

Base Address: 0000 B.Add: 0000(0)


Offset Address: 0001 Off. Add:+ 0001
Phy. Add:= 00001
Code Segment : Instruction
Pointer
Code Segment : Instruction Pointer

0003

0000

Base Address: 0000 B.Add: 0000(0)


Offset Address: 0001 Off. Add:+ 0003
Phy. Add:= 00003
Code Segment : Instruction
Pointer
CS:IP = 0000:FFFF

FFFF

0000

Base Address: 0000 B.Add: 0000(0)


Offset Address: 0001 Off. Add:+ FFFF
Phy. Add:= 0FFFF

You might also like