Address registers and address computation.pdf
number of consecutive bytes
from the beginning of the RAM memory and the beginning of that memory location
<aside> 💡 both basic address and segment’s size have 32 bits value representations
</aside>
pair of a segment selector and an offset = FAR address
if specified only by offset = NEAR address
in hexadecimal an address specification can be written as:

in this case, the selector s3s2s1s0 shows a segment access which has the base address as b7b6b5b4b3b2b1b0 and a limit l7l6l5l4l3l2l1l0
the base and the limit are obtained by the processor after performing a segmentation process
to give access to the specific location, the following condition must be accomplished:

the segmentation address computation will be performed as:

the above output address is named a linear address (or segmentation address)
A concrete example of an address specification is: 8:1000h.
To compute the linear address corresponding to this specification, the processor will do the following:
CHECKS if the segment with the value 8 was defined by the operating system and blocks the access, such a segment wasn’t defined (memory violation error…)EXTRACTS the base address (B) and the segment’s limit (L)
VERIFIES if the offset exceeds the segment’s limit: 1000h > 4000h, if so ⇒ access would be blockedADDS the offset to B and obtains the linear address 3000h (1000h + 2000h)
This kind of addressing is called segmentation and we are talking about the segmented addressing model.
The x86 architecture allows 4 types of segments:
| Notion | Representation | Description |
|---|---|---|
| Address specification, | ||
| logical address, FAR | ||
| address | Selector16:Offset32 | Defines completely both the segment and the offset inside it. |
| Selector | 16 bits | Identifies one of the available segments. As a numeric value it codifies the position of the selected segment descriptor within a descriptor table. |
| Offset, NEAR address | Offset32 | Defines only the offset component (considering that the |
| segment is known or that the flat memory model is used). | ||
| Linear address | ||
| (segmentation address) | 32 bits | Segment beginning + offset, represents the result of the |
| segmentation computing | ||
| Physical effective address | At least 32 bits | Final result of segmentation plus paging eventually. The final address obtained by BIU points to physical memory (hardware). |