Problem with understanding offset register

Status
Not open for further replies.

Lord Loh.

Full Member level 4
Joined
Jun 19, 2004
Messages
196
Helped
1
Reputation
2
Reaction score
0
Trophy points
1,296
Location
Texas
Activity points
1,951
Segment:Offset

In 16 bit machines that have 20 bit address bus, the memory is supposed to have been divided into several segments having offsets of 0 through 65535.

This is supposed to hvae been done to store 20 bit address into two 16 bit registers.

A book that I have says :


The example makes me feel that each segment is of 16 bytes!!! Could the example probably be wrong ?

As per calculations. 20 bit address bus give a maximum addressable locations of 1MB. 16-bit address gives 64Kb.

Therfore there ought to be 16 segments each consisting of 64 Kb.

16 seg * 64Kb = 1024kb

What do I understand this as ?
 

Segment:Offset

In 8086 family processors, the 20-bit physical address equals segment * 16 + offset. The segment is really just a starting point. Yes there are many combinations of segment and offset that point to the same physical address. In later Intel processors, protected mode segments operate very differently.
 

Segment:Offset

What is the reference taken to set the segment? Or is it arbitrary?

Do I understand that the segment 0 starts from 00000h and segment 1 from 10000h and segment 2 from 20000h?

Thank you.
 

Segment:Offset

Start of segment 0 = segment * 16 + offset = 0 * 16 + 0 = 00000h.
Start of segment 1 = segment * 16 + offset = 1 * 16 + 0 = 00010h.
Start of segment 2 = segment * 16 + offset = 2 * 16 + 0 = 00020h.
...
Start of segment 65535 = segment * 16 + offset = 65535 * 16 + 0 = FFFF0h.

End of segment 0 = segment * 16 + offset = 0 * 16 + 65535 = 0FFFFh.
End of segment 1 = segment * 16 + offset = 1 * 16 + 65535 = 1000Fh.
End of segment 2 = segment * 16 + offset = 2 * 16 + 65535 = 1001Fh.
...
End of segment 65535 = segment * 16 + offset = 65535 * 16 + 65535 = 0FFEFh (remember only 20 bits).


Also search Google for more info. For example:
https://thestarman.pcministry.com/asm/debug/Segments.html
 

Segment:Offset

This makes it appeat that there might be as much as 0FFF segments...Have I percived it correctly?

Can there be incomplete segments? So a total of FFFF segments ?
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…