【发布时间】:2018-01-29 14:57:36
【问题描述】:
如果我有一个名为 test 的宏,并且我想将一个变量值传递给它,我应该怎么做? 例如:
test macro num
; ...
endm
我这样称呼它:
test num
并且 num 在数据段中定义为例如 db。
我的问题是,这可能吗?为什么我这样做时会出错?我什至需要这样做吗?我不能只在宏内部访问num 而不将其作为参数传递吗?
无论如何,谢谢。
编辑 1:这是实际代码的示例:
;... in the data segment i have car_fich defined like this
car_fich db 9
; ........................................................
fill_array macro car_fich
mov ah, car_fich
; .. do other things
endm
Main proc
fill_array car_fich
Main endp
【问题讨论】:
-
你指的是什么汇编程序?您的
MACRO名称“test”和test指令之间可能存在名称冲突。 -
@zx485 名称 test 只是我解释问题的一个例子,而不是实际代码
-
那么实际的代码是什么样的呢? minimal reproducible example?
-
@zx485 用实际代码示例编辑问题