Keil Logo

Control Statements

The A251 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, and DW 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
ALIGN Forces the location counter to the next 2^n alignment.
EVEN Forces the location counter to the next even address.
ORG Sets the location counter to a specifies offset or address.
USING Specifies which register bank to use.

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.

Memory Reservation

Statement Description
DBIT Reserves space for one or more bits.
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.

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.
NAME Specifies the name of the current module.
PUBLIC Defines symbols which may be used in other modules.

Segment Control

Statement Description
BSEG Defines an absolute bit segment.
CSEG Defines an absolute code segment.
DSEG Defines an absolute data segment.
ISEG Defines an absolute idata segment.
RSEG Selects a relocatable segment.
SEGMENT Defines a relocatable segment.
XSEG Defines an absolute xdata segment.

Symbol Definition

Statement Description
BIT Defines an address in bit space.
CODE Defines an address in code space.
DATA Defines an address in data space.
EBIT Defines an address in ebit space.
EQU Sets a permanent symbol value.
IDATA Defines an address in idata space.
LIT Assigns a text string to a symbol name.
SBIT Defines a bit SFR.
SET Sets or resets a symbol value.
SFR Defines a byte SFR.
SFR16 Defines a word SFR.
XDATA Defines an address in xdata space.

Miscellaneous

Statement Description
__ERROR__ Generates an 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.