Previous Subpost
Hello world!
An introduction to the segmentation memory model used in x86 protected mode, how it works, and how to set it up.
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
The 8086 introduced several special segment registers:
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: