flat assembler
Message board for the users of flat assembler.
Index
> Windows > Using LocalFree |
Author |
|
Tyler 04 Sep 2010, 23:57
Locals are declared on the stack, are deleted after endp... assuming it gets to endp, remove that ret.
|
|||
04 Sep 2010, 23:57 |
|
windwakr 05 Sep 2010, 00:05
Tyler wrote: Locals are declared on the stack, it is deleted after endp... assuming it gets to endp, remove that ret. The ret is needed. For example, lets say I have this pointless proc: Code: proc a a,b,c local nr:QWORD mov eax,1 endp It becomes: Code: push ebp mov ebp,esp sub esp,8 mov eax,1 With a ret after the "mov eax,1" line: Code: push ebp mov ebp,esp sub esp,8 mov eax,1 leave retn 0xC |
|||
05 Sep 2010, 00:05 |
|
revolution 05 Sep 2010, 00:17
You don't need to free anything. Just use:
Code: proc sGetElem M,ir,ic local nr:QWORD ;... ret endp |
|||
05 Sep 2010, 00:17 |
|
ctl3d32 05 Sep 2010, 00:47
Hi!
Good to know i don't have to free them by myself. Thank you all for the quick reply! |
|||
05 Sep 2010, 00:47 |
|
Tyler 05 Sep 2010, 00:49
Wow, I didn't know that(obviously). I've never used procs for the very reason that I thought it was impossible to have multiple returns
|
|||
05 Sep 2010, 00:49 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.