tebe6502/Mad-Assembler

How are anonymous labels addressed?

Opened this issue · 0 comments

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:

  1. Why is bne @- referring to the label next to @ dex and not @ lda #0
  2. Why is bne @- and bne @-1 not the same?
  3. I would assume that @ dex is two labels before bne @-1, so why is it just -1 and not -2?
  4. How would I address @ lda #0 using anonymous labels when calling from bne @- or bne @-1?

Thank you!