Keil Logo

Control Statements

The AARM Assembler provides a number of control statements that permit you to define symbol values, reserve and initialize storage, and control the placement of your code.

These statements should not be confused with processor instructions or with assembler directives. They do not produce executable code and, with the exception of the DB, DD, DW, DBPTR, DSPTR, and DPPTR statements, they have no direct effect on the contents of code memory. These controls change the state of the assembler, define user symbols, and add information to the object file.

Control statements may be divided into the following categories:

Address Control

Statement Description
ORG Sets the location counter to a specific offset or address.

Conditional Assembly

Statement Description
IF Begins an IF-ELSE-ENDIF block.
ELSEIF Begins an alternate IF block.
ELSE Begins an ELSE block.
ENDIF Terminates an IF block.

Memory Initialization

Statement Description
DB Allocates memory for one or more defined byte values.
DCB Allocates memory for one or more defined byte values.
DCD Allocates memory for one or more defined 32-bit values.
DCF Allocates memory for one or more defined 32-bit floating-point values.
DCF64 Allocates memory for one or more defined 64-bit floating-point values.
DCW Allocates memory for one or more defined 64-bit values.
DD Allocates memory for one or more defined 32-bit values.
DF Allocates memory for one or more defined 32-bit floating-point values.
DW Allocates memory for one or more defined 64-bit values.
SPACE Allocates and clears memory to zero for a specified number of bytes.

Memory Reservation

Statement Description
DS Reserves space for one or more bytes.
DSB Reserves space for one or more bytes.
DSD Reserves space for one or more 32-bit double words.
DSW Reserves space for one or more 16-bit words.

Procedure Declaration

Statement Description
ENDP Defines the end of a function.
PROC Defines the beginning of a function.

Program Linkage

Statement Description
EXTERN Defines external symbols.
EXTRN Defines external symbols.
NAME Specifies the name of the current module.
PUBLIC Defines symbols which may be used in other modules.

Segment Control

Statement Description
AREA Defines an absolute or relocateable segment.
RSEG Selects a relocateable segment previously defined.

Symbol Definition

Statement Description
EQU Sets a permanent symbol value.
LIT Assigns a text string to a symbol name.
SET Sets or resets a symbol value.

Miscellaneous

Statement Description
__ERROR__ Outputs a user-defined error message.
END Signals the end of the assembly module.
  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.