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.
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.
The following table lists the control statements that impact the source file.
Control |
Abbreviation |
Default Setting |
IC |
None |
|
None |
MACRO |
|
MO |
MOD51 |
|
None |
MACRO |
|
NOMO |
MOD51 |
|
RS |
None |
|
SA |
None |
|
The following table lists the control statements that affect the listing file.
Control |
Abbreviation |
Default Setting |
None |
COND |
|
DA |
None |
|
EJ |
None |
|
EP |
NOERRORPRINT |
|
None |
GEN |
|
LI |
LIST |
|
None |
COND |
|
NOEP |
NOERRORPRINT |
|
None |
GEN |
|
NOLI |
LIST |
|
NOPR |
PRINT(basename.LST) |
|
NOSB |
SYMBOLS |
|
NOXR |
NOXREF |
|
PL |
PAGELENGTH(132) |
|
PW |
PAGEWIDTH(120) |
|
PR |
PRINT(basename.LST) |
|
SB |
SYMBOLS |
|
TITLE |
TT |
TITLE(basename) |
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.
The following table lists the object file control statements.
Control |
Abbreviation |
Default Setting |
DB |
NODEBUG |
|
NODB |
NODEBUG |
|
NOOJ |
OBJECT(basename.OBJ) |
|
NORB |
REGISTERBANK(0) |
|
RB |
REGISTERBANK(0) |
|
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 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 |
None |
None |
|
None |
None |
|
None |
None |
|
None |
None |
|
None |
None |
|
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.