This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

关于汇编代码里的宏定义



我用的是F28M35,现在想在汇编里定义一个宏,我想请教大家怎么将形参和宏内容中的字符连起来??,应该用什么符号呢

例如:

CCSS .MACRO A,

            MOV  r0,0x??A

             .ENDM

我想实现的效果是调用 CCSS 44

展开会是: MOV r0,0x44

注:网上说用&,但我用过了,不行,$,##我也试过了,都不行。

请高人指点!

  • Macro和函数不一样,没有参数。macro的参数在使用之前要进行定义,让编译器知道其代表什么。

    比如,定义macro:

    Fortest_macro .macro  a,b,c

    MOV  @_res_3+1,#a

    .endm

    在汇编中实际调用的时候,会写:

       Fortest_macro  22h,33h,44h