Ax51 User's Guide

LABEL Assembler Statement

Arguments
symbol 〚:〛 LABELtype
Description

The LABEL statement defines a symbol name for a location in a section. The defined label inherits the attributes of the parent section. It may not be defined outside a section. Label definitions may optionally include a type which specifies the type of access required by the assembler. If no type is specified, the label type is set based on the section (NEAR for Code Sections, BYTE for Data Sections, and BIT for Bit Sections).

typeDescription
NEARThe label receives the NEAR type which implies that it must be defined in a Code Section.
FARThe label receives the FAR type which implies that it must be defined in a Code Section.
BYTEThe label receives the BYTE type which implies that it must be defined in a Code or Data Section.
WORDThe label receives the BYTE type which implies that it must be defined in a Code or Data Section and must start at an even (word) address.
BITThe label receives the BYT type which implies that it must be defined in a Bit Section.

The assembler checks access types for mismatches and generates an error if a problem occurs.

Example
           RSEG    ECODE_SEG1      ; activate an ECODE segment
ENTRY:     LABEL   FAR             ; entry point

           RSEG    ECODE_SEG2      ; activate another ECODE segment
           EJMP    ENTRY           ; jump across 64KB segment