6 ASSEMBLER CONTROLS

This chapter contains the following sections:

Introduction
Overview asm51 Controls
Description of asm51 Controls

6.1 Introduction

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.

6.2 Overview asm51 Controls

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

6.3 Description of asm51 Controls

CASE

Control:

CASE/NOCASE

Abbreviation:

CA/NOCA

Class:

Primary

Default:

NOCASE

Description:

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).

Example:

asm51 x.src case  ; asm51 in case sensitive mode

DATE

Control:

DATE(date-string)

Abbreviation:

DA

Class:

Primary

Default:

spaces

Description:

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.

Examples:

; 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

Control:

DEBUG/NODEBUG

Abbreviation:

DB/NODB

Class:

Primary

Default:

DEBUG

Description:

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.

Example:

asm51 x.src db  ; generate debug information

DEBUGINFO

Control:

DEBUGINFO(number)

Abbreviation:

DI

Class:

General

Default:

DEBUGINFO(0BBH)

Description:

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.

Example:

; source lines
$di(0bfH)  ; also generate debug information
    ; for compiler generated labels
  .
  .

EJECT

Control:

EJECT

Abbreviation:

EJ

Class:

General

Default:

New page started when page length is reached

Description:

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.

Example:

.    ; assembler source lines
.
$eject  ; generate a formfeed
.
.    ; more source lines
$ej    ; generate a formfeed
.
. 

ERRORPRINT

Control:

ERRORPRINT(file)/NOERRORPRINT

Abbreviation:

EP/NOEP

Class:

Primary

Default:

NOERRORPRINT

Description:

ERRORPRINT redirects the error messages, normally displayed at the console, to an error list file.

Examples:

asm51 x.src ep(errlist)  ; redirect errors to
          ; file errlist

GEN/GENONLY/NOGEN

Control:

GEN/GENONLY/NOGEN

Abbreviation:

GE/GO/NOGE

Class:

General

Default:

-

Description:

These controls are ignored, since the macro preprocessor is not integrated with the assembler. They are included for compatibility.

INCLUDE

Control:

INCLUDE(file)

Abbreviation:

IC

Class:

General

Default:

-

Description:

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

Control:

LIST/NOLIST

Abbreviation:

LI/NOLI

Class:

General

Default:

LIST

Description:

Switch the listing generation on or off. These controls take effect starting at the next line. LIST does not override the NOPRINT control.

Example:

$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

Control:

LISTALL/NOLISTALL

Abbreviation:

LA/NOLA

Class:

Primary

Default:

NOLISTALL

Description:

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.

Example:

asm51 x.src listall  ;generate listing in every
        ;pass of the assembler

MACRO

Control:

MACRO/NOMACRO

Abbreviation:

MR/NOMR

Class:

Primary

Default:

-

Description:

These controls are ignored; macro expansion is done by the preprocessor. Included for compatibility.

MOD51

Control:

MOD51/NOMOD51

Abbreviation:

MO/NOMO

Class:

General

Default:

MOD51

Description:

The ASM51 assembler uses a list of predefined register-names. With NOMOD51 the list will not be used by the assembler.

Example:

asm51 x.src nomod51

; use no predefined list of register names

OBJECT

Control:

OBJECT[(file)]/NOOBJECT

Abbreviation:

OJ/NOOJ

Class:

Primary

Default:

OBJECT(sourcefile.obj)

Description:

The OBJECT control specifies an alternative name for the object file. The NOOBJECT control causes no object file to be generated.

Examples:

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

Control:

OPTIMIZE/NOOPTIMIZE

Abbreviation:

OP/NOOP

Class:

General

Default:

OPTIMIZE

Description:

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.

Example:

$noop
; turn optimization off
; source lines

$op
; turn optimization back on
; source lines

PAGELENGTH

Control:

PAGELENGTH(lines)

Abbreviation:

PL

Class:

Primary

Default:

PAGELENGTH(60)

Description:

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.

Example:

asm51 x.src pl(50)  ; set page length to 50

PAGEWIDTH

Control:

PAGEWIDTH(characters)

Abbreviation:

PW

Class:

Primary

Default:

PAGEWIDTH(104)

Description:

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.

Example:

asm51 x.src pw(130)

; set page width to 130 characters

PAGING

Control:

PAGING/NOPAGING

Abbreviation:

PI/NOPI

Class:

Primary

Default:

PAGING

Description:

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.

Example:

asm51 x.src nopi

; turn paging off: no formfeeds and page headers

PRINT

Control:

PRINT[(file)]/NOPRINT

Abbreviation:

PR/NOPR

Class:

Primary

Default:

PRINT(sourcefile.lst)

Description:

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.

Examples:

asm51 x.src      ; list file name is x.lst
asm51 x.src pr(mylist)  ; list file name is mylist

REGISTERBANK

Control:

REGISTERBANK(rb[,rb]...)/NOREGISTERBANK

Abbreviation:

RB/NORB

Class:

Primary

Default:

REGISTERBANK(0)

Description:

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.

Examples:

asm51 x.src rb(0,1,2)  ; reserve register banks
          ; 0, 1 and 2

SAVE/RESTORE

Control:

SAVE/RESTORE

Abbreviation:

SA/RS

Class:

General

Default:

-

Description:

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.

Example:

$nolist
; source lines
$save    ; save values of LIST/NOLIST

$list

$restore  ; restore value (nolist)

SYMBOLS

Control:

SYMBOLS/NOSYMBOLS

Abbreviation:

SB/NOSB

Class:

Primary

Default:

-

Description:

Not implemented; causes a warning message.

TITLE

Control:

TITLE(title)

Abbreviation:

TT

Class:

General

Default:

spaces

Description:

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.

Example:

$title(NEWTITLE)

; title in page header is NEWTITLE

WORKFILES

Control:

WORKFILES(drives)

Abbreviation:

WF

Class:

Primary

Default:

-

Description:

Ignored, included for compatibility only.

XREF

Control:

XREF/NOXREF

Abbreviation:

XR/NOXR

Class:

Primary

Default:

-

Description:

Not implemented; causes a warning message. A cross-reference table can be obtained from the source files with the ref51 utility.


Copyright © 1998 TASKING, Inc.