Content deleted Content added
→Real mode: OMG, turns out, per en.wikipedia.org/w/index.php?title=X86_memory_segmentation&diff=prev&oldid=441344024 the 1 byte was NOT a typo. So that's where Joh got it from? I CAN actually understand what OR made the OP think 1 byte, but that's not a real (mode) segment size, it's sectionable! Just bc you're not USING all 16 bytes doesn't mean the segment wasn't 16 bytes. If every "1-byte segment" MUST be followed by a 15-byte gap before the next starts, THAT'S ACTUALLY A 16-BYTE SEGMENT! |
→Real mode: It still wasn't quite clear, I feel. Also, stepping on memory is possible within the same segment (be it the technically maximum size of 64K or smaller) AND by involving any other segment. |
||
Line 35:
Because of the way the segment address and offset are added, a single linear address can be mapped to up to 2<sup>12</sup> = 4096 distinct segment:offset pairs. For example, the linear address 08124h can have the segmented addresses 06EFh:1234h, 0812h:0004h, 0000h:8124h, etc.
This could be confusing to programmers accustomed to unique addressing schemes, but it can also be used to advantage, for example when addressing multiple nested data structures. While real mode segments are ''technically'' always 64 [[Kilobyte|KB]] long, the practical effect is only that no segment can be ''longer'' than 64 KB, rather than that every segment as actually used in a program ''must'' be treated as 64 KB long – dealing with effectively smaller segments is possible. Because there is no protection or privilege limitation in real mode
(The leading zeros of the linear address, segmented addresses, and the segment and offset fields are shown here for clarity. They are usually omitted.)
|