HP.com home PA-RISC Procedure Calling Conventions Reference Manual > Appendix A Standard Procedure Calls

A.8 Assembly Documentation

MPE documents

Complete PDF
Table of Contents

  1. Start of outer block/main program. RP is saved, the stack frame is allocated, and the unwind delimiter is initialized.

  2. Call to procedure two. This is a local call, so the branch goes directly to the procedure, with no stub interaction.

  3. Entry to procedure two. RP is saved, the frame is allocated, and the constant values 1 and 2 are loaded into argument registers 1 and 2 (gr26 and gr25).

  4. Branch to Calling Stub. As far as the procedure two is concerned, this is the call to the procedure one, but the branch actually goes to the calling stub that is necessary because this is an external procedure call.

  5. Entry to Calling Stub attached to two. The calling stub performs as is documented in detail in Chapter 5, Calling Stub, of the text.

  6. Call to CALLX millicode. The Branch External instruction is used in order to reach the CALL X millicode routine.

  7. Execution of CALLX millicode; it performs exactly as is documented in Chapter 5, External Procedure Call Millicode (CALLX), of the text, and then branches to the called stub that is attached to procedure one.

  8. Entry to called stub attached to procedure one.

  9. Branch to procedure one. The standard Branch and Link instruction is used to reach the actual code for the external procedure one.

  10. Entry to procedure one. The arguments in gr26 and gr25 are stored onto the stack (this is not necessary, and only remains because the code has not been optimized.

  11. Exit from one / Branch back to called stub. The standard return instruction (BV) is used here, although the branch is actually going to the called stub, and not directly to the caller.

  12. Re-entry to called stub. The remainder of the called stub performs as is documented in detail in Chapter 5, Called Stub, of the text.

  13. Exit from called stub / branch back to procedure two. The Branch External instruction is used to reach to actual code for the procedure two (the caller).

  14. Return to procedure two from called stub. The previous RP is loaded into gr2 from the stack, and the frame is deallocated.

  15. Exit from procedure two / branch back to main program block. The standard procedure return is made, because this is a local return.

  16. Return to main program block from procedure two. After return, calls are made to the system process termination procedures, and then the frame is deallocated and the return is made to the system.




A.7 External Calls


Appendix B Summary of PA-RISC Assembler Procedure Control