SPRU513Z August 2001 – October 2023 SM320F28335-EP
Start/Stop Source Listing
.list
.nolist
Two directives enable you to control the printing of the source listing:
The .list directive allows the printing of the source listing.
The .nolist directive suppresses the source listing output until a .list directive is encountered. The .nolist directive can be used to reduce assembly time and the source listing size. It can be used in macro definitions to suppress the listing of the macro expansion.
The assembler does not print the .list or .nolist directives or the source statements that appear after a .nolist directive. However, it continues to increment the line counter. You can nest the .list/.nolist directives; each .nolist needs a matching .list to restore the listing.
By default, the source listing is printed to the listing file; the assembler acts as if the .list directive had been used. However, if you do not request a listing file when you invoke the assembler by including the --asm_listing option on the command line (see Section 4.3), the assembler ignores the .list directive.
This example shows how the .copy directive inserts source statements from another file. The first time .copy is encountered, the assembler lists the copied source lines in the listing file. The second time .copy is encountered, the assembler does not list the copied source lines, because a .nolist directive was assembled. The .nolist, the second .copy, and the .list directives do not appear in the listing file. Also the line counter is incremented, even when source statements are not listed.
Source file:
copy.asm (source file) |
copy2.asm (copy file) |
---|---|
|
|
Listing file:
1 .copy "copy2.asm"
1 *In copy2.asm (copy file)
2 000000 0020 .word 32, 1 + 'A'
000001 0042
2 * Back in original file
3 000002 7700 NOP
7 * Back in original file
8 000005 0044 .string "Done"
000006 006F
000007 006E
000008 0065