Submitted Questions

  • stack pointer

    Can anyone give me complete information while performing this situation,A function is running, it has its own stack pointer, memory area now it invokes another function from this point what changes will be in it's memory area and what other changes in data segment, stack segment, heap segment. I want a complete picture of memory architecture?

    Star Read Best Answer

    Editorial / Best Answer

    kalayama  

    • Member Since Sep-2006 | Dec 8th, 2006


    There will be a lot of changes in fact. First of all, all the variables the function was suing needs to be pushed into the stack. (we need all these variables when we return from the other function). The Program counter will be pushed to stack too... (When the "return" of second function occurs we should know where to 'return' to)These are the basics which are bound to happen when a function calls another.

    kalayama

    • Dec 8th, 2006

    There will be a lot of changes in fact. First of all, all the variables the function was suing needs to be pushed into the stack. (we need all these variables when we return from the other function). ...

    prasanth

    • Nov 27th, 2006

    hi,         There will be no change in memory area .And all the major part will be taken by the stack pointer.It depends on the calling conventions like pascals...