flat assembler
Message board for the users of flat assembler.

Index > Windows > IF.INC

Author
Thread Post new topic Reply to topic
illuz1oN



Joined: 22 Feb 2008
Posts: 11
illuz1oN
Hey guys.. this is my first post here

btw, great job Thomasz ( <3 FASM!! )

ive been learning FASM about 4 days now...

i saw the 'if.inc' and had a look through, i just need some clarification on some code im using

Code:
     __openCD:
               xor eax,eax
         mov dword [sendBuff], eax
           push 0
              push 0
              push 0
              push szCDOp
         call [mciSendString]
                .if eax=0
                   mov dword [sendBuff], 'Erro'
                      mov dword [sendBuff+4h], 'r Sad'
                   push 0
                      push 1024
                   push sendBuff
                       push [wRSock]
                       call [send]
         .endif
              .if eax=1
                   mov dword [sendBuff], 'Open'
                      mov dword [sendBuff+4h], 'end!'
                   push 0
                      push 1024
                   push sendBuff
                       push [wRSock]
                       call [send]
         .endif
              jmp __recv_loop    


Ok, that is my code now, when i tried this

Code:
.if eax==0    


it gave me an error of 'cmp eax,=0'

so, how do these IF statements work?

- illuz1oN

Thanks again for reading, greatly appreciate it!
Post 22 Feb 2008, 18:34
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17662
Location: In your JS exploiting you and your system
revolution
Just use the version in your code with one equals character. Anything after the first equals is literally put into the cmp expression, ".if eax=(anything)" gives "cmp eax,(anything)".
Post 22 Feb 2008, 18:55
View user's profile Send private message Visit poster's website Reply with quote
illuz1oN



Joined: 22 Feb 2008
Posts: 11
illuz1oN
Hehe, Thanks revolution, i understand now!

i think i'll stay clear of HLL Syntax, even though i <3 C lol

i just added an
__error:
; yeah.. send sock etc....

and

cmp eax, 0
jnz __error

Thanks again, - illuz1oN
Post 22 Feb 2008, 19:08
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.