News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

.if .else .elseif .endif

Started by bomz, February 27, 2013, 03:52:09 PM

Previous topic - Next topic

bomz

mov ax, KeyBoardBuffer.Flags
test ax, KEY_MAKE
.if ZERO?;(ax & KEY_MAKE);CARY?

what constructions possible else?

hutch--

.if

.elseif

.else        ; only 1, and must be 2nd last

.endif

bomz

I mean like this ZERO?;(ax & KEY_MAKE);CARY?. I don't know about them only
.if TRUE
.if !eax
.if eax==ebx.....

jj2007

        invoke GetKeyState, VK_SHIFT
        .if ax & 7        ; test ax, 0007, je @F
                nop
        .elseif Carry?
                nop
        .elseif Zero?
                nop
        .elseif !Zero?
                nop
        .elseif Sign?
                nop
        .elseif !(Sign? || Zero?)        ; combis are better done "by hand"
                nop
        .endif

dedndave

ZERO?
CARRY?
OVERFLOW?
SIGN?
PARITY?

jj2007

The Masm developers forgot the Above? and Greater? flags, unfortunately...

dedndave

yes, those would have been nice
but, you can accomplish those using the "normal" conditional expressions

Magnum


Operator Meaning

== Equal
!= Not equal
>  Greater than
>= Greater than or equal to
<  Less than
<= Less than or equal to
&  Bit test (format: expression & bitnumber)
!  Logical NOT
&& Logical AND
|| Logical OR

CARRY? Carry bit set
OVERFLOW? Overflow bit set
PARITY? Parity bit set
SIGN? Sign bit set
ZERO? Zero bit set


Take care,
                   Andy

Ubuntu-mate-18.04-desktop-amd64

http://www.goodnewsnetwork.org