News:

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

Stack Problems: Reversing part of the stack.

Started by KcDan, November 11, 2005, 02:05:50 PM

Previous topic - Next topic

KcDan

For my compiler when Im parsing string expressions I allow the '+' operator to add strings together. When Im parsing these strings Im pushing the address of the just done string and then continuing on to the next string that is after the '+' operator. When Im all done all the address's are pushed on the stack but what I want to do is reverse the order of them.

So stack looks like this
1000
2000
3000
4000

But I want it to look like this
4000
3000
2000
1000

Any ideas?

hutch--

Kc,

I would be writing the args to an array then pushing them in reverse order.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

KcDan

Quote from: hutch-- on November 11, 2005, 02:31:23 PM
Kc,

I would be writing the args to an array then pushing them in reverse order.
>_< Thanks,. I dont know why I didnt try this in the first place.

zooba

Alternatively, you could store the starting point of the stack and go back to that later. :8)