The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: Lobotomy on August 25, 2006, 04:42:43 PM

Title: Simple comparison operator: why error?
Post by: Lobotomy on August 25, 2006, 04:42:43 PM
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.
Title: Re: Simple comparison operator: why error?
Post by: Shantanu Gadgil on August 25, 2006, 05:07:22 PM
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
Title: Re: Simple comparison operator: why error?
Post by: Lobotomy on August 25, 2006, 05:14:56 PM
Ahh...

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