SPRU513Y August 2001 – June 2022 SM320F28335-EP
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 .ref ADDRA, ADDRB, ADDRC
2 0076 B .set 76h
3
4 00000000 F800! MOV DP, #ADDRA
5
6 00000001 8500! LABEL1: MOV ACC, @ADDRA
7 00000002 1976 SUB ACC, #B
8 00000003 6403 B $1, LT
9 00000004 9600! MOV @ADDRB, ACC
10 00000005 6F02 B $2, UNC
11
12 00000006 8500! $1 MOV ACC, @ADDRA
13 00000007 8100! $2 ADD ACC, @ADDRC
14 .newblock ; Undefine $1 to use again.
15
16 00000008 6402 B $1, LT
17 00000009 9600! MOV @ADDRC, ACC
18 0000000a 7700 $1 NOP