flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > How to exit from macro

Author
Thread Post new topic Reply to topic
emil



Joined: 16 Dec 2003
Posts: 76
Location: egypt
emil 02 Mar 2017, 15:03
Hi All,

Suppose you have a macro and want to exit from the macro in certain position before end of macro ?
Post 02 Mar 2017, 15:03
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8357
Location: Kraków, Poland
Tomasz Grysztar 02 Mar 2017, 17:03
It is not possible. Such an idea does not work well with the design of fasm's language.
Post 02 Mar 2017, 17:03
View user's profile Send private message Visit poster's website Reply with quote
redsock



Joined: 09 Oct 2009
Posts: 434
Location: Australia
redsock 03 Mar 2017, 03:59
If I understand the question correctly, can't you use local labels?

To "exit" from it simply means "go to the end", so I have made local labels like this (forgive the overly simple example):
Code:
macro dosomething {
        local .alldone

        test    eax, eax
        jnz     .alldone
        call    somethingelse

.alldone:
}
    

_________________
2 Ton Digital - https://2ton.com.au/
Post 03 Mar 2017, 03:59
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-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.