pgubook-readers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Pgubook-readers] Question Regarding Initial Stack Frame


From: Jonathon Donaldson
Subject: [Pgubook-readers] Question Regarding Initial Stack Frame
Date: Sun, 21 Oct 2007 11:46:36 -0600

Well, I tried to search the pgubook mailing list archives for an
answer to this question but it seems to be "out of order".  I've been
receiving "404 Not Found" for the last few days.  I've also looked on
Google but can't seem to find any specific answer, but I might not be
using the correct terms.  So forgive me if this question has already
been answered.

At the very beginning of the main method for the programs provided in
Chapters 5 (toupper.s) and 6 (read-records.s) the very first
instruction saves the stack pointer using the instruction:

movl %esp, %ebp

However, Bartlett neglects to push the original %ebp register to the
stack beforehand.  I doubt this is a bug as he does this on more than
one occasion.  I have looked everywhere for a reason as to why the
"push %ebp" instructions is always used first inside functions but not
within the main method.

Why do we not have to save the original base pointer register before
we destroy it in the main method?

I hope there is still someone listening out there.  Thanks in advance
for your help!

-- 
Jonathon




reply via email to

[Prev in Thread] Current Thread [Next in Thread]