## ALP Programming Guide and Reference

[prev][next][parent][TOC]

### .CODE (Opens Default or Named Code Segment)

Closes the currently opened segment (if any) and opens the default code segment or a segment with the name given by an optional SegmentName parameter. The .CODE directive may only be used if previous .MODEL directive has been processed.

Syntax

    . CODE   [ SegmentName ]

Remarks

When the SegmentName parameter is omitted from the .CODE directive, the assembler generates a default code segment whose name is determined by the memory model as follows:

Memory Model Value for @code
TINY _TEXT
SMALL _TEXT
MEDIUM module_TEXT
COMPACT_TEXT
LARGE module_TEXT
HUGE module_TEXT
FLAT CODE32

The module entry is replaced with base file name of the top-level module being assembled.

When operating in M510 mode, the SegmentName parameter may only be specified for those memory models that allow multiple code segments (MEDIUM , LARGE, and HUGE), and the value of the @code symbol is not altered from the default. For other modes of operation, the SegmentName parameter is allowed for any model other than TINY, and the @code symbol is updated to reflect the SegmentName value.