9 function or proc – ARM VERSION 1.2 User Manual

Page 324

Advertising
background image

Directives Reference

7-42

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

ARM DUI 0068B

7.5.9

FUNCTION 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

Advertising