Keil Logo

AREA Assembler Statement

Arguments
AREA segment-name, class-name <[>, attributes <[>,...<]><]>
Description

The AREA statement defines an ARM-compatible segment.

Where

segment-name Specifies the name for the segment.
class-name

Specifies the name of a valid system class (CODE, CONST, DATA, ERAM) or an user class.

A user class is composed of a system class and an extension ("DATA2" or "CODE_FLASH2") and lets you access the same address space as the system class. The user class allows locating of segment groups with the Linker CLASSES directive.

attributes

Specifies alignment, location, or access type for the segment.

Attribute Description
READONLY Specifies that the segment is read-only and may not be written.
READWRITE Specifies the segment is readable and writable.
ALIGN=n Specifies segment alignment as 2n where n may be a value from 2-31.
AT address Specifies an absolute address for the segment.
See Also

RSEG

Example

The following example defines a segment named STACK in the DATA memory class that may be read and written and that is aligned on a 22-byte boundary.

AREA   STACK, DATA, READWRITE, ALIGN=2

The following example defines a segment named STARTUP in the CODE memory class that is located at physical address 0x00000000.

AREA   STARTUP, CODE, AT 0x00000000

The following example defines a segment named STARTUP in the user class CODE_FLASH.

AREA   STARTUP, "CODE_FLASH"
  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.