A166 User's Guide

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

StatementDescription
EVENForces the location counter to the next even address.
ORGSets the location counter to a specific offset or address.

Conditional Assembly

StatementDescription
IFBegins an IF-ELSE-ENDIF block.
ELSEIFBegins an alternate IF block.
ELSEBegins an ELSE block.
ENDIFTerminates an IF block.

Group Definition

StatementDescription
CGROUPDefines a group of code sections.
DGROUPDefines a group of data sections.

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.
DBPTRAllocates memory for a bit pointer.
DPPTRAllocates memory for a page pointer.
DSPTRAllocates memory for a segment pointer.

Memory Reservation

StatementDescription
DBITReserves space for one or more bits.
DEFADefines on-chip RAM symbols.
DEFBDefines bit symbols.
DEFRDefines SFR symbols.
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.
PECDEFReserves space for a PEC channel.
REGBANKReserves space for a register bank.
REGDEFReserves space for a register bank.
SSKDEFReserves space for the system stack.

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.
GLOBALDefines global symbols.
NAMESpecifies the name of the current module.
PUBLICDefines symbols which may be used in other modules.

Section Definition

StatementDescription
ENDSMarks the end of a section.
SECTIONDefines a logical memory section.

Symbol Definition

StatementDescription
BITDefines an address in bit space.
EQUSets a permanent symbol value.
LITAssigns a text string to a symbol name.
SETSets or resets a symbol value.

Miscellaneous

StatementDescription
ASSUMESpecifies contents of DPP registers.
ENDSignals the end of the assembly module.
TYPEDECSpecifies the type for forward references symbols.