Running the Assembler

You invoke the ASSEMBLER by selecting TRANSLATE, MAKE, or BUILD ALL from the Project menu in proview. The TRANSLATE command will assemble only the source file that is selected in the the project window. The MAKE command will compile and link all changed files in the project. The BUILD ALL command will compile, assemble and link all of the files in the project.

To invoke the Assembler, you enter A51 at the DOS prompt. The command line must contain the name of the 8051 assembly source file to be assembled as well as any required command-line controls. The format for the A51 assembler command line is:
A51 sourcefile ¤ controls

where sourcefile  is the name of the source program you want to assemble. The A51 assembler controls  are used to direct the operation of the assembler. Refer to the “Assembler Controls” section later in this chapter for more information.

The following command line example invokes A51, specifies the source file SAMPLE.A51,  and uses the controls DEBUG, XREF, and PAGEWIDTH.
A51 SAMPLE.A51 DEBUG XREF PAGEWIDTH(132)

The A51 assembler displays the following information upon successful invocation and assembly.

MS-DOS MCS-51 MACRO ASSEMBLER A51 V6
(C) Franklin Software Inc. 1988-1996

ASSEMBLY COMPLETE, NO ERRORS FOUND

Long Command Lines

To specify more controls than will fit on the command line, use the ampersand character (&) at the end of a line to indicate that more command-line controls are required. The A51 assembler responds by displaying two greater-than signs (>>) on the next line where you may continue to enter additional controls.

For example:
A51 SAMPLE.A51 MACRO COND MOD51 &
>>XREF SYMBOLS

Command Files

Command files are ASCII text files that contain information you would normally type on the command line. Command files can include the name of the source file to assemble as well as any assembler controls.

Using an at sign (@), you may specify a command file on the command line. For example:
A51 @CMDFIL

The contents of the file CMDFIL  are interpreted as one long input command line. The command file may contain up to 10,000 characters.

DOS ERRORLEVEL

After assembly, the number of errors and warnings detected is output to the screen. The A51 assembler then sets the DOS ERRORLEVEL  to indicate the status of the assembly.
ERRORLEVEL values are listed in the following table:

ERRORLEVEL Meaning
    0 No ERRORS or WARNINGS
    1 WARNINGS only
    2 ERRORS and possibly also WARNINGS
    3 FATAL ERRORS

You may access the ERRORLEVEL  variable in DOS batch files. Refer to your DOS User’s Guide for more information about ERRORLEVEL  or batch files.