Author Topic: .if .else .elseif .endif  (Read 6597 times)

bomz

  • Guest
.if .else .elseif .endif
« on: February 27, 2013, 03:52:09 PM »
Code: [Select]
mov ax, KeyBoardBuffer.Flags
test ax, KEY_MAKE
.if ZERO?;(ax & KEY_MAKE);CARY?
what constructions possible else?

hutch--

  • Administrator
  • Member
  • ******
  • Posts: 4934
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Re: .if .else .elseif .endif
« Reply #1 on: February 27, 2013, 04:01:33 PM »
.if

.elseif

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

.endif
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :biggrin:

bomz

  • Guest
Re: .if .else .elseif .endif
« Reply #2 on: February 27, 2013, 04:51:11 PM »
I mean like this ZERO?;(ax & KEY_MAKE);CARY?. I don't know about them only
.if TRUE
.if !eax
.if eax==ebx.....

jj2007

  • Member
  • *****
  • Posts: 7757
  • Assembler is fun ;-)
    • MasmBasic
Re: .if .else .elseif .endif
« Reply #3 on: February 27, 2013, 05:22:50 PM »
        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

  • Member
  • *****
  • Posts: 8752
  • Still using Abacus 2.0
    • DednDave
Re: .if .else .elseif .endif
« Reply #4 on: February 28, 2013, 12:37:36 AM »
ZERO?
CARRY?
OVERFLOW?
SIGN?
PARITY?

jj2007

  • Member
  • *****
  • Posts: 7757
  • Assembler is fun ;-)
    • MasmBasic
Re: .if .else .elseif .endif
« Reply #5 on: February 28, 2013, 01:06:06 AM »
The Masm developers forgot the Above? and Greater? flags, unfortunately...

dedndave

  • Member
  • *****
  • Posts: 8752
  • Still using Abacus 2.0
    • DednDave
Re: .if .else .elseif .endif
« Reply #6 on: February 28, 2013, 01:09:35 AM »
yes, those would have been nice
but, you can accomplish those using the "normal" conditional expressions

Magnum

  • Member
  • *****
  • Posts: 2242
Re: .if .else .elseif .endif
« Reply #7 on: February 28, 2013, 01:10:45 AM »

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-16.04-desktop-amd64

http://www.goodnewsnetwork.org