c64jasm icon indicating copy to clipboard operation
c64jasm copied to clipboard

Forward references to variables

Open micheldebree opened this issue 2 years ago • 0 comments

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.

micheldebree avatar Jan 13 '23 09:01 micheldebree