flat assembler
Message board for the users of flat assembler.

Index > Main > ".break" support in .while?

Author
Thread Post new topic Reply to topic
alorent



Joined: 05 Dec 2005
Posts: 201
alorent
Hello guys,

I was wondering how ".break" could be implemented to be used inside the ".while" loop in FASM.

In MASM, we can do:

Code:
.while eax

   ; do something

  .if ebx == 0

     .break

   .endif

.endw 
    


I can see that the ".while" macro is implemented in FASM (IF.inc file), but not .break

Any ideas how to do it?

Thanks!
Post 05 Nov 2009, 11:58
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17714
Location: In your JS exploiting you and your system
revolution
Perhaps you can try this. Untested by me, just posting it here OTTOMH.
Code:
macro .break
{
  jmp __ENDW
}    
Post 05 Nov 2009, 12:12
View user's profile Send private message Visit poster's website Reply with quote
alorent



Joined: 05 Dec 2005
Posts: 201
alorent
Thanks revolution! I haven't tried yet as I have been abroad these days.

Thanks a lot for your invaluable help! Wink
Post 12 Nov 2009, 17:02
View user's profile Send private message Reply with quote
sleepsleep



Joined: 05 Oct 2006
Posts: 9181
Location: ˛                             ⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣Posts: 334455
sleepsleep
sorry for bringing out late 2009 thread,

but why .break doesn't make into fasm official macro list?
i don't understand.

are we expected to type jmp __ENDW to exit .while
Post 12 Sep 2012, 22:23
View user's profile Send private message Reply with quote
baldr



Joined: 19 Mar 2008
Posts: 1651
baldr
sleepsleep,

Consider .repeat too. Wink
Post 14 Sep 2012, 18:13
View user's profile Send private message Reply with quote
sleepsleep



Joined: 05 Oct 2006
Posts: 9181
Location: ˛                             ⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣Posts: 334455
sleepsleep
is there any specific reasons?
idk, maybe only tomasz know
Post 14 Sep 2012, 23:42
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.