 RealView Assembler User's Guide |
|
Technical Support On-Line Manuals RealView Assembler User's Guide Preface Introduction Writing ARM Assembly Language Assembler Reference ARM and Thumb Instructions Directives Reference Alphabetical list of directives Symbol definition directives GBLA, GBLL, and GBLS LCLA, LCLL, and LCLS SETA, SETL, and SETS RELOC RN RLIST CN CP Data definition directives LTORG MAP FIELD SPACE or FILL DCB DCD and DCDU DCDO DCFD and DCFDU DCFS and DCFSU DCI DCQ and DCQU DCW and DCWU COMMON DATA Assembly control directives Nesting directives MACRO and MEND MEXIT IF, ELSE, ENDIF, and ELIF WHILE and WEND Frame directives FRAME ADDRESS FRAME POP FRAME PUSH FRAME REGISTER FRAME RESTORE FRAME RETURN ADDRESS FRAME SAVE FRAME STATE REMEMBER FRAME STATE RESTORE FRAME UNWIND ON FRAME UNWIND OFF FUNCTION or PROC ENDFUNC or ENDP Reporting directives ASSERT INFO OPT TTL and SUBT Instruction set and syntax selection directives ARM, THUMB, THUMBX, CODE16 and CODE32 Miscellaneous directives ALIGN AREA ATTR END ENTRY EQU EXPORT or GLOBAL EXPORTAS GET or INCLUDE IMPORT and EXTERN INCBIN KEEP NOFP REQUIRE REQUIRE8 and PRESERVE8 ROUT | FRAME ADDRESSThe FRAME ADDRESS directive describes how to calculate the canonical frame address for following instructions. You can only use it in functions with FUNCTION and ENDFUNC or PROC and ENDP directives.
FRAME ADDRESS reg[,offset]
where: regis the register on which the canonical frame addressis to be based. This is sp unless the function uses a separate frame pointer. offsetis the offset of the canonical frame address from reg. If offset is zero, you can omit it.
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. NoteIf your code uses a single instruction to save registers and alter the stack pointer, you can use FRAME PUSH instead of using both FRAME ADDRESS and FRAME SAVE (see FRAME PUSH). If your code uses a single instruction to load registers and alter the stack pointer, you can use FRAME POP instead of using both FRAME ADDRESS and FRAME RESTORE (see FRAME POP).
_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
|
|