6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sun Jun 16, 2024 11:09 am

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Merlin 64 Macros
PostPosted: Tue Jan 25, 2022 11:39 am 
Offline

Joined: Wed Nov 04, 2015 11:10 am
Posts: 51
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.
Code:
* 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?


Top
 Profile  
Reply with quote  
 Post subject: Re: Merlin 64 Macros
PostPosted: Tue Jan 25, 2022 2:17 pm 
Offline
User avatar

Joined: Fri Dec 11, 2009 3:50 pm
Posts: 3366
Location: Ontario, Canada
"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??
Code:
>>> per,HEXEVAL


-- Jeff


Attachments:
PER.png
PER.png [ 95.94 KiB | Viewed 670 times ]

_________________
In 1988 my 65C02 got six new registers and 44 new full-speed instructions!
https://laughtonelectronics.com/Arcana/ ... mmary.html
Top
 Profile  
Reply with quote  
 Post subject: Re: Merlin 64 Macros
PostPosted: Tue Jan 25, 2022 3:02 pm 
Offline

Joined: Sun Nov 08, 2009 1:56 am
Posts: 390
Location: Minnesota
Quote:
>>> per,HEXEVAL


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.


Top
 Profile  
Reply with quote  
 Post subject: Re: Merlin 64 Macros
PostPosted: Thu Feb 17, 2022 5:20 pm 
Offline

Joined: Wed Nov 04, 2015 11:10 am
Posts: 51
Thanks for the explanation.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: Proxy and 19 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: