本文介绍了MASM中的if-else宏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在MASM中,是否可以创建if ... ekse宏(类似于在高级编程语言中发现的宏)?我尚未找到用于MASM的任何类型的if-else语句宏,但我认为用于此目的的宏将非常有用.

In MASM, is it possible to create an if...ekse macro (similar to those found in high-level programming languages)? I haven't yet found any kind of if-else statement macro for MASM, but I think a macro for this purpose would be very useful.

如果我可以找到一个宏来简化在masm中编写一系列复杂的if语句,这将很有用,如下所示:

It would be useful if I could find a macro to make it easier to write a complicated series of if-statements in masm, as shown here:

;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

推荐答案

没人再读手册了吗???大会已经进行了YEARS年,MASM已经进行了YEARS年!!!大量的样品和文档!!!

Nobody reads the manual anymore??? Assembly has been around for YEARS, MASM has been out for YEARS!!! Tons of samples and documentation!!!

例如:

.if eax == 1

.elseif eax !=10

.elseif eax >= 11

.else

.endif

MASM32包含一个案例宏...

MASM32 contains a case macro...

这篇关于MASM中的if-else宏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-17 15:15