Closed flamewing closed 3 years ago
Hm. This definitely seems related to #3; this code also causes the switch error if placed on the same location as the code with $$ labels:
test0:
back:
bra.s forward
test1:
bra.s test2
test3:
bra.s back
test2:
forward:
bra.s back
Note that it only has normal labels. In fact, this code does not cause the switch error if placed in the same location:
.test0:
.back:
bra.s .forward
.test1:
bra.s .test2
.test3:
bra.s .back
.test2:
.forward:
bra.s .back
So it seems composite labels are doing something that prevents the issue altogether!
On further investigation, the switch issue is just a missing check to see if it happens in an unevaluated context. There was a variable .cnt used before the point of the error and no intervening labels, which hid the error; in the end, the switch error is probably not related to issue #3.
There are four kinds of labels in AS:
Normal and composite labels and nameless temporaries work well enough together:
This assembles without error and works as expected. The equivalent for normal labels also works.
Named temporaries and nameless temporaries, however, do not:
This usually gives an error:
But moving it around gave me another error:
The catch is that the code in question is inside a block of code that is disabled:
Might be related to issue #3