Ax51 User's Guide

Directives

The Ax51 Assembler provides a number of directives you may use to control source file assembly. Directives are composed of one or more letters or digits and, unless otherwise specified, may be specified after the filename on the command line or within the source file when preceded by a dollar sign ('$'). For example:

A51 SAMPLE.A51 SYMBOLS DEBUG

or

$SYMBOLS DEBUG

or

$SYMBOLS
$DEBUG

The source file to assemble is SAMPLE.A51 and SYMBOLS and DEBUG are the directives.

Assembler directives may be divided into two groups:

  • Primary directives are specified on the assembler command line or in first few lines of the assembly source file. These directives control how the assembler behaves for the entire module. If conflicting primary directives are specified on the command line and in the source file, the command line directive takes precedence.
  • General directives may be specified on the command line or anywhere in the source file. These directives control the immediate behaviour of the assembler and may be changed during assembly.

Note

  • Syntax is the same for directives specified on the command line and those specified in the source file.
  • Some directives may not be specified on the command line. If one of these directives is specified on the command line, the assembler generates a fatal error and aborts.

The following table is an alphabetical list of the control directives available in the Ax51 Assembler.

DirectiveGroupDescription
CASEPrimaryEnables case-sensitive symbol names.
CONDGeneralIncludes (in the listing file) conditional source lines skipped by the preprocessor.
DATEPrimarySpecifies the date to use in the listing file header.
DEBUGPrimaryIncludes debugging information in the object file.
DEFINEPrimaryDefines C preprocessor symbols on the command line.
ECRMPrimaryAllow expansion of generic CALL instruction to ECALL for the NXP 80C51MX devices.
EJECT1GeneralInserts a form feed character into the listing file.
ELSEGeneralAssemble block if the condition of a previous IF is false.
ELSEIFGeneralAssemble block if condition is true and a previous IF or ELSEIF is false.
ENDIFGeneralEnds an IF block.
ERRORPRINTPrimarySpecifies the file name for error messages.
GENGeneralIncludes all macro expansions in the listing file.
IFGeneralAssemble block if condition is true.
INCDIRPrimarySets additional include file paths.
INCLUDE2GeneralIncludes the contents of another file.
LISTGeneralIncludes the assembly source text in the listing file.
MACROPrimaryEnables preprocessor expansion of standard macros.
MOD_CONTPrimaryEnables 24-bit contiguous addressing for Dallas Semiconductor devices.
MOD_MX51PrimaryEnables instruction set extensions for the NXP 80C51MX architecture.
MOD51PrimaryEnables code generation and defines SFRs for classic 8051 devices.
MPLPrimaryEnables preprocessor expansion of MPL macros.
NOAMAKEPrimaryExcludes build information from the object file.
NOCASEPrimaryDisables case-sensitive symbol names. All symbols are converted to uppercase.
NOCONDPrimaryExcludes (from the listing file) conditional source lines skipped by the preprocessor.
NODEBUGPrimaryExcludes debugging information from the object file.
NOERRORPRINTPrimaryDisables error messages output to the screen.
NOGENGeneralExcludes macro expansions from the listing file.
NOLINESPrimaryExcludes line number information from the generated object module.
NOLISTGeneralExcludes the assembly source text from the listing file.
NOMACROPrimaryDisables preprocessor expansion of standard and MPL macros.
NOMOD51PrimarySuppresses SFRs definitions for classic 8051 devices
NOMPLPrimaryDisables preprocessor expansion of MPL macros.
NOOBJECTPrimaryDisables object file generation.
NOPRINTPrimaryDisables listing file generation.
NOREGISTERBANKPrimaryDisables memory space reservation for register banks.
NOSYMBOLSPrimaryExcludes the symbol table from the listing file.
NOSYMLISTGeneralExcludes subsequently defined symbols from the symbol table.
NOXREFPrimaryExcludes the cross-reference table from the listing file.
OBJECTPrimarySpecifies the name for the object file.
PAGELENGTHPrimarySpecifies the number of lines on a page in the listing file.
PAGEWIDTHPrimarySpecifies the number of characters on a line in the listing file.
PRINTPrimarySpecifies the name for the listing file.
REGISTERBANKPrimaryReserves memory space for register banks.
REGUSEGeneralSpecifies registers modified by the specified function.
RESETGeneralSets symbols, which may be tested by IF or ELSEIF, to false.
RESTORE1GeneralRestores settings for the LIST and GEN directives.
SAVE1GeneralSaves settings for the LIST and GEN directives.
SETGeneralSets symbols, which may be tested by IF or ELSEIF, to true or a specified value.
SYMBOLSPrimaryIncludes the symbol table in the listing file.
SYMLISTGeneralIncludes subsequently defined symbols in the symbol table.
TITLEPrimarySpecifies the page header title in the listing file.
XREFPrimaryIncludes the cross-reference table in the listing file.

Note

  1. These directives may not be specified on the command line. They may only be specified in the source file.
  2. Primary directives may not be specified after an INCLUDE directive.

Related Knowledgebase Articles