NASM - The Netwide Assembler
NASM Forum => Using NASM => Topic started by: rdtsc on January 22, 2011, 06:31:00 PM
-
Hello, dear NASM creators and others!
I have a problem.
How i can simply get offset of %LOCAL or %ARG vars in my FUNCTION ?
For example,
Proc:
%args var:dword
push var ; THIS DOES NOT WORK!!! I need offset...of var
..........
ret
I don't want to use
lea eax,[var]
push eax
I want to use (may be with some modifiers/directives) 1-line command, such as
push var ; where var is in %local or %arg
Thx.
-
Good luck with that. "Local" variables and passed "args" don't have an "offset". Why don't you want to use "lea"? That's what it's for!
Best,
Frank
-
Good luck with that. "Local" variables and passed "args" don't have an "offset". Why don't you want to use "lea"? That's what it's for!
Best,
Frank
Well, of course ,my quest is stupid... [ebp+0x??] itself dosen't have an offset,when used in "mov reg,local"..lea is exit.
But how cool when i can "push var" - push offset for usual vars...I tryed to find a way for locals to do the same thing (pushing offset on stack)..
Will use lea.
Or next macros may be work ok
%macro PUSHL 1
push eax
lea eax,%1
xchg eax,dword [esp]
%endmacro