Right now I'm trying to convert some source code to ASM6. I'm having problems trying to figure out a macro in ASM6 that will work and mesh in properly with the code without having to rewrite a good portion of it. Which i don't want to do without causing it not to run.
The simple macros I know. Such as;
MACRO NAME
code....
ENDM
MACRO setAXY x,y,z
LDA #x
LDX #y
LDY #z
ENDM
I wonder if there are any other configurations? The source code that I'm dealing with is from the old PDS 6502 assembler with different macro syntax and supports some "expressions" or operators specifically for macros.
What this does is pretty obvious but what makes it different is the @ character. That means which operand is going to be used. You can have 1-9 of them and there are a few in this code that use many.
For example.
EXAMPLE $2000,4*4,$85 ; from code.
MACRO EXAMPLE
LDA #>@1
STA $2006
LDA #<@1
STA $2006
LDA #@2
STA $2007
LDA #@3
STA $2007
ENDM
Is there a way to do this in ASM6? That is what I want to know.
EDIT: I think I just figured it out. I'll keep you posted.
The simple macros I know. Such as;
MACRO NAME
code....
ENDM
MACRO setAXY x,y,z
LDA #x
LDX #y
LDY #z
ENDM
I wonder if there are any other configurations? The source code that I'm dealing with is from the old PDS 6502 assembler with different macro syntax and supports some "expressions" or operators specifically for macros.
Code:
VRSET $2000 ; called macro in code
MACRO VRSET
LDA #>@1
STA $2006
LDA #<@1
STA $2006
ENDM
MACRO VRSET
LDA #>@1
STA $2006
LDA #<@1
STA $2006
ENDM
What this does is pretty obvious but what makes it different is the @ character. That means which operand is going to be used. You can have 1-9 of them and there are a few in this code that use many.
For example.
Code:
EXAMPLE $2000,4*4,$85 ; from code.
MACRO EXAMPLE
LDA #>@1
STA $2006
LDA #<@1
STA $2006
LDA #@2
STA $2007
LDA #@3
STA $2007
ENDM
Is there a way to do this in ASM6? That is what I want to know.
EDIT: I think I just figured it out. I'll keep you posted.