CPCWiki forum

General Category => Programming => Topic started by: lachlank on 02:56, 28 June 09

Title: WinAPE Macros?
Post by: lachlank on 02:56, 28 June 09
Hi all, is there any way to define a macro like this in WinAPE? (complex parameters)

macro myIFZ truepart falsepart
jp z, @false
truepart
jp @endif
.@false
falsepart
.@endif
endm

ld a, (someAddr)
cp 10
myIFZ {ld a, 6 : call someFn} {ld a, 22 : call someOtherFn}

???

Lachlan
Title: Re: WinAPE Macros?
Post by: Executioner on 09:31, 30 June 09
There's no way to do that because WinAPE treats the ':' character the same as end of line. One possible workaround is to define another macro containing the two instructions since I think you can nest macros. eg.

macro fn1:ld a,6:call someFn:endm
macro fn2:ld a,22:call someOtherFn:endm
myIFZ fn1,fn2