在 MASM 中,是否可以创建 if...ekse 宏(类似于高级编程语言中的宏)?我还没有为 MASM 找到任何类型的 if-else 语句宏,但我认为用于此目的的宏将非常有用。
如果我能找到一个宏来使在 masm 中编写一系列复杂的 if 语句变得更容易,那将会很有用,如下所示:
;jump to each case here
checkCase1:
cmp theVariable, 5;
jne case1;
checkCase2:
cmp theVariable, var2;
jne case2;
jmp defaultCase; do this if no other statement is true
;each of the cases are handled here
case1:
;handle case 1
jmp checkCase2; //check whether case 2 is true
case2:
handle case 2
jmp endOfStatement;
defaultCase:
;this is the default case
endOfStatement:
;this is the end of the statement
Run Code Online (Sandbox Code Playgroud)
没人看说明书了???组装已经存在多年,MASM 已经存在多年了!!!大量的样本和文档!!!
例如:
.if eax == 1
.elseif eax !=10
.elseif eax >= 11
.else
.endif
Run Code Online (Sandbox Code Playgroud)
MASM32 包含一个 case 宏...