When I dump my stack to the screen (with my dump(); routine), it shows
00 00 00 00 00 00 00 00 00 (then ASCII symbols)
I'm hoping my stack isn't empty! The input to my dump routine has the location of data to dump (in this case it's 0x9000, my stack), and the length in bytes to display. The stack IS at 0x9000, I checked, but it still displays 00's. Do I have to lead my stack or something, or is it actualy empty?
Thanks bunches.
Dumping stack?
Re:Dumping stack?
Is 0x9000 the address of your stack base, or your stack pointer (ESP)? Remember, the stack grows from the stack base downward, so if that address points to the base of your stack, your dump() function has to dump out bytes progressively lower each iteration.
Re:Dumping stack?
Notice, that this also affects the memory allocation process for stacks. When you allocate a region of memory for stack, you have to set ESP to the END of that region, before you start using your stack, or you are going to write just below your allocated memory..