Memory segmentation divides memory into segments of different sizes to increase execution speed. It allows the Intel 8086 processor to fetch and execute data from memory more easily using segment registers and offset addresses. Each segment register stores the base address of a segment like code, data, stack, or extra. The offset is combined with the base address to generate the effective 20-bit physical address, allowing access to 1MB of memory using only 16-bit segment registers and offsets. Memory segmentation provides benefits like code and data protection, relocation of programs in memory, and accessing more memory than the native address size allows.
4. Segmentation is used to increase the execution
speed of computer system so that processor can able
to fetch and execute the data from memory easily
and fast.
Why we need segmentation
5. •Data bus : 16 lines
•Address bus: 20 lines
•20 lines address lines means that
•2 power 20 =1048576 byte( 1MB=1024 kb)
•lowest address: 00000 H
•Highest address: FFFFF H
•There are total 16 segment (intel provide)
•Each of 64 Kb (simple mathematics right)
•Segment register :16 bit
Memory segmentation
7. Memory
segmentation
16 bit
Code
segment
Hold
instruction
codes of
program.
Means op
code.
Ex: MOV, MVI
etc
Data segment
Hold the data ,
variable and
constant given
in the program.
Ex: MOV
CX,1435H.
Stack
segment
Hold addresses
and data of
subroutine.mic
roprocessor
save the
content of
program on
stack.
Extra
segment
Hold the
destination
addrsess of
some data of
certain string
instruction.
Types of memory
segmentation
9. Each register store the base address (starting address) of
the corresponding segment.
The segment register cannot store 20 bit ,so they only store
upper 16 bit (base address)
Now lower 16 bit (offset address) are fetch from their
corresponding segment pointer
OFFSET: is the displacement of the memory location from
the starting address.
Logical address: base address + offset address
Example : CS:1111 H and corresponding offset register
IP:1232
The base address of the code segment is 11110 H.
Effective address of memory is given by 11110H + 1232H =
How to fetch 20 bit address
11. ADVANTAGES
Allows the placing of
code data and stack
portions of the same
program in different
parts (segments) of
memory, for data
and code protection.
Permits a program
and/ or its data to be
put into different
areas of memory each
time program is
executed, ie, provision
for relocation may be
done.
Allows the memory
capacity to be 1 Mbyte
although the actual
addresses to be handled
are of 16-bit size
Advantages of segmentation
12. Reference : Wikipedia
slide share
easy notes
THANK YOU