## ALP Programming Guide and Reference

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

### LABEL (Associate a Symbolic Name With Current Address)

The LABEL directive defines the following attributes of Name:

Segment: current segment being assembled
Offset: current position within this segment
Type: the operand of the LABEL directive

Syntax

    Name   LABEL   Type - Declaration
       or
    Name :
       or
    Name : :

Remarks

The LABEL directive provides a method of labeling a memory location and assigning it a type without allocating any storage. It can be used to create multiple labels of differing types that are aliases for the same memory location.

The Name entry is an Identifier that is converted to a LabelName according to the value given by Type-Declaration. See the section on label names for more information on the details of this conversion.

The : and :: forms of this directive are used for defining code labels. In this case, the Name entry is converted to a Target-LabelName. The double- colon form of the directive is used when the Name must be visible outside of the procedure block in which it is defined.

Example

To refer to a data area but use a length different from the original definition of that area:

    BARRAY    LABEL      BYTE
    ARRAY     DW         100   DUP ( 0 )
                 .
                 .
                 .
             ADD        AL , BARRAY [ 99 ]     ; ADD   100th   BYTE    TO   AL
             ADD        AX , ARRAY [ 98 ]      ; ADD   50th   WORD    TO   AX

To define multiple entry points within a procedure:

    SUBRT     PROC      FAR
             .
             .
             .
    SUB2      LABEL     FAR     ; Should   have   same   attribute   as   containing   PROC
             .
             .
             .
             RET
    SUBRT     ENDP