Sat 17 Jan 2015 11:44:28 PM UTC, original submission:
I'm trying to use a macro with multiple arguments but can't get it to work. I'm using Z80 assembler version 1.8 on Debian Jessie for amd64 (the version from the repositories).
The example macro.asm with 1 argument works but when i try 2 or more I get this:
% z80asm macro.asm
macro.asm:1: error: empty macro argument
and the program hangs until memory is exhausted. The source code for macro.asm is this:
locate: macro xpos, ypos
push hl
ld hl,(xpos+1)*256+ypos+1
ld (0f3dch),hl
pop hl
endm
org 0c000h
locate 10, 10
ret
I'm not sure if macro arguments should have comma's (they should according the documentation) but when i leave them out the error message goes away, detection of multiple arguments works but only 1 is recognized. This is the ouput when i don't use comma's to seperate arguments anywhere.
% z80asm macro.asm
macro.asm:11: error: unable to resolve reference: (s+1)*256+10+1
Maybe the macro example could have more arguments as an example of how to use them with more macro's?
I've tried another example which i saw online but that also didn't work:
% cat m2.asm
callf: macro slot, address rst 030h db slot dw address endm
org 0c000h
callf 08bh, 04000h
% z80asm m2.asm
m2.asm:1: error: empty macro argument
although this doesn't take up all memory but exits cleanly after the error.
|