This chapter contains the following sections:
Introduction
Overview
asm51 Controls
Description
of asm51 Controls
Assembler controls are provided to alter the default behavior of the assembler. They can be specified on the command line or on 'control lines', embedded in the source file. A control line is a line with a dollar sign ($) on the first position. Such a line is not processed like a normal assembly source line, but as an assembler control line. Zero or more controls per source line are allowed. An assembler control line may contain comments.
The controls are classified as: primary or general.
Primary controls affect the overall behavior of the assembler and remain in effect throughout the assembly. For this reason, primary controls may only be used on the invocation line or at the beginning of a source file, before the assembly starts. If you specify a primary control more than once, a warning message is given and the last definition is used. This enables you to override primary controls via the invocation line.
General controls are used to control the assembler during assembly. Control lines containing general controls may appear anywhere in a source file and are also allowed in the invocation. When you specify general controls via the invocation line the corresponding general controls in the source file are ignored.
The controls GEN, NOGEN, GENONLY and INCLUDE are implemented in the macro preprocessor. If one of these controls is encountered, the assembler generates a warning.
On the next pages, an overview is given of all the assembler controls, followed by a detailed description the available assembler controls, listed in alphabetic order. Some controls have separate versions for turning an option on and off. These controls are described together.
Some controls are set by default, and some controls have a default value.
The examples in this chapter are given for the PC environment.
Control | Abbr. | Type | Def. | Description |
CASE NOCASE | CA NOCA | pri pri | NOCA | All user names are case sensitive. User names are not case sensitive. |
DATE(date-string) | DA | pri | spaces | Set date in header of list file. |
DEBUG NODEBUG | DB NODB | pri pri | DB | Produce symbolic debug information. Do not produce symbolic debug info. |
DEBUGINFO(number) | DI | gen | 0bbH | Specify amount of debug info. |
EJECT | EJ | gen | Generate formfeed in list file. | |
ERRORPRINT(err-file) NOERRORPRINT | EP NOEP | pri pri | NOEP | Print errors to named file. No error printing. |
GEN GENONLY NOGEN | GE GO NOGE | gen gen gen | Implemented with macro processor1 Implemented with macro processor1 Implemented with macro processor1 | |
INCLUDE(inc-file) | IC | gen | Implemented with macro processor1 | |
LIST NOLIST | LI NOLI | gen gen | LI | Resume listing. Stop listing. |
LISTALL NOLISTALL | LA NOLA | pri pri | NOLA | List in every pass. Do not list in every pass. |
MACRO NOMACRO | MR NOMR | pri pri | Implemented with macro processor1 Implemented with macro processor1 | |
MOD51 NOMOD51 | MO NOMO | gen gen | MO | Use predefined register names. Predefined list not used. |
OBJECT[(file)] NOOBJECT | OJ NOOJ | pri pri | src.obj | Alternative name for object file. Do not produce an object file. |
OPTIMIZE NOOPTIMIZE | OP NOOP | gen gen | OP | Turn optimization on. Turn optimization off. |
PAGELENGTH(length) | PL | pri | 60 | Set list page length. |
PAGEWIDTH(width) | PW | pri | 104 | Set list page width. |
PAGING NOPAGING | PI NOPI | pri pri | PI | Format print file into pages. Do not format print file into pages. |
PRINT[(print-file)] NOPRINT | PR NOPR | pri pri | src.lst | Define print file name. Do not create a print file. |
REGISTERBANK(rb[,rb]...) NOREGISTERBANK | RB NORB | pri pri | 0 | Specified register banks used. Reserve no memory for register banks |
RESTORE SAVE | RE SA | gen gen | Restore saved listing control. Save listing control. | |
SYMBOLS NOSYMBOLS | SB NOSB | pri pri | Not implemented; causes a warning. Not implemented; causes a warning. | |
TITLE(title) | TT | gen | spaces | Set list page header title. |
WORKFILES(drives) | WF | pri | Ignored1 | |
XREF NOXREF | XR NOXR | pri pri | Not implemented; causes a warning. Not implemented; causes a warning. | |
Abbr.: Abbreviation of the control. Type: Type of control: pri for primary controls, gen for general controls. Def.: Default. 1 This control is only implemented for compatibility, the assembler will ignore the control. |
Table 6-1: asm51 controls
CASE/NOCASE
CA/NOCA
Primary
NOCASE
Selects whether the assembler operates in case sensitive mode or not. In case insensitive mode the assembler maps characters on input to uppercase. (literal strings excluded).
asm51 x.src case ; asm51 in case sensitive mode
DATE(date-string)
DA
Primary
spaces
asm51 uses the specified date-string as the date in the header of the list file. Only the first 9 characters of date-string are used. If less than 9 characters are present, asm51 pads them with blanks.
; Nov 25 92 in header of list file asm51 x.src date(Nov 25 92) ; 25-11-92 in header of list file asm51 x.src da(25-11-92)
DEBUG/NODEBUG
DB/NODB
Primary
DEBUG
Controls the generation of debugging information in the object file. DEBUG enables the generation of debugging information and NODEBUG disables it. When DEBUG is set, the amount of symbolic debug information is determined by the DEBUGINFO control.
asm51 x.src db ; generate debug information
DEBUGINFO(number)
DI
General
DEBUGINFO(0BBH)
DEBUGINFO specifies the amount of symbolic debug information which is generated when DEBUG is in effect. Each bit in number (hex. or octal representation) corresponds to a different type of information, according to the list below. The default settings are shown in parentheses:
The DEBUGINFO control also sets DEBUG.
; source lines $di(0bfH) ; also generate debug information ; for compiler generated labels . .
EJECT
EJ
General
New page started when page length is reached
The current page is terminated with a formfeed after the current (control) line, the page number is incremented and a new page is started. Ignored if NOPAGING, NOPRINT or NOLIST is in effect.
. ; assembler source lines . $eject ; generate a formfeed . . ; more source lines $ej ; generate a formfeed . .
ERRORPRINT(file)/NOERRORPRINT
EP/NOEP
Primary
NOERRORPRINT
ERRORPRINT redirects the error messages, normally displayed at the console, to an error list file.
asm51 x.src ep(errlist) ; redirect errors to ; file errlist
GEN/GENONLY/NOGEN
GE/GO/NOGE
General
-
These controls are ignored, since the macro preprocessor is not integrated with the assembler. They are included for compatibility.
INCLUDE(file)
IC
General
-
The INCLUDE control is interpreted by the macro preprocessor, and will be deleted when the include is performed. When this control is recognized by the assembler, it causes an error message because the user apparently forgot to run the source through the macro preprocessor.
LIST/NOLIST
LI/NOLI
General
LIST
Switch the listing generation on or off. These controls take effect starting at the next line. LIST does not override the NOPRINT control.
$noli ; Turn listing off. These lines are not ; present in the list file . . $list ; Turn listing back on. These lines are ; present in the list file . .
LISTALL/NOLISTALL
LA/NOLA
Primary
NOLISTALL
The LISTALL control causes a listing to be generated in every pass of the assembler instead of just in pass 3. This can be useful for getting a listing with error messages, even when the assembler does not perform pass 3 due to errors occurring in pass 1 or 2. LISTALL overrules a following NOPRINT. PRINT is only effective when it is specified before LISTALL.
asm51 x.src listall ;generate listing in every ;pass of the assembler
MACRO/NOMACRO
MR/NOMR
Primary
-
These controls are ignored; macro expansion is done by the preprocessor. Included for compatibility.
MOD51/NOMOD51
MO/NOMO
General
MOD51
The ASM51 assembler uses a list of predefined register-names. With NOMOD51 the list will not be used by the assembler.
asm51 x.src nomod51 ; use no predefined list of register names
OBJECT[(file)]/NOOBJECT
OJ/NOOJ
Primary
OBJECT(sourcefile.obj)
The OBJECT control specifies an alternative name for the object file. The NOOBJECT control causes no object file to be generated.
asm51 x.src ; generate object file x.obj asm51 x.src oj(x1) ; generate object file x1 asm51 x.src nooj ; do not generate object file
OPTIMIZE/NOOPTIMIZE
OP/NOOP
General
OPTIMIZE
NOOPTIMIZE turns off the optimization for forward generic jmp and call instructions. Normally the assembler tries to select a sjmp, ajmp or acall instruction for a generic jmp/call in an absolute or relocatable INBLOCK segment, even with forward references. If the optimization is turned off, a forward generic jmp is always translated to an ljmp and call is translated to lcall.
$noop ; turn optimization off ; source lines $op ; turn optimization back on ; source lines
PAGELENGTH(lines)
PL
Primary
PAGELENGTH(60)
Sets the maximum number of lines on one page of the listing file. This number does not include the lines used by the page header (4), but it does include lines with error messages.
asm51 x.src pl(50) ; set page length to 50
PAGEWIDTH(characters)
PW
Primary
PAGEWIDTH(104)
Sets the maximum number of characters on one line in the listing. Lines exceeding this width are wrapped around on the next lines in the listing. The valid range for the PAGEWIDTH control is 64 - 255. Although greater values for this control are not rejected by the assembler, lines are truncated if they exceed the length of 255.
asm51 x.src pw(130) ; set page width to 130 characters
PAGING/NOPAGING
PI/NOPI
Primary
PAGING
Turn the generation of formfeeds and page headers in the listing file on or off. If paging is turned off, the EJECT control is ignored.
asm51 x.src nopi ; turn paging off: no formfeeds and page headers
PRINT[(file)]/NOPRINT
PR/NOPR
Primary
PRINT(sourcefile.lst)
The PRINT control specifies an alternative name for the listing file. The NOPRINT control causes no listing file to be generated. NOPRINT overrules a following LISTALL.
asm51 x.src ; list file name is x.lst asm51 x.src pr(mylist) ; list file name is mylist
REGISTERBANK(rb[,rb]...)/NOREGISTERBANK
RB/NORB
Primary
REGISTERBANK(0)
Specifies the register banks used in the current source module. This information is used by the linker to allocate the memory containing the register banks. NORB specifies that no memory is initially reserved for register banks. The USING assembler directive also reserves register banks.
asm51 x.src rb(0,1,2) ; reserve register banks ; 0, 1 and 2
SAVE/RESTORE
SA/RS
General
-
SAVE stores the current value of the LIST/NOLIST controls onto a stack. RESTORE restores the most recently SAVEd value; it takes effect starting at the next line. SAVEs can be nested to a depth of 16.
$nolist ; source lines $save ; save values of LIST/NOLIST $list $restore ; restore value (nolist)
SYMBOLS/NOSYMBOLS
SB/NOSB
Primary
-
Not implemented; causes a warning message.
TITLE(title)
TT
General
spaces
Sets the title which is to be used in the page headings of the list file. To ensure that the title is printed in the header of the first page, the control has to be specified in the first source line. The title string is truncated to 60 characters. If the page width is too small for the title to fit in the header, it will be truncated even further.
$title(NEWTITLE) ; title in page header is NEWTITLE
WORKFILES(drives)
WF
Primary
-
Ignored, included for compatibility only.
XREF/NOXREF
XR/NOXR
Primary
-
Not implemented; causes a warning message. A cross-reference table can be obtained from the source files with the ref51 utility.