SLAU131Y October 2004 – June 2021
Terminate Local Symbol Block
.newblock
The .newblock directive undefines any local labels currently defined. Local labels, by nature, are temporary; the .newblock directive resets them and terminates their scope.
A local label is a label in the form $n, where n is a single decimal digit, or name?, where name is a legal symbol name. Unlike other labels, local labels are intended to be used locally, and cannot be used in expressions. They can be used only as operands in 8-bit jump instructions. Local labels are not included in the symbol table.
After a local label has been defined and (perhaps) used, you should use the .newblock directive to reset it. The .text, .data, and .sect directives also reset local labels. Local labels that are defined within an include file are not valid outside of the include file.
See Section 5.9.3 for more information on the use of local labels.
This example shows how the local label $1 is declared, reset, and then declared again.
1 .global ADDRA,ADDRB,ADDRC
2
3 0000 403B Label1: MOV #ADDRA, R11 ; Load Address A to R11
0002 0000!
4 0004 803B SUB #ADDRB, R11 ; Subtract Address B.
0006 0000!
5 0008 3803 JL $1 ; If < 0, branch to $1
6 000a 403B MOV #ADDRB, R11 ; otherwise, load ADDRB to R11
000c 0000!
7 000e 3C02 JMP $2 ; and branch to $2
8 0010 403B $1 MOV #ADDRA, R11 ; $1: load ADDRA to AC0.
0012 0000!
9 0014 503B $2 ADD #ADDRC, R11 ; $2: add ADDRC.
0016 0000!
10 .newblock ; Undefine $1 so can be used again.
11 0018 3C02 JMP $1 ; If less than zero, branch to $1.
12 001a 4B82 MOV R11,&ADDRC ; Store AC0 low in ADDRC.
001c 0000!
13 001e 4303 $1 NOP