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

Forward references to variables #88

Open
micheldebree opened this issue Jan 13, 2023 · 0 comments
Open

Forward references to variables #88

micheldebree opened this issue Jan 13, 2023 · 0 comments

Comments

@micheldebree
Copy link

A nice-to-have really. I use self-modifying code a lot, like in this contrived example:

!let color = loop + 1

lda #0
sta color

loop:
  lda #0
  sta $d020
  inc color
  jmp loop

I would prefer to write it like this:

lda #0
sta color

loop:
!let color = * + 1
  lda #0
  sta $d020
  inc color
  jmp loop

But that doesn't work because I am referencing color before it is defined.

But only if it doesn't cost much, the above is also workable.

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