Assembly Language Help (alang.hlp) (
Table of Contents;
Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software,
purely for historical purposes.
If you're looking for up-to-date documentation, particularly for programming,
you should not rely on the information found here, as it will be woefully
out of date.
Define Segment
◄Example► ◄Up► ◄Contents► ◄Index► ◄Back►
────────────────────────────────────────────────────────────────────────────
Syntax: name SEGMENT [align] [READONLY] [combine] [use] ['class']
statements
name ENDS
See also: ENDS, ASSUME, GROUP, ALIGN, EVEN, .386, .DOSSEG, .MODEL,
@CurSeg, OPTION READONLY, OPTION SEGMENT
Description:
Defines a program segment called <SegName> with optional segment
attributes: align, READONLY, combine, use, and class. These
attributes give the linker and assembler information on how to set
up, combine, and refer to segments. A segment can be reopened within
a module by specifying the same <name> in a later SEGMENT statement.
The SEGMENT directive automatically saves any segment definition
that is already in effect. When the assembler encounters a closing
ENDS, it restores the saved segment definition.
Parameter Description
name Name of the segment being defined. You can use the
@CurSeg macro function with the ENDS directive to
terminate the current segment.
align BYTE, WORD (2 bytes), DWORD (4), PARA (16), or PAGE
(256). Aligns segment to boundary. PARA is the
default.
combine PRIVATE, PUBLIC, STACK, COMMON, MEMORY, or AT
address. Defines how the linker combines segments.
PRIVATE is the default.
use USE16, USE32, or FLAT. Selects the segment word size.
See: ◄OPTION SEGMENT►
READONLY Makes segment read-only. The assembler will generate
an error if an instruction explicitly modifies a
segment marked with the READONLY attribute. Useful
for protected-mode code segments and segments in ROM.
class A class name (such as CODE or DATA). Must be enclosed
in quotation marks. Used to associate segments with
different names and to control segment order. Code
segments should have class 'CODE'.
-♦-