HPlogo Communicator e3000 MPE/iX Release 7.5 (Software Release C75.00): HP e3000 MPE/iX Computer Systems > Chapter 7 Catalog of User Documentation

7.4 Callee-Saves Register Spill

MPE documents

Complete PDF
Table of Contents

For a procedure to be unwindable, the callee-saves registers must be stored in the correct location within the stack frame. The registers will be stored in the correct locations when the standard entry and exit sequences generated by the .ENTER and .LEAVE are used. The stack unwinding utilities may fail if an interrupt occurs on an instruction in a non-standard entry or exit sequence. For this reason, it is advisable that assembly programmers use .ENTER and .LEAVE rather than create their own entry and exit sequences.

If you don't use the .ENTER and .LEAVE directives, then callee-saves registers should be saved within the procedure's stack frame as follows:
  • Any floating-point registers are saved starting at the double-word at the bottom of the current stack frame, the address in SP on entry to the procedure. Register fr12 should be stored at this location, with subsequent callee-saves registers saved in numeric order in the double-words immediately following.

  • Any general registers are saved starting at the first word after the last callee-saves floating-point register is saved. Register gr3 should be stored first, with subsequent registers saved in numeric order in the words immediately following.

  • Callee-saves space register sr3 is saved by moving its contents to a general register with an MFSP instruction and then storing it in the first double-word aligned address immediately following the last callee-saves general register. (Note that if an odd number of general registers are spilled, there will be an unused word of memory between the last general register spilled and the saved sr3 value.)




7.3 Instances in Which Unwinding May Fail


7.5 The HP Pascal ESCAPE Mechanism