How are anonymous labels addressed?
fredlcore opened this issue · 0 comments
fredlcore commented
I have a problem understanding anonymous labels, at least by the way they are explained here:
https://mads.atari8.info/mads_eng.html#labels_anm
The example says:
@+[1..9] ; forward
@-[1..9] ; backward
@ dex ---- -------
bne @+ | -- |
stx $80 | | |
@ lda #0 | -- |
bne @- --- |
bne @-1 ---------
Assuming that @-
and @+
refer to the (closest) label before or after the reference, and that any optional number refers to the number of labels before or after, I have the following questions:
- Why is
bne @-
referring to the label next to@ dex
and not@ lda #0
- Why is
bne @-
andbne @-1
not the same? - I would assume that
@ dex
is two labels beforebne @-1
, so why is it just-1
and not-2
? - How would I address
@ lda #0
using anonymous labels when calling frombne @-
orbne @-1
?
Thank you!