3.3 Real Mode
Physical Address Space
Byte at Address OxFFFFE
Byte at Address OxFFFFD
Byte at Address OxFFFFC
Byte at Address OxFFFFB
I
Byte at Address 0x20003
Byte at Address 0x20002
Byte at Address 0x20001
Byte at Address 0x20000
Byte at Address 0x00002
Byte at Address 0x00001
Byte at Address 0x00000
Figure 3.4
Right about now, you may be asking yourself: How can the sum of two 16-bit
values possibly address all of the bytes in a 20-bit address space?
The trick is that the segment address has an implicit zero added to the end.
For example, a segment address of 0x2000 is treated by the processor as
0x20000. This is denoted, in practice, by placing the implied zero in brackets
(i.e., 0x2000 [0]). The resulting sum of the segment address and the offset
address is 20 bits in size, allowing the processor to access 1 MB of physical
memory.
Segment Selector 0x2000 —> 0x2000[0] —> 0x20000
+Effective Address 0x0002 —> 0x0002 —v 0x00002
Physical Address 0x20002
Because a real-mode effective address is limited to 16 bits, segments can be
at most 64 KB in size. In addition, there is absolutely no memory protection
afforded by this scheme. Nothing prevents a user application from modifying
the underlying operating system.
Memory Segment
->
Logical Address
-
Byte Offset = 0x0002
16-bit Offset
16-bit Selector
Base Address 0x2000 [0]
Parti I 61