New answers tagged

42

No, it didn't. MS-DOS never bothered to zero out allocated memory, as there was no security reason to do so like there is in a multi-user operating system. It was up to the C runtime startup code to zero out the BSS segment. For example, from the Borland C++ 3.1 startup code: ; Reset uninitialized data area xor ax, ax ...


4

Before "protected memory," all bytes were basically the same as far as the CPU was concerned. The segment registers are a lot like "bank selectors" that you'd see in other segmented memory schemes, except that they overlapped every 16 bytes. So, if you needed to use 128KB of RAM for a game data file, you would just change the DS register between two or more ...


4

As already discussed, the 8086's memory addressing is a little... weird. The hardware addressing was 20-bit and bytewise, which gives you the 220 addressable bytes (1 MiB). To the software side, this was exposed as a segment (later, when the 80286 introduced protected mode, renamed a selector, but by default in real mode selectors were set up to work ...


7

The 8086 has 20 address pins so can access 1 MB of memory.  To be clear, the 20 bit address space is linear, and the memory subsystem doesn't know about segmentation or segment registers — it just sees the 20 address pins. The values put on the 20 address pins are generated by segment register * 16 + offset, where offset comes from a regular ...


9

Segment registers can be changed, thus allowing access to full address space. In addition to doing this ad hoc, there are different ways to model this, called memory models: small: code and data both reside in one segment, all code and data pointers are 16bit medium: single data segment, multiple code segments (code pointers 32bit) compact: single code ...


2

8086 assemblers and compilers supported different memory models where a program could have one or more code segments combined with one or more data segments. For example, a small model program would have one code segment (cs) and one data segment (ds/es). A large model program would have multiple code segments (cs, using a far jump), multiple data segments ...


Top 50 recent answers are included