Numeric Labels
A numeric label consists of a single digit in the range zero (0) through nine (9) followed by a colon (:). Numeric labels are used only for local reference and are not included in the object file's symbol table. Numeric labels have limited scope and can be redefined repeatedly.
When a numeric label is used as a reference (as an instruction operand, for example), the suffixes b (“backward”) or f (“forward”) should be added to the numeric label. For numeric label N, the reference Nb refers to the nearest label N defined before the reference, and the referenceNf refers to the nearest label N defined after the reference. The following example illustrates the use of numeric labels:
1: / define numeric label "1"
one: / define symbolic label "one"
/ ... assembler code ...
jmp 1f / jump to first numeric label "1" defined
/ after this instruction
/ (this reference is equivalent to label "two")
jmp 1b / jump to last numeric label "1" defined
/ before this instruction
/ (this reference is equivalent to label "one")
1: / redefine label "1"
two: / define symbolic label "two"
jmp 1b / jump to last numeric label "1" defined
/ before this instruction
/ (this reference is equivalent to label "two")
댓글 없음:
댓글 쓰기