SPRU513Y August 2001 – June 2022 SM320F28335-EP
When the assembler encounters a substitution symbol, it attempts to substitute the corresponding character string. If that string is also a substitution symbol, the assembler performs substitution again. The assembler continues doing this until it encounters a token that is not a substitution symbol or until it encounters a substitution symbol that it has already encountered during this evaluation.
In the following example, the x is substituted for z; z is substituted for y; and y is substituted for x. The assembler recognizes this as infinite recursion and ceases substitution.
1 .global x
2 .asg "x", z ; declare z and assign z = "x"
3 .asg "z", y ; declare y and assign y = "z"
4 .asg "y", x ; declare x and assign x = "y"
5 000000 FF10 ADD ACC, x
000001 0000!
6