News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

Missing operator

Started by Magnum, November 26, 2012, 02:13:01 AM

Previous topic - Next topic

Magnum

I get a "missing operator" with this.
Is the subtraction sign not a valid operator any more ?

.IF End_Count - r9Seed > 0x10
.IF (End_Count - r9Seed) > 0x10
Take care,
                   Andy

Ubuntu-mate-18.04-desktop-amd64

http://www.goodnewsnetwork.org

jj2007

Hi Andy,

If it's assembler, it should be 10h, not 0x10
Besides, you need
  mov eax, offset End_Count - r9Seed
  .if eax>10h

dedndave

or - if End_Count is an EQU and r9Seed is a memory operand....
    mov     eax,End_Count
    sub     eax,r9Seed
    .if eax>10h


that being the case, you can optimize the code that is generated a little bit

you can combine the 10h with the EQU (but not a memory operand)
    mov     eax,End_Count-10h

now, rather than looking for "greater than", you can test for sign or carry (depending on signed or unsigned)
you see, the assembler uses CMP and Jcc when you do it the original way
but, if the condition that results after SUB may be tested with a flag, the CMP is not needed
        mov     eax,End_Count-10h
        sub     eax,r9Seed
        .if !SIGN?

or
        mov     eax,End_Count-10h
        sub     eax,r9Seed
        .if !CARRY?


the assembler supports ZERO?, CARRY?, OVERFLOW?, SIGN?, and PARITY?
of course, you can precede them with "!" to get the inverse case
i'm not sure if you can combine them to use Jcc's like JLE, which examines the zero, sign, and overflow flags   :P
one of the reasons i prefer the old way of doing it - lol

Magnum

Error_mod_not_found


invoke GetTickCount
mov Start_Count,eax

;int 3h

invoke GetTickCount
mov End_Count,eax

mov     eax,End_Count
sub     eax,Start_Count

int 3

.if eax > 01h
invoke MessageBox,NULL,ADDR Mess, ADDR Sample,MB_ICONINFORMATION


  .ELSE

invoke MessageBox,NULL,ADDR OK, ADDR Sample,MB_ICONINFORMATION


  .ENDIF
Take care,
                   Andy

Ubuntu-mate-18.04-desktop-amd64

http://www.goodnewsnetwork.org