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
section .text:CODE(2)
debug set 0
begin if debug
jarl print,lp
endif
lstcnd+
begin2 if debug
jarl print
endif
endThis generates the following listing:
13 name
lstcndTest
14 000000 extern print
15 000000 section .text:CODE(2)
16
17 000000 debug set 0
18 000000 begin if debug
19 jarl print,lp
20 000000 endif
21
22 lstcnd+
23 000000 begin2 if debug
25 000000 endif
26
27 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
extern memLoc
section .text:CODE(2)
dec2: macro arg
mov arg,r6
ld.w 0[r6],r7
add 2,r7
st.w r7,0[r6]
endm
lstmac+
inc2: macro arg
mov arg,r6
ld.w 0[r6],r7
add -2,r7
st.w r7,0[r6]
endm
begin: dec2 memLoc
lstexp-
inc2 memLoc
jmp [lp]
; Restore default values for
; listing control directives.
lstmac-
lstexp+
endThis produces the following output:
1 NAME dec2
2
3 dec2 MACRO arg
4 subw $2,arg
5 ENDM
6
7 000000 LSTMAC+
8
9
10 000000 begin: dec2 R6
10.1 000000 263A subw $2,R6
11
12 000000 LSTEXP-
13 000002 inc2 R7
14
15
16 000000 ; restore defaults
17 000000 LSTMAC-
18 000000 LSTEXP+
19
20 000004 END