You copied the Doc URL to your clipboard.

21.30 FRAME ADDRESS

The FRAME ADDRESS directive describes how to calculate the canonical frame address for the following instructions.

Syntax

FRAME ADDRESS reg{,offset}

where:

reg

is the register on which the canonical frame addressis to be based. This is SP unless the function uses a separate framepointer.

offset

is the offset of the canonical frame address from reg.If offset is zero, you can omitit.

Usage

Use FRAME ADDRESS if your code alters which register the canonical frame address is based on, or if it changes the offset of the canonical frame address from the register. You must use FRAME ADDRESS immediately after the instruction that changes the calculation of the canonical frame address.

You can only use FRAME ADDRESS in functions with FUNCTION and ENDFUNC or PROC and ENDP directives.

Note

If your code uses a single instruction to save registers andalter the stack pointer, you can use FRAME PUSH insteadof using both FRAME ADDRESS and FRAMESAVE.

If your code uses a single instruction to load registers andalter the stack pointer, you can use FRAME POP insteadof using both FRAME ADDRESS and FRAMERESTORE.

Example

_fn     FUNCTION        ; CFA (Canonical Frame Address) is value                        ; of SP on entry to function        PUSH    {r4,fp,ip,lr,pc}        FRAME PUSH {r4,fp,ip,lr,pc}        SUB     sp,sp,#4            ; CFA offset now changed        FRAME ADDRESS sp,24         ; - so we correct it        ADD     fp,sp,#20        FRAME ADDRESS fp,4          ; New base register        ; code using fp to base call-frame on, instead of SP

Related reference

Was this page helpful? Yes No