News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

m32lib restrictions?

Started by Phil, June 17, 2005, 05:20:06 AM

Previous topic - Next topic

zooba

The only restriction using negative stack references is that pushing another value will overwrite it and popping won't return it. Using [esp-4] is placing the value in the space that would be used by the next push, so it isn't overwriting any parameters or locals because they are kept in addresses forward of esp (ie, esp+x). Also, if someone else decides to do it as well it will overwrite the value, but its fine for use over a small piece of code. In a larger, more complicated setting, the advantages of proper naming and security of a local is much better.

I haven't seen anything recently discussing speed issues with push and pop, though I remember on 386/486 popping was slow compared to normal memory reads.