5 ASSEMBLER CONTROLS

This chapter contains the following sections:

Introduction
Overview asm51 Controls
Description of asm51 Controls
ASMLINEINFO
BYPASS
CASE
DATE
DEBUG
DEBUGINFO
EJECT
ERRORPRINT
GEN
INCLUDE
LIST
LISTALL
MACRO
MOD51
NOEXTERNALMEMORY
OBJECT
OPTIMIZE
PAGELENGTH
PAGEWIDTH
PAGING
PRINT
REGISTERBANK
SAVE/RESTORE
SMALLROM
SYMBOLS
TITLE
WORKFILES
XREF

5.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 command 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 on the command line. When you specify general controls via the command 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.

5.2 Overview asm51 Controls

Control Abbr. Type Def. Description
ASMLINEINFO AL gen Generate source line information for assembly files.
BYPASS(number) BP pri Bypass CPU functional problem.
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 033H 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.
NOEXTERNALMEMORY NOEM gen Assemble for derivatives without external memory.

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.
SMALLROM SR pri Application fits in one 2K byte block.
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 5-1: asm51 controls

5.3 Description of asm51 Controls

With controls that can be set from within EDE, you will find a mouse icon that describes the corresponding action.

ASMLINEINFO

Control:

ASMLINEINFO

From the Project menu, select Project Options... Expand the Assembler entry and select Miscellaneous. Enable the option Generate source line information for assembly files.

Abbreviation:

AL

Class:

General

Default:

-

Description:

ASMLINEINFO results in high level language source line information being generated for the assembly source. This way assembly source can be shown in a debugger allowing stepping through the source as if it is a C module. You can only use this control when the DEBUG control is in effect.

ASMLINEINFO switches off the handling of ?SYMB and ?LINE directives. Setting DEBUGINFO to a value enabling ?SYMB or ?LINE will on the other hand switch off this control. Thus setting this control on a C module already containing symbolic debug will have no effect.

Example:

asm51 debug.src ASMLINEINFO 
; generate source line information

BYPASS

Control:

BYPASS(number)

From the Project menu, select Project Options... Expand the Processor entry and select Bypasses. Enable the option Bypass DS80C390 erratum #6 (DIV AB preceded by ACC access).

Abbreviation:

BP

Class:

Primary

Default:

-

Description:

Enable bypass for certain CPU functional problems.

number is the TASKING chip erratum bypass number. Bypass number 1 bypasses DS80C390 erratum #6, and inserts an extra NOP before any DIV AB instruction.

Example:

To bypass DS80C390 erratum #6, enter:

CASE

Control:

CASE/NOCASE

From the Project menu, select Project Options... Expand the Assembler entry and select Miscellaneous. Enable the option Case sensitive assembly.

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)

From the Project menu, select Project Options... Expand the Assembler entry and select List File. Enter the date-string in the Date in header of listing file field.

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 11 characters of date-string are used. If less than 11 characters are present, asm51 pads them with blanks.

Examples:

; Jul 08 2002 in header of list file
asm51 x.src date(Jul 08 2002)

; 08-07-2002 in header of list file
asm51 x.src da(08-07-2002)

DEBUG

Control:

DEBUG/NODEBUG

From the Project menu, select Project Options... Expand the Assembler entry and select Miscellaneous. Enable or disable the option Generate symbolic debug information.

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(033H)

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:

You can only use this control when the DEBUG control is in effect.

Example:

; source lines
$di(037H)  ; 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

From the Project menu, select Project Options... Expand the Assembler entry and select List File. Enable or disable the option Generate listing in every pass.

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

NOEXTERNALMEMORY

Control:

NOEXTERNALMEMORY

From the Project menu, select Project Options... Expand the Processor entry and select Memory. Disable the option External memory access allowed.

Abbreviation:

NOEM

Class:

Primary

Default:

-

Description:

Certain derivatives like the 8xC751 have no external memory support and therefore do not allow the MOVX instruction. With this control an error message is issued whenever a MOVX instruction is encountered.

Examples:

asm51 test.src NOEXTERNALMEMORY

; issue error on MOVX instruction

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

From the Project menu, select Project Options... Expand the Assembler entry and select Miscellaneous. Enable or disable the option Optimize forwar generic JMP/CALL instructions.

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)

From the Project menu, select Project Options... Expand the Assembler entry and select List File. Enter the length in the Page length (lines per page) field.

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)

From the Project menu, select Project Options... Expand the Assembler entry and select List File. Enter the number of characters in the Page width (characters per line) field.

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

From the Project menu, select Project Options... Expand the Assembler entry and select List File. Enable or disable the option Format listing file into pages.

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

From the Project menu, select Project Options... Expand the Assembler entry and select List File. Enable or disable the option Generate list file (.lst).

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

From the Project menu, select Project Options... Expand the Assembler entry and select Miscellaneous. Specify a register bank by enabling the corresponding Register bank option.

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)

SMALLROM

Control:

SMALLROM

From the Project menu, select Project Options... Expand the Processor entry and select Memory. Enable the option ROM size limited to 2K byte (no LCALLs).

Abbreviation:

SR

Class:

Primary

Default:

-

Description:

When an application fits in a 2K byte block (or no more ROM is supported) LCALLs and LJMPs can be translated into shorter ACALL and AJMP calls. With this control the conversion will be done automaticly. You can also use this control for derivatives (like the 80C751/752) that do not support the LCALL instruction.

Example:

asm51 test.src SMALLROM

; translate LCALL/LJMP to ACALL/AJMP

SYMBOLS

Control:

SYMBOLS/NOSYMBOLS

Abbreviation:

SB/NOSB

Class:

Primary

Default:

-

Description:

Not implemented; causes a warning message.

TITLE

Control:

TITLE(title)

From the Project menu, select Project Options... Expand the Assembler entry and select List File. Enter the title in the Title of listing file field.

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.


Copyright © 2002 Altium BV