Macro Paramters

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Macro Paramters

跳至解决方案
1,960 次查看
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
标签 (1)
标记 (1)
0 项奖励
回复
1 解答
1,098 次查看
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 项奖励
回复
1 回复
1,099 次查看
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 项奖励
回复