Jump to content

Flat memory model

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Aragorn2 (talk | contribs) at 21:22, 1 February 2004. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

In the flat memory model, a computer application uses at most 2 memory segments, one for the program code and one for data, each of which can be up to 4 gigabytes in size on 32-bit x86-systems, which is sufficient for all but supercomputers. Alternatively, the same segment is used for both code and data, but this is unnecessary since the only area where this may be useful is self-modifying code, which is nowadays considered bad programming style.

The advantage of the flat memory model is that applications do not have to switch segments to access all of their data. However, on the 16-bit 8086 and 80286, it was impractical since this meant that the application could use no more than 64 kilobytes of data.