| |||
| Home > Directives Reference > Frame description directives > FRAME PUSH | |||
Use the FRAME PUSH directive to inform the assembler
when the callee saves registers, normally at function entry. You
can only use it within functions with FUNCTION and ENDFUNC or PROC and ENDP directives.
There are two alternative syntaxes for FRAME PUSH:
FRAME PUSH{reglist}
FRAME PUSHn
where:
reglistis a list of registers stored consecutively below the canonical frame address. There must be at least one register in the list.
nis the number of bytes that the stack pointer moves.
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.
The assembler calculates the new offset for the canonical frame address. It assumes that each ARM register popped occupied four bytes on the stack.
See FRAME ADDRESS and FRAME SAVE.
p PROC ; Canonical frame address is sp + 0
EXPORT p
STMFD sp!,{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