Address registers and address computation.pdf

💡Recall

🖋 Notes

Address registers and address computation

Address of a memory location

Memory Segment (”a street”)

<aside> 💡 both basic address and segment’s size have 32 bits value representations

</aside>

Segment Selector

Offset

Address Specification

Example

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:

  1. 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…)
  2. EXTRACTS the base address (B) and the segment’s limit (L)
  3. VERIFIES if the offset exceeds the segment’s limit: 1000h > 4000h, if so ⇒ access would be blocked
  4. ADDS 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.

Segments

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).