THUMB Prolog

A THUMB prolog has certain specific parts. All parts are immediately contiguous with no intervening instructions.

The following list shows the standard parts of a THUMB prolog:

  • A sequence of zero or one instruction that push the incoming argument values in R0, R1, R2, and R3 to the argument home locations, and update R13 to the new stack top.
  • If the function does not use any high registers such as R8, R9, R10, and R11, a sequence of instructions pushes R4-R7 or the link register R14 to the stack. The function does not push the link register if the routine is a leaf with no high registers saved.
  • A sequence of zero or more instructions that allocate the remaining stack frame space for local variables, compiler-generated temporaries, and the argument build area by subtracting an aligned offset from R13.
  • The prolog contains a single instruction that set the frame pointer if one is to be established. Immediately after it links the stack, the function copies the value of the stack pointer in R13 to R7.

See Also

ARM Prolog and Epilog | ARM Prolog | ARM Epilog | THUMB Epilog | ARM Prolog and Epilog Coding Examples

 Last updated on Thursday, April 08, 2004

© 1992-2003 Microsoft Corporation. All rights reserved.