Chapter 0 Default Segment Names

If you use simplified segment directives by themselves, you do not need to know the names assigned for each segment. However, it is possible to mix full segment definitions with simplified segment directives, in which case you need to know the segment names.

Table 0.1 shows the default segment names created by each directive.

If you use .MODEL, a _TEXT segment is always defined, even if all .CODE directives specify a name. The default segment name used as part of far-code segment names is the filename of the module. The default name associated with the .CODE directive can be overridden, as can the default names for .FARDATA and .FARDATA?.

The segment and group table at the end of listings always shows the actual segment names. However, the GROUP and ASSUME statements generated by the .MODEL directive are not shown in listing files. For a program that uses all possible segments, group statements equivalent to the following would be generated:

DGROUP GROUP _DATA, CONST, _BSS, STACK

For the tiny model, these ASSUME statements would be generated:

ASSUME cs:DGROUP, ds:DGROUP, ss:DGROUP

For small and compact models with NEARSTACK, these ASSUME statements would be generated:

ASSUME cs: _TEXT, ds:DGROUP, ss:DGROUP

For medium, large, and huge models with NEARSTACK, these ASSUME statements would be generated:

ASSUME cs:name_TEXT, ds:DGROUP, ss:DGROUP

Table 0.1 Default Segments and Types for Standard Memory Models

Model Directive Name Align Combine Class Group

Tiny .CODE _TEXT WORD PUBLIC, 'CODE' DGROUP  
  .FARDATA FAR_DATA PARA PRIVATE, 'FAR_DATA',    
  .FARDATA? FAR_BSS PARA PRIVATE, 'FAR_BSS',    
  .DATA _DATA WORD PUBLIC, 'DATA' DGROUP  
  .CONST CONST WORD PUBLIC, 'CONST' DGROUP  
  .DATA? _BSS WORD PUBLIC, 'BSS' DGROUP  

Small .CODE _TEXT WORD PUBLIC, 'CODE',    
  .FARDATA FAR_DATA PARA PRIVATE, 'FAR_DATA',    
  .FARDATA? FAR_BSS PARA PRIVATE, 'FAR_BSS',    
  .DATA _DATA WORD PUBLIC, 'DATA' DGROUP  
  .CONST CONST WORD PUBLIC, 'CONST' DGROUP  
  .DATA? _BSS WORD PUBLIC, 'BSS' DGROUP  
  .STACK STACK PARA STACK, 'STACK' DGROUP*  

Medium .CODE name_TEXT WORD PUBLIC, 'CODE',    
  .FARDATA FAR_DATA PARA PRIVATE, 'FAR_DATA',    
  .FARDATA? FAR_BSS PARA PRIVATE 'FAR_BSS',  
  .DATA _DATA WORD PUBLIC, 'DATA' DGROUP  
  .CONST CONST WORD PUBLIC, 'CONST' DGROUP  
  .DATA? _BSS WORD PUBLIC, 'BSS' DGROUP  
  .STACK STACK PARA STACK, 'STACK' DGROUP*  

Compact .CODE _TEXT WORD PUBLIC, 'CODE',    
  .FARDATA FAR_DATA PARA PRIVATE 'FAR_DATA',  
  .FARDATA? FAR_BSS PARA PRIVATE, 'FAR_BSS',    
  .DATA _DATA WORD PUBLIC, 'DATA' DGROUP  
  .CONST CONST WORD PUBLIC, 'CONST' DGROUP  
  .DATA? _BSS WORD PUBLIC, 'BSS' DGROUP  
  .STACK STACK PARA STACK, 'STACK' DGROUP*  
Large or huge .CODE name_TEXT WORD, PUBLIC 'CODE',    
  .FARDATA FAR_DATA PARA PRIVATE, 'FAR_DATA',    
  .FARDATA? FAR_BSS PARA PRIVATE, 'FAR_BSS',    
  .DATA _DATA WORD PUBLIC, 'DATA' DGROUP  
  .CONST CONST WORD PUBLIC, 'CONST' DGROUP  
  .DATA? _BSS WORD PUBLIC, 'BSS' DGROUP  
  .STACK STACK PARA STACK, 'STACK' DGROUP*  

Flat .CODE _TEXT DWORD PUBLIC 'CODE',  
  .FARDATA _DATA DWORD PUBLIC, 'DATA',    
  .FARDATA? _BSS DWORD PUBLIC, 'BSS',    
  .DATA _DATA DWORD PUBLIC, 'DATA',    
  .CONST CONST DWORD PUBLIC, 'CONST',    
  .DATA? _BSS DWORD PUBLIC, 'BSS',    
  .STACK STACK DWORD PUBLIC 'STACK',  

* unless the stack type is FARSTACK