Assembler Controls

The A51 assembler provides a number of controls that you may use to direct the operation of the assembler. Controls are composed of one or more letters or digits and, unless otherwise indicated, may be specified on the command line after the filename or within a source file when prefixed by the dollar sign character ($). For example:
A51 TESTFILE.A51 SYMBOLS DEBUG XREF

or

$SYMBOLS
$DEBUG
$XREF

or

$SYMBOLS DEBUG XREF

In the above example, SYMBOLS, DEBUG, and XREF  are all control commands and TESTFILE.A51  is the source file to be assembled.

NOTE
Some controls cannot be specified on the command line. In addition, some controls may be specified only once at the top of the source file, while others may be specified many times throughout the source file. Regardless of how they are specified, the syntax for each control is the same when specified on the command line or when specified within the source file. The A51 assembler generates a fatal error for controls that are improperly specified.

There are four distinct groups of assembler controls: source controls, listing controls, object controls, and conditional assembly controls.
  Source controls affect the assembly source code input to A51.

  Object controls affect the form and content of the generated object module (*.OBJ). These controls allow you to include debugging and other information in the object file.

  Listing controls affect the listing file (*.LST). These controls allow you to specify the format and specific content of the listing file.

  Conditional assembly controls allow you to specify whether or not certain sections of a source module are included or excluded from assembly.

The following sections list the A51 assembler controls by function.

Source Controls

The following table lists the control statements that impact the source file.

Control

Abbreviation

Default Setting

INCLUDE

IC

None

MACRO

None

MACRO

MOD51

MO

MOD51

NOMACRO

None

MACRO

NOMOD51

NOMO

MOD51

RESTORE

RS

None

SAVE

SA

None

Listing Controls

The following table lists the control statements that affect the listing file.

Control

Abbreviation

Default Setting

COND

None

COND

DATE

DA

None

EJECT

EJ

None

ERRORPRINT

EP

NOERRORPRINT

GEN

None

GEN

LIST

LI

LIST

NOCOND

None

COND

NOERRORPRINT

NOEP

NOERRORPRINT

NOGEN

None

GEN

NOLIST

NOLI

LIST

NOPRINT

NOPR

PRINT(basename.LST)

NOSYMBOLS

NOSB

SYMBOLS

NOXREF

NOXR

NOXREF

PAGELENGTH

PL

PAGELENGTH(132)

PAGEWIDTH

PW

PAGEWIDTH(120)

PRINT

PR

PRINT(basename.LST)

SYMBOLS

SB

SYMBOLS

TITLE

TT

TITLE(basename)

XREF

XR

NOXREF

These controls may be included on the command line or in the source file. Refer to the “Control Reference” section later in this chapter for more information about these control directives.

Object Controls

The following table lists the object file control statements.

Control

Abbreviation

Default Setting

DEBUG

DB

NODEBUG

NODEBUG

NODB

NODEBUG

NOOBJECT

NOOJ

OBJECT(basename.OBJ)

NOREGISTERBANK

NORB

REGISTERBANK(0)

REGISTERBANK

RB

REGISTERBANK(0)

OBJECT

OJ

OBJECT(basename.OBJ)

These controls may be included on the command line or in the source file. Refer to the “Control Reference” section later in this chapter for more information about these control directives.

Conditional Assembly Controls

Conditional assembly controls allow you to include or exclude sections of your 8051 assembly program (based on the value of a constant expression) from the assembly. Blocks that are to be conditionally assembled are enclosed in IF, ELSEIF, ELSE, and ENDIF control statements.

The conditional control statements IF, ELSE, ELSEIF, and ENDIF may only be specified in the source program. They are not valid if specified on the command line. Additionally, these controls can be specified both with and without the leading dollar sign ($).

When prefixed by a dollar sign, the conditional control statements access only those symbols defined by the SET and RESET controls.

When specified without a dollar sign, the conditional control statements can access all symbols except those defined by the SET and RESET controls. These control statements can access parameters in a macro definition.

IF blocks may be nested up to 10 levels deep; however, if an IF, ELSEIF, or ELSE block is not assembled, any IF blocks nested therein are also not assembled.

The following table lists the conditional assembly control statements.

Control

Abbreviation

Default Setting

ELSE

None

None

ELSEIF

None

None

ENDIF

None

None

IF

None

None

RESET

None

None

SET

None

None

With the exception of SET and RESET, the above conditional assembly controls may be included only in the source file. Refer to the Control Reference section later in this chapter for more information about these directives.