A251 User's Guide

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

StatementDescription
EVENForces the location counter to the next even address.
ORGSets the location counter to a specifies offset or address.
USINGSpecifies which register bank to use.

Memory Initialization

StatementDescription
DBAllocates memory for one or more defined byte values.
DDAllocates memory for one or more defined double word values.
DWAllocates memory for one or more defined word values.

Memory Reservation

StatementDescription
DBITReserves space for one or more bits.
DSReserves space for one or more bytes.
DSBReserves space for one or more bytes.
DSDReserves space for one or more double words.
DSWReserves space for one or more words.

Procedure Declaration

StatementDescription
ENDPDefines the end of a function.
LABELAssigns an address to a symbolic name.
PROCDefines the beginning of a function.

Program Linkage

StatementDescription
EXTERNDefines external symbols.
EXTRNDefines external symbols.
NAMESpecifies the name of the current module.
PUBLICDefines symbols which may be used in other modules.

Segment Control

StatementDescription
BSEGDefines an absolute bit segment.
CSEGDefines an absolute code segment.
DSEGDefines an absolute data segment.
ISEGDefines an absolute idata segment.
RSEGSelects a relocatable segment.
SEGMENTDefines a relocatable segment.
XSEGDefines an absolute xdata segment.

Symbol Definition

StatementDescription
BITDefines an address in bit space.
CODEDefines an address in code space.
DATADefines an address in data space.
EQUSets a permanent symbol value.
IDATADefines an address in idata space.
LITAssigns a text string to a symbol name.
SBITDefines a bit SFR.
SETSets or resets a symbol value.
SFRDefines a byte SFR.
SFR16Defines a word SFR.
XDATADefines an address in xdata space.

Miscellaneous

StatementDescription
__ERROR__Generates an error message.
ENDSignals the end of the assembly module.