Listing control directives
Syntax
LSTCND{+|-}
LSTCOD{+|-}
LSTEXP{+|-}
LSTMAC{+|-}
LSTOUT{+|-}
LSTREP{+|-}
LSTXRF{+|-}
Description
These directives provide control over the assembler list file:
Directive | Description |
|---|---|
Controls conditional assembly listing. | |
Controls multi-line code listing. | |
Controls the listing of macro-generated lines. | |
Controls the listing of macro definitions. | |
Controls assembly-listing output. | |
Controls the listing of lines generated by repeat directives. | |
Generates a cross-reference table. |
Note
The directives COL, LSTPAGE, PAGE, and PAGSIZ are included for backward compatibility reasons—they are recognized but no action is taken.
Turning the listing on or off
Use LSTOUT- to disable all list output except error messages. This directive overrides all other listing control directives.
The default is LSTOUT+, which lists the output (if a list file was specified).
To disable the listing of a debugged section of program:
lstout-
; This section has already been debugged.
lstout+
; This section is currently being debugged.
endListing conditional code and strings
Use LSTCND+ to force the assembler to list source code only for the parts of the assembly that are not disabled by previous conditional IF statements.
The default setting is LSTCND-, which lists all source lines.
Use LSTCOD+ to list more than one line of code for a source line, if needed—that is, long ASCII strings produce several lines of output.
The default setting is LSTCOD-, which restricts the listing of output code to just the first line of code for a source line.
Using the LSTCND and LSTCOD directives does not affect code generation.
This example shows how LSTCND+ hides a call to a subroutine that is disabled by an IF directive:
name lstcndTest
extern print
rseg `.text`:CODE(2)
debug set 0
begin if debug
call print
endif
lstcnd+
begin2 if debug
call print
endif
endThis generates the following listing:
10 000000 extern print
11 000000 rseg `.text`:CODE(2)
12
13 000000 debug set 0
14 000000 begin if debug
15 call print
16 000000 endif
17
18 lstcnd+
19 000000 begin2 if debug
21 000000 endif
22
23 000000 endControlling the listing of macros
Use LSTEXP- to disable the listing of macro-generated lines. The default is LSTEXP+, which lists all macro-generated lines.
Use LSTMAC+ to list macro definitions. The default is LSTMAC-, which disables the listing of macro definitions.
This example shows the effect of LSTMAC and LSTEXP:
name lstmacTest
rseg FLASH:CODE
dec2 macro arg
addi arg, arg, -1
addi arg, arg, -1
endm
lstmac+
inc2 macro arg
addi arg, arg, 1
addi arg, arg, 1
endm
begin dec2 a0
lstexp-
inc2 a0
ret
; Restore default values for
; listing control directives.
lstmac-
lstexp+
endThis produces the following output:
10 000000 rseg FLASH:CODE
11
16
17 lstmac+
18 inc2 macro arg
19 addi arg, arg, 1
20 addi arg, arg, 1
21 endm
22
23 000000 begin dec2 a0
23.1 000000 FFF5'0513 addi a0, a0, -1
23.2 000004 FFF5'0513 addi a0, a0, -1
24 lstexp-
25 000008 inc2 a0
26 000010 0000'8067 ret
27
28 ; Restore default values for
29 ; listing control directives.
30
31 lstmac-
32 lstexp+
33
34 000014 end