Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How are anonymous labels addressed? #36

Open
fredlcore opened this issue Jan 22, 2024 · 0 comments
Open

How are anonymous labels addressed? #36

fredlcore opened this issue Jan 22, 2024 · 0 comments

Comments

@fredlcore
Copy link

fredlcore commented Jan 22, 2024

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant