SPRUI03E June 2015 – January 2023
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 table1, table2
2
3 00000000 00000028! MVKL table1,A0
4 00000004 00000068! MVKH table1,A0
5 00000008 008031A9 MVK 99, A1
6 0000000c 010848C0 || ZERO A2
7
8 00000010 80000212 $1:[A1] B $1
9 00000014 01003674 STW A2, *A0++
10 00000018 0087E1A0 SUB A1,1,A1
11 0000001c 00004000 NOP 3
12
13 .newblock ; undefine $1
14
15 00000020 00000028! MVKL table2,A0
16 00000024 00000068! MVKH table2,A0
17 00000028 008031A9 MVK 99, A1
18 0000002c 010829C0 || SUB A2,1,A2
19
20 00000030 80000212 $1:[A1] B $1
21 00000034 01003674 STW A2, *A0++
22 00000038 0087E1A0 SUB A1,1,A1
23 0000003c 00004000 NOP 3