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
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.
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
With controls that can be set from within EDE, you will
find a mouse icon that describes the corresponding action.
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.
AL
General
-
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.
asm51 debug.src ASMLINEINFO ; generate source line information
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).
BP
Primary
-
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.
To bypass DS80C390 erratum #6, enter:
asm51 test.src bp(1)
CASE/NOCASE
From the Project menu, select Project Options... Expand the Assembler entry and select Miscellaneous. Enable the option Case sensitive assembly.
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)
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.
DA
Primary
spaces
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.
; 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/NODEBUG
From the Project menu, select Project Options... Expand the Assembler entry and select Miscellaneous. Enable or disable the option Generate symbolic debug information.
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(033H)
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.
; source lines $di(037H) ; 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
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.
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
NOEXTERNALMEMORY
From the Project menu, select Project Options... Expand the Processor entry and select Memory. Disable the option External memory access allowed.
NOEM
Primary
-
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.
asm51 test.src NOEXTERNALMEMORY ; issue error on MOVX instruction
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
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.
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)
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.
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)
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.
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
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.
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
From the Project menu, select Project Options... Expand the Assembler entry and select List File. Enable or disable the option Generate list file (.lst).
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
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.
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)
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).
SR
Primary
-
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.
asm51 test.src SMALLROM ; translate LCALL/LJMP to ACALL/AJMP
SYMBOLS/NOSYMBOLS
SB/NOSB
Primary
-
Not implemented; causes a warning message.
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.
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.