Skip to main content
edited body
Source Link
Davislor
  • 9k
  • 1
  • 29
  • 35

First, a brief explanation of how the 8086 architecture worked. It was a 16-bit CPU that could only address memory in chunks called segments. Each segment was 65,536 bytes in size, because that was the number of bytes 16 bits could address. A program could use four segment registers at a time, SS (stack), CS (code), DS (Datadata), and ES (extra). A 16-bit pointer within one of these segments was a near pointer. Originally, these segments could start at any 16-byte “paragraph” of the one-megabyte “conventional memory,” so a far pointer needed 32 bits to hold a 20-bit addres. Later machines added the ability to switch between segments of “expanded” or “extended” memory, to protect memory as not writable or not executable, as well as adding two more segment registers, FS (doesn’t stand for) and GS (anything).

This existed for historical reasons. Intel had based its 8086 on an earlier CPU, the Intel 8080. The 8080 only supported 64K of memory and 16-bit addresses, without segments. There were a lot of programs written for it, and in particular, the circumstances of MS-DOS’ creation (a fascinating story which anyone reading this far down the page on a retrocomputing site already has heard some version of) meant that MS-DOS 1.0 supported a .COM format for executables based on CP/M for the 80888080. The primary use of the Tiny model was that a program that used it could be compiled to a smaller .COM executable, rather than the .EXE format.

First, a brief explanation of how the 8086 architecture worked. It was a 16-bit CPU that could only address memory in chunks called segments. Each segment was 65,536 bytes in size, because that was the number of bytes 16 bits could address. A program could use four segment registers at a time, SS (stack), CS (code), DS (Data), and ES (extra). A 16-bit pointer within one of these segments was a near pointer. Originally, these segments could start at any 16-byte “paragraph” of the one-megabyte “conventional memory,” so a far pointer needed 32 bits to hold a 20-bit addres. Later machines added the ability to switch between segments of “expanded” or “extended” memory, to protect memory as not writable or not executable, as well as adding two more segment registers, FS (doesn’t stand for) and GS (anything).

This existed for historical reasons. Intel had based its 8086 on an earlier CPU, the Intel 8080. The 8080 only supported 64K of memory and 16-bit addresses, without segments. There were a lot of programs written for it, and in particular, the circumstances of MS-DOS’ creation (a fascinating story which anyone reading this far down the page on a retrocomputing site already has heard some version of) meant that MS-DOS 1.0 supported a .COM format for executables based on CP/M for the 8088. The primary use of the Tiny model was that a program that used it could be compiled to a smaller .COM executable, rather than the .EXE format.

First, a brief explanation of how the 8086 architecture worked. It was a 16-bit CPU that could only address memory in chunks called segments. Each segment was 65,536 bytes in size, because that was the number of bytes 16 bits could address. A program could use four segment registers at a time, SS (stack), CS (code), DS (data), and ES (extra). A 16-bit pointer within one of these segments was a near pointer. Originally, these segments could start at any 16-byte “paragraph” of the one-megabyte “conventional memory,” so a far pointer needed 32 bits to hold a 20-bit addres. Later machines added the ability to switch between segments of “expanded” or “extended” memory, to protect memory as not writable or not executable, as well as adding two more segment registers, FS (doesn’t stand for) and GS (anything).

This existed for historical reasons. Intel had based its 8086 on an earlier CPU, the Intel 8080. The 8080 only supported 64K of memory and 16-bit addresses, without segments. There were a lot of programs written for it, and in particular, the circumstances of MS-DOS’ creation (a fascinating story which anyone reading this far down the page on a retrocomputing site already has heard some version of) meant that MS-DOS 1.0 supported a .COM format for executables based on CP/M for the 8080. The primary use of the Tiny model was that a program that used it could be compiled to a smaller .COM executable, rather than the .EXE format.

added 223 characters in body
Source Link
Davislor
  • 9k
  • 1
  • 29
  • 35

The memory models were defined by compilers for high-level languages, and were reasonably standard between Microsoft, Borland and Watcom. The Small, Medium, Compact and Large models appear to have originated with an Intel compiler from 1980.

The memory models were defined by compilers for high-level languages, and were reasonably standard between Microsoft, Borland and Watcom.

The memory models were defined by compilers for high-level languages, and were reasonably standard between Microsoft, Borland and Watcom. The Small, Medium, Compact and Large models appear to have originated with an Intel compiler from 1980.

added 101 characters in body
Source Link
Davislor
  • 9k
  • 1
  • 29
  • 35

A program using a larger model might still be able to use near pointers locally, or place a family of functions into the same segment group where they could call each other with near calls. One with a smaller memory model might have a few far functions outside the main code segment, or only a few pieces of far data, and fit the rest under the 64K limit.

There were a few other memory models as well.

There were a few other memory models as well.

A program using a larger model might still be able to use near pointers locally, or place a family of functions into the same segment group where they could call each other with near calls. One with a smaller memory model might have a few far functions outside the main code segment, or only a few pieces of far data, and fit the rest under the 64K limit.

There were a few other memory models as well.

added 101 characters in body
Source Link
Davislor
  • 9k
  • 1
  • 29
  • 35
Loading
added 407 characters in body
Source Link
Davislor
  • 9k
  • 1
  • 29
  • 35
Loading
deleted 3 characters in body
Source Link
Davislor
  • 9k
  • 1
  • 29
  • 35
Loading
edited body
Source Link
Davislor
  • 9k
  • 1
  • 29
  • 35
Loading
added 189 characters in body
Source Link
Davislor
  • 9k
  • 1
  • 29
  • 35
Loading
Source Link
Davislor
  • 9k
  • 1
  • 29
  • 35
Loading