This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
RE: Popping registers
- From: "Dave Korn" <dave dot korn at artimi dot com>
- To: "'Sam Lauber'" <sam124 at operamail dot com>,"'Richard Henderson'" <rth at redhat dot com>,<gcc at gcc dot gnu dot org>
- Date: Tue, 21 Dec 2004 01:58:03 -0000
- Subject: RE: Popping registers
> -----Original Message-----
> From: gcc-owner On Behalf Of Sam Lauber
> Sent: 21 December 2004 01:48
> To: Richard Henderson; gcc
> Subject: Re: Popping registers
>
> >> I was wondering, how do you pop a register (like EAX) into
> a C variable?
> >
> > You don't. Messing with the stack like that behind the compiler's
> > back is strictly verboten.
> >
> > r~
>
> What is a stack? What does the compiler use it for? Why would
> messing with it be a bad idea? And no, I do not know
> assembly, and I haven't had computer science class yet.
>
> Samuel Lauber
The "stack" is like a great big pile of junk where the compiler discards all
the old data it doesn't need any more, deleted strings, values of dead
variables, etc. etc., a bit like /dev/null only right inside the compiled
program. It's a bad idea to go messing with it because all the stale old data
can come flooding back out and fill your code with stuck bits, and they can take
an awful long time to clean up again.
cheers,
DaveK
--
Can't think of a witty .sigline today....