08-02-2022, 12:58 PM
(07-31-2022, 12:27 AM)Nando Wrote: Hi everyone.
I'm trying to create a routine in assembly to copy an image from memory to the screen (a third of the screen, centered)
I know the assembly code to do this.
But, in ZX Basic, afaik, I must include the image from a bin file, and label it (I know how to do that)
So, if I need to use the address of the bin file, in Basic I would use @label (and this works)
But how to I use this label inside an asm routine?
Code:art:
asm
incbin "final.bin"
end asm
pause 0
paper 0: ink 7: border 0: CLS
asm
ld hl,(_art)
ld de,18434
ld bc,2048
ED
LDIR
RET
end asm
It's probably some syntax issue. I need to load HL with the address of the bin file, but get "error: Undefined GLOBAL label '._art'" when compiling
Name mangling has changed. If you compile with
--asmonly the asm will be generated and you can inspect it ;-)
You have to use:
Code:
ld hl, (.LABEL._art)
...
and in general use the prefix .LABEL._ to use BASIC labels from ASM.