Symbols
3-22
(b) Code that uses a local label illegally
Label1:
LD ADDRA, A
SUB ADDRB, A
BC $1, ALT
LD ADDRB, A
B $2
$1
LD ADDRA, A
$2
ADD ADDRC, A
BC $1, ALT
STL A, ADDRC
$1
NOP
Local labels are especially useful in macros. If a macro contains a normal label
and is called more than once, the assembler issues a multiple-definition error.
If you use a local label and .newblock within a macro, however, the local label
is used and reset each time the macro is expanded.
Up to ten local labels can be in effect at one time. After you undefine a local
label, you can define it and use it again. Local labels do not appear in the object
code symbol table.
The maximum label length is shortened to allow for the unique suffix. If the
macro is expanded fewer than 10 times, the maximum label length is 126 char-
acters. If the macro is expanded from 10 to 99 times, the maximum label length
is 125.
Example 3–2 demonstrates the name ? form.
; Load Address A to Accumulator A.
; Subtract Address B.
; If less than zero, branch to $1;
; otherwise, load ADDRB To A
; and Branch to $2.
; $1: Load ADDRA To Accumulator A.
; $2: Add ADDRC.
; If less than 0, branch to $1.
; Store Acc low in ADDRC.
; WRONG: $1 is multiply defined.
Need help?
Do you have a question about the TMS320C54x and is the answer not in the manual?