News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Simple comparison operator: why error?

Started by Lobotomy, August 25, 2006, 04:42:43 PM

Previous topic - Next topic

Lobotomy

Hi,

I'm new to asm, and already stuck with comparison operators. I'm getting a build error on .if:


Dummy proc

    LOCAL foo :DWORD
    LOCAL bar :DWORD

    mov foo, 1
    mov bar, 1

    .if foo == bar
    .endif
    ret

Dummy endp


.if foo == 1 works, .if foo == bar does not... why?

Please help, I'm starting seeing things.

Shantanu Gadgil

The assembler is not "letting"  :green :green you compare two memory values. Just move one value into a register and compare the other with the register value!

HTH,
Shantanu
To ret is human, to jmp divine!

Lobotomy

Ahh...

   
;    #### It's assembler ####
;    eax, ebx, ecx, edx, esi, edi