I've been using labels like variables, and I was setting a whole big page full of stuff like like "XPOS equ 0" to get empty containers that I could shift values in and out of that are easily user-readable. Obviously this hasn't worked out as I've now realised that 'equ' just makes the label a constant, and is the same value all the time.
I recently discovered the 'ds' directive, but I just want to clarify it does what's needed.
If I set say "XPOS ds 1,3" on initialisation, I'm assuming it'll reserve one byte and load it with the value '3' which can then be changed later on?
For example, if later in the code I want to go:
Code: Select all
ld a,0
ld (XPOS),a
I've based my whole code around this concept for things like sprite width and height etc. so that I can load values for both player and enemies into the same 'draw to screen' code to reuse it. Until now it's worked by sheer fluke as most of the values were set to 'equ 0' by the old way I was doing it. However, I recently started to get some conflicts with the assembler mistaking labels for one another, and I think the code will work if I can just define a label to mean a space where I can lob values in and out of that won't be touched by anything else.
Thanks!
