Is it "allowed" so to speak, to change the names of
the local variables. So when you call a procedure, the parameters
are different, than the ones specified in the Procedure,
Wwd to wDim, and Wht to sDim like this:


invoke TopXY, Wwd, eax
invoke TopXY, Wht, eax


TopXY proc wDim:DWORD, sDim:DWORD:confused:
Posted on 2003-12-22 08:50:45 by The SharK
If i'm understanding the question then yes it is allowed.
Posted on 2003-12-22 09:01:54 by Eóin
Hi E?in

I thought that you had to use the same arguments/names,
to call a procedure, as the arguments/names declared in the
procedure.
like:

invoke TopXY, wDim, sDim


using the same names as in:

TopXY proc wDim:DWORD, sDim:DWORD

instead of:

invoke TopXY, Wwd, eax
invoke TopXY, Wht, eax

confused ?
Posted on 2003-12-22 09:47:36 by The SharK
Hi The Shark.

Every label in your program is replaced with either a number or an address at compile time and those parameter names are discarded so yes, you can call the procedure with any names you like. You are not required to use the same names as in the proc declaration when calling it. Actually the names are translated to pointers to the offset of the data on the stack and the invoke just pushes whatever it finds onto the stack regardless of what you name it. There is absolutely no limitation other than the size of the parameter on what you can use to call a procedure, and the parameter names don't exist outside of the stack frame for that procedure. When you use the same parameter names in the calling invoke you are actually just creating another set of completely different local variables that happen to have the same names but are otherwise unrelated.

I hope you understand this, it is one of those concepts that is so simple it is hard to explain :)
Posted on 2003-12-22 10:57:36 by donkey
Thanks donkey:alright:


So everytime you use invoke/call, you only have to find out how many
parameters to be passed to the procedure, and the size of each parameter
right, and NOT the names:)
Posted on 2003-12-22 11:11:12 by The SharK