flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > Individual macro for each procedure?

Author
Thread Post new topic Reply to topic
booter



Joined: 08 Dec 2006
Posts: 67
booter 07 Mar 2010, 08:41
Currently we one "universal" macro per calling convention (stdcall, etc.).
I found that wrapping procedure call in macro is very convenient, though it requires additional work.
Anyway, we're having rather heavy construction of ["call macro" ->] stdcall -> pushing arguments to stack -> call -> popping arguments to registers -> processing.
It would be nice if we could easily create macros that would pass arguments and preserve registers in a way specific for each particular procedure. I mean something like
Definition:
Code:
macrocall TestProc abc(eax),xy(esi),z(edx); instead of proc TestProc abc,xy,z    

Usage:
Code:
 TestProc zzz,125,"teststr"; instead of stdcall TestProc,zzz,125,"teststr"    

It would be even better if such macro could track usage of registers in the procedure body and automatically generate required push/pop.
However, I don't think such functionality can be implemented in FASM macors without being extremely complex (i.e. slow and buggy) Sad
Post 07 Mar 2010, 08:41
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20363
Location: In your JS exploiting you and your system
revolution 10 Mar 2010, 16:45
What problem are you trying to solve with this idea?

You need to define the problems first, then measure how much "damage" those problems are causing. And only then come up with possible solutions. Next step is to weigh up how much "pain" then solutions cause compared to the "damage" caused by the problems. Often the "pain" outweighs the "damage" and makes the solutions pointless. Have you done the comparison yet?
Post 10 Mar 2010, 16:45
View user's profile Send private message Visit poster's website Reply with quote
edemko



Joined: 18 Jul 2009
Posts: 549
edemko 10 Mar 2010, 17:37
That principle must be implemented by you in the case of an extreme.
You have said to resume registers back: stack used anyway.
Post 10 Mar 2010, 17:37
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.