Explain Segment Registers, Exams of Microprocessor and Assembly Language Programming

Explanation of Segment Registers Explanation of Segment Registers Explanation of Segment Registers Explanation of Segment Registers Explanation of Segment Registers

Typology: Exams

2017/2018

Uploaded on 10/22/2018

abdulrehman-3
abdulrehman-3 🇵🇰

4 documents

1 / 1

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Segment Registers:
In 80x86 processors, unlike the 8085, has the memory divided into various
sections called as segments. (Note that the following will be valid in 80286
and above for Real mode memory addressing only.)
1. The rst is the code segment where you store the program.
2. Second is data segment where the data is stored.
3. Third is extra segment which is mostly used for string operations.
4. Last one is the stack segment which is used to push/pop (save and
retrieve) your data or used to store addresses for RET when CALL is
executed.
Now these segments are accessed by dierent pointers, no single pointer
can access multiple segments at the same time.
The instruction pointer IP (similar to the program counter in 8085) is
used to fetch the code which holds the oset address and the starting
of the segment address is held by the CS i.e. code segment register.
The DI/BX/SI register holds the oset address of the Data segment
along with the DS i.e. Data segment register holding the starting
address of the data segment.
Similarly the BP/SP has oset address of Stack segment and starting
address is held by SS i.e. stack segment register.
The DI holds the oset address of Extra segment and starting address
is held by SS register.
Each segment has a capacity of 64 KB. These segments can be overlapped
if they don’t need the complete 64 KB space.
It is interesting to note that this so called segmentation gives an essence of
Harvard-like Architecture. The advantage of segmentation is that the
segments can be moved anywhere as per need without aecting anything
since the address is divided into two parts where the code/data is accessed
by the register holding the oset address. This is called as relocation. Since
not all PCs have same memory space, relocation is essential in general
purpose PCs which require relocatable program and data.
P.S. In 80386 processor onward you also nd additional segments viz. FS and
GS. Windows uses these segments for internal operation but no denition of
their usage is available.

Partial preview of the text

Download Explain Segment Registers and more Exams Microprocessor and Assembly Language Programming in PDF only on Docsity!

Segment Registers:

In 80x86 processors, unlike the 8085, has the memory divided into various sections called as segments. (Note that the following will be valid in 80286 and above for Real mode memory addressing only.)

  1. The first is the code segment where you store the program.
  2. Second is data segment where the data is stored.
  3. Third is extra segment which is mostly used for string operations.
  4. Last one is the stack segment which is used to push/pop (save and retrieve) your data or used to store addresses for RET when CALL is executed.

Now these segments are accessed by different pointers, no single pointer can access multiple segments at the same time.

  • The instruction pointer IP (similar to the program counter in 8085) is used to fetch the code which holds the offset address and the starting of the segment address is held by the CS i.e. code segment register.
  • The DI/BX/SI register holds the offset address of the Data segment along with the DS i.e. Data segment register holding the starting address of the data segment.
  • Similarly the BP/SP has offset address of Stack segment and starting address is held by SS i.e. stack segment register.
  • The DI holds the offset address of Extra segment and starting address is held by SS register.

Each segment has a capacity of 64 KB. These segments can be overlapped if they don’t need the complete 64 KB space.

It is interesting to note that this so called segmentation gives an essence of Harvard-like Architecture. The advantage of segmentation is that the segments can be moved anywhere as per need without affecting anything since the address is divided into two parts where the code/data is accessed by the register holding the offset address. This is called as relocation. Since not all PCs have same memory space, relocation is essential in general purpose PCs which require relocatable program and data.

P.S. In 80386 processor onward you also find additional segments viz. FS and GS. Windows uses these segments for internal operation but no definition of their usage is available.