Intro
Memory access in real mode is done using something called segmentation.
The original 8086 processor used mostly 16-bit registers. But a 16-bit register can only represent . So theoretically, the CPU should only have been only be able to access 64 KB of memory instead of 1 MB.
As a solution to this, segmentation was introduced. Instead of using a single address, memory locations were accessed using segment:offset
8086 Segment Registers
The 8086 introduced several special segment registers:
- CS (Code Segment)
- SS (Stack Segment)
- DS (Data Segment)
- ES (Extra Segment)
Calculating Physical Addresses
In real mode, the CPU converts a segment:offset pair into an actual physical memory address using this formula:
For example, suppose:
Code Segment = 0x7c0Offset = 0x0Then the physical address becomes: