1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18

Calling a Procedure

  • Now lets see what happens when we call a procedure

IMAGE imgs/Memory.sli03.gif

  • Next a (subroutine) jump (or similar instruction) to the
    called procedure is performed, this pushes the return
    address for the calling procedure onto the stack
  • The called procedure then sets up its link register, the
    previous link register value is pushed onto the stack and
    the new value is set to the top of the stack

March 3, 1998

Page 12

C201/TAM