Keil Logo

Control Statements

The A166 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
EVEN Forces the location counter to the next even address.
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.

Group Definition

Statement Description
CGROUP Defines a group of code sections.
DGROUP Defines a group of data sections.

Memory Initialization

Statement Description
DB Allocates memory for one or more defined byte values.
DD Allocates memory for one or more defined double word values.
DW Allocates memory for one or more defined word values.
DBPTR Allocates memory for a bit pointer.
DPPTR Allocates memory for a page pointer.
DSPTR Allocates memory for a segment pointer.

Memory Reservation

Statement Description
DBIT Reserves space for one or more bits.
DEFA Defines on-chip RAM symbols.
DEFB Defines bit symbols.
DEFR Defines SFR symbols.
DS Reserves space for one or more bytes.
DSB Reserves space for one or more bytes.
DSD Reserves space for one or more double words.
DSW Reserves space for one or more words.
PECDEF Reserves space for a PEC channel.
REGBANK Reserves space for a register bank.
REGDEF Reserves space for a register bank.
SSKDEF Reserves space for the system stack.

Procedure Declaration

Statement Description
ENDP Defines the end of a function.
LABEL Assigns an address to a symbolic name.
PROC Defines the beginning of a function.

Program Linkage

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

Section Definition

Statement Description
ENDS Marks the end of a section.
SECTION Defines a logical memory section.

Symbol Definition

Statement Description
BIT Defines an address in bit space.
EQU Sets a permanent symbol value.
LIT Assigns a text string to a symbol name.
SET Sets or resets a symbol value.


Statement Description
ASSUME Specifies contents of DPP registers.
END Signals the end of the assembly module.
TYPEDEC Specifies the type for forward references symbols.
  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.