Directives Reference

7.5.9FUNCTION or 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 on page 7-34 to FRAME STATE RESTORE on page 7-41.

Example

dadd FUNCTION EXPORT dadd

STMFD sp!,{r4-r6,lr} FRAME PUSH {r4-r6,lr}

;subroutine body LDMFD sp!,{r4-r6,pc}

ENDFUNC

7-42

Copyright © 2000, 2001 ARM Limited. All rights reserved.

ARM DUI 0068B

Page 324
Image 324
ARM VERSION 1.2 manual Function or Proc