August 2002
Beginner
1122 pages
22h 1m
English
Now it's time to get back to our analysis of the use of the stack in storing information needed during execution of a function. The next statement in our example program (Figure 5.5 on page 235) is Result = (First + Second) / 2;. Since we've assumed that First is 2, and Second is 4, the value of Result will be (4+2)/2, or 3. After this statement is executed, the stack looks like Figure 5.22.

Finally, at the end of the function, the stack pointer will be incremented to point to the stored return address. Then the return instruction will reload the program counter ...
Read now
Unlock full access