| UMBC CMSC 211 |
| size | Code Segments | Data Segments |
|---|---|---|
| SMALL | one (near calls) | one (near pointers) |
| COMPACT | one (near calls) | multiple (far pointers) |
| MEDIUM | multiple (far calls) | one (near pointers) |
| LARGE | multiple (far calls) | multiple (far pointers) |
When there are multiple code segments, the PROCs are to return with ar far ret instruction, and should be referenced in other files as EXTRN Label : FAR.
As a general rule, if you are combining assembly programs with high-level languages, you should use the saem model in assembly as the high-level language, where the model is much more important!
In order to allow a true small mode program, the assemblers automatically group .DATA and .STACK segments into a single segment. Since the stack data must come as the end of the program, the segments always occur in the order PSP, .CODE, .DATA and stack.