x86 memory models

In computing, the x86 memory models are a set of six different memory models of the x86 CPU operating in real mode which control how the segment registers are used and the default size of pointers.

In real mode, in order to calculate the physical address of a byte of memory, the hardware shifts the contents of the appropriate segment register 4 bits left (effectively multiplying by 16), and then adds the offset.

The memory models are: In protected mode a segment cannot be both writable and executable.

It is possible to use segmentation in 32-bit protected mode as well (resulting in 48-bit pointers) and there exist C language compilers which support that.

[citation needed] On the x86-64 platform, a total of seven memory models exist,[7] as the majority of symbol references are only 32 bits wide, and if the addresses are known at link time (as opposed to position-independent code).