15.32 FRAME PUSH

The FRAME PUSH directive informs the assembler when the callee saves registers, normally at function entry.

Syntax

There are the following alternative syntaxes for FRAME PUSH:

FRAME PUSH {reglist}

FRAME PUSH {reglist},n

FRAME PUSH n

where:

reglist

is a list of registers stored consecutively below the canonical frame address. There must be at least one register in the list.

n

is the number of bytes that the stack pointer moves.

Usage

FRAME PUSH is equivalent to a FRAME ADDRESS and a FRAME SAVE directive. You can use it when a single instruction saves registers and alters the stack pointer.

You must use FRAME PUSH immediately after the instruction it refers to.

You can only use it within functions with FUNCTION and ENDFUNC or PROC and ENDP directives.

If n is not specified or is zero, the assembler calculates the new offset for the canonical frame address from {reglist}. It assumes that:

  • Each ARM register pushed occupies four bytes on the stack.

  • Each VFP single-precision register pushed occupies four bytes on the stack, plus an extra four-byte word for each list.

  • Each VFP double-precision register popped occupies eight bytes on the stack, plus an extra four-byte word for each list.

Example

p   PROC ; Canonical frame address is SP + 0
    EXPORT  p
    PUSH    {r4-r6,lr}
         ; SP has moved relative to the canonical frame address,
         ; and registers R4, R5, R6 and LR are now on the stack
    FRAME PUSH {r4-r6,lr}
         ; Equivalent to:
         ; FRAME ADDRESS    sp,16       ; 16 bytes in {R4-R6,LR}
         ; FRAME SAVE    {r4-r6,lr},-16
Non-ConfidentialPDF file icon PDF versionARM DUI0473M
Copyright © 2010-2016 ARM Limited or its affiliates. All rights reserved.