在汇编程序中,宏中有一些奇怪的问题。当我使用宏编译器说“错误(876)语法错误”时,当宏体直接写入代码时,没有错误。这可能是因为我在宏中使用3级宏吗?那么错误的真正原因是什么呢?谁知道呢?最好的问候,幼珍。
以上来自于百度翻译
以下为原文
Hello
Have some strange trouble in assembler source, in macro. When i use macros compiler says "error(876) syntax error", when write the macro body direct to code, there is no error. May be this happens cause i use 3 level of macro in macro?
movfl macro freg,lit
movlw lit
movwf freg
endm
;------------------------------------------------------------------------------
movfl16 macro freg,lit
movfl freg,Low(lit)
movfl freg+1,High(lit)
endm
;------------------------------------------------------------------------------
movfl32 macro freg,lit
movfl16 freg,(lit & 0x0000FFFF)
movfl freg+2,(lit >> 0x10) & 0xFF
movfl freg+3,(lit >> 0x18)& 0xFF
endm
;------------------------------------------------------------------------------
_func:
movfl16 ax, (0x4503114F & 0x0000FFFF) // this 3 lines works fine
movfl ax+2,(0x4503114F >> 0x10) & 0xFF
movfl ax+3,(0x4503114F >> 0x18)& 0xFF
movfl32 bx, 0x4503114F // this macro cause an error
So whats the real reason of error? Who knows?
Best regards, Eugene.