flat assembler
Message board for the users of flat assembler.

Index > Main > refering parameters

Author
Thread Post new topic Reply to topic
realcr



Joined: 02 Apr 2007
Posts: 39
realcr 30 Jun 2007, 11:51
Hi.

I recently tried to understand how macros work , so I try to do stuff without them for a while...
Defining functions used to be easy , however without macros it is not convenient to refer to the paremeters:

Code:
func:
push ebp
mov ebp,esp

mov eax,[ebp + 8] ; a parameter
mov ebx,[ebp + 12] ; some other parameter

...
    

Is there a way to refer to the parameters in a nicer way? for example to define ebp + 8 to be some label or anything similar?

Thanks,
realcr.
Post 30 Jun 2007, 11:51
View user's profile Send private message Visit poster's website MSN Messenger ICQ Number Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid 30 Jun 2007, 13:59
Code:
func:
label .arg1 at ebp+8
label .arg2 at ebp+12    
Post 30 Jun 2007, 13:59
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
realcr



Joined: 02 Apr 2007
Posts: 39
realcr 30 Jun 2007, 14:00
wow , this is really cool!

Thanks vid.

realcr.
Post 30 Jun 2007, 14:00
View user's profile Send private message Visit poster's website MSN Messenger ICQ Number 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.