I am new to Merlin and would like to use it to modify Jamaica Mon. I ran into something I don't see in the manual and was looking for help. Here's a snippet of code from the PEEK+POKE+WAIT that I don't understand.
* Init IEVAL vector
LDA $F7E5
CMP #$91 ;Check for PPP
BNE :SKIP
LDA $030A ;Old IEVAL
STA $0334
LDA $030B
STA $0335
:SKIP
>>> per,HEXEVAL
PLA
STA $030A
PLA
STA $030B
In the macro call there's a per,HEXEVAL. My question is what is "per"? I believe the HEXEVAL is the name of the macro, which is found later in the code, and if so, isn't the macro supposed to be defined before it is used? Or is that what "per" is for?
"Jamaica Mon" -- is that something for the 65816? The '816 has an instruction called PER. Maybe the author of the code is trying to do something similar...? I admit I'm guessing, but maybe the suggestion will be helpful. I don't understand what the >>> is supposed to do. It's not a comment delimiter, is it??
The '>>>' is one way to invoke a macro in Merlin assemblers.
I don't know what this is trying to do, but IIRC the name of the macro is 'per' and 'HEXVAL' is a parameter which replaces every ']1' in the macro definition when it is expanded.
If I'm right, then 'HEXVAL' isn't a macro itself but a constant value. It doesn't matter that it's defined after the macro is invoked. The assembler will note the value is undefined when first encountered and fix it up on a later pass, after the value is known.