在MASM宏中使用本地标签问题 [英] Issues using a local label in a macro in MASM
问题描述
我写了一个宏以 E,NE,A,B
...作为一个参数,并即单个命令 MOV EAX,EBX
如果条件由preceding设置这将执行 CMP
操作是真实的。
I'm to write a macro that takes E,NE,A,B
... as a parameter and a single command i.e mov eax,ebx
which would execute if the condition set by a preceding cmp
operation is true.
一个例子调用会是什么样子。
An example call would look like.
cmp bx,20
mDoIf E,<call Dumpregs>
我遇到的问题是,当我尝试用下面的定义编译我得到两个错误之一。随着本地
的定义,我得到一个未定义的符号错误:?? 0000
。当我删除本地
定义我得到一个错误:跳转目标必须指定一个标签
。
The issue I'm running into is that when I attempt to compile with the below definition I get one of two errors. With the LOCAL
definition I get an Undefined Symbol Error: ??0000
. When I remove the LOCAL
definition I get an error: jump destination must specify a label
.
mDoIf MACRO op, command
LOCAL true
J&op true
exitm
true:
command
exitm
endm
任何帮助将是AP preciated。谢谢。
Any help would be appreciated. Thank you.
推荐答案
试试这个:
mDoIf MACRO op, command
LOCAL L1, L2
J&op short L1
jmp short L2
L1:
call command
L2:
exitm
endm
.code
start:
mov eax, 1
cmp eax, 2
mDoIf l, DumpRegs
invoke ExitProcess, 0
end start
这篇关于在MASM宏中使用本地标签问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!