7.5.9. FUNCTIONor PROC

The FUNCTION directive marks the start of an ATPCS-conforming function. PROC is a synonym for FUNCTION.

Syntax

label FUNCTION

Usage

Use FUNCTION to mark the start of functions.The assembler uses FUNCTION to identify the start of a function when producing DWARF call frame information for ELF.

FUNCTION sets the canonical frame address to be sp, and the frame state stack to be empty.

Each FUNCTION directive must have a matching ENDFUNC directive. You must not nest FUNCTION/ENDFUNC pairs, and they must not contain PROC or ENDP directives.

See also FRAME ADDRESS to FRAME STATE RESTORE.

Example

dadd    FUNCTION
        EXPORT  dadd
        STMFD   sp!,{r4-r6,lr}
        FRAME PUSH {r4-r6,lr}
        ; subroutine body
        LDMFD   sp!,{r4-r6,pc}
        ENDFUNC
Copyright © 2000, 2001 ARM Limited. All rights reserved.ARM DUI 0068B
Non-Confidential