Macro Paramters

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Macro Paramters

Jump to solution
1,348 Views
admin
Specialist II
Can anyone help in Codewarrior macro paramters?

This is the Macro definition from the Avocet Assembler:

EEBYTES MACRO SYMBOLNM,SYMSIZE

SYMBOLNM EQU EECOUNTR
XDEF SYMBOLNM

EECOUNTR SET EECOUNTR+SYMSIZE

ENDM

I tried translating into Codewarrior assembly like this:

EEBYTES MACRO ;SYMBOLNM,SYMSIZE

\1 EQU \3
XDEF \1

\3 SET (\3+\2)

ENDM

However I come up with several errors. Anyone's help will be greatly appreciated
Labels (1)
Tags (1)
0 Kudos
1 Solution
486 Views
bigmac
Specialist III
Hello,
 
Your macro seems to assemble as intended, with some attention to layout detail.  You do not identify the error messages that occurred, but primarily, the XDEF and ENDM directives must commence at other than the first column (the place where labels commence).  Additionally, the third parameter (EECOUNTR) must have previously been defined using the SET directive, so that it may be re-defined within the macro.
 
EEBYTES: MACRO ; SYMBOLNM,SYMSIZE
\1:      EQU   \3
         XDEF  \1
\3:      SET   (\3+\2)
         ENDM
 
Whether the colon after each label is present, or not, shouldn't affect the assembly process.
 
Regards,
Mac

Message Edited by bigmac on 2006-11-0402:35 PM

View solution in original post

0 Kudos
1 Reply
487 Views
bigmac
Specialist III
Hello,
 
Your macro seems to assemble as intended, with some attention to layout detail.  You do not identify the error messages that occurred, but primarily, the XDEF and ENDM directives must commence at other than the first column (the place where labels commence).  Additionally, the third parameter (EECOUNTR) must have previously been defined using the SET directive, so that it may be re-defined within the macro.
 
EEBYTES: MACRO ; SYMBOLNM,SYMSIZE
\1:      EQU   \3
         XDEF  \1
\3:      SET   (\3+\2)
         ENDM
 
Whether the colon after each label is present, or not, shouldn't affect the assembly process.
 
Regards,
Mac

Message Edited by bigmac on 2006-11-0402:35 PM

0 Kudos