flat assembler
Message board for the users of flat assembler.
![]() Goto page Previous 1, 2 |
Author |
|
baldr 15 Feb 2010, 17:22
revolution,
Use it as you wish and reload with lea ebp, [esp+X] when you need to access locals/parameters again. |
|||
![]() |
|
baldr 15 Feb 2010, 18:08
revolution,
That's the problem: if you know where esp points, you can use it for addressing (and spend extra byte for each), or maintain ebp and forget it altogether. Valid stack frame is useful for unwinding too (though it's rarely used in assembly). |
|||
![]() |
|
revolution 15 Feb 2010, 19:05
Yes, there are many disadvantages. This is why I made it an opt-in parameter in my macros. Only when you knew it would be beneficial and that potential traps were understood then one could use the ESP based frame. However the OP of this thread wanted to completely eliminate EBP frames. I tried to warn that this may not be a good idea. One has to consider all the potential problems, and decide whether or not it is good, at the granularity of the individual function, not on the whole program.
|
|||
![]() |
|
mindcooler 15 Feb 2010, 20:23
I'm at least going to try to keep ebp pointing to my "data segment" as much as I can, see if it is profitable. Would have been nice to be able to use es:[] or something in Windows.
|
|||
![]() |
|
bitshifter 18 Feb 2010, 09:53
Cool trick!
I would use this for better clarity though... Code: ret 4*4 Or even this way... Code: ret 16 I just think hex should be used when appropriate and the same goes for decimal or binary or whatever. Just for clarity, but to each his own... But anyway, nice work, i like it! |
|||
![]() |
|
Goto page Previous 1, 2 < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.