Keil Logo

Functions

5.6 Functions

Assemblers can identify the start of a function when producing DWARF call frame information for ELF.

armasm syntax

The FUNCTION directive marks the start of a function. PROC is a synonym for FUNCTION.

The ENDFUNC directive marks the end of a function. ENDP is a synonym for ENDFUNC.

For example:

myproc  PROC
  ; Procedure body
  ENDP

GNU syntax

Use the .type directive to identify symbols as functions. For example:

  .type myproc, "function"
myproc:
  // Procedure body

GNU syntax assembly code provides the .func and .endfunc directives. However, these are not supported by armclang. armclang uses the .size directive to set the symbol size:

  .type myproc, "function"
myproc:
  // Procedure body
.Lmyproc_end0:
  .size myproc, .Lmyproc_end0-myproc

Note:

Functions must be typed to link properly.
Non-ConfidentialPDF file icon PDF version100068_0613_00_en
Copyright © 2014–2019 Arm Limited or its affiliates. All rights reserved. 
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.