- IAR Embedded Workbench for RX 5.20
- IAR Assembler
- Assembler directives
- Description of assembler directives
- Listing control directives
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 FLASH:CODE
code
debug set 0
begin if debug
bsr print
endif
lstcnd+
begin2 if debug
bsr print
endif
endThis generates the following listing:
9 name lstcndTest
10 000000 extern print
11 000000 section FLASH:CODE
12 000000 code
13 000000 debug set 0
14 000000 begin if debug
15 bsr 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
extern memLoc
section FLASH:CODE(2)
code
dec2 macro arg
mov.l #arg,R1
mov.l [R1],R2
sub #2,R1
mov.l R2,[R1]
endm
lstmac+
inc2 macro arg
mov.l #arg,R1
mov.l [R1],R2
add #2,R2
mov.l R2,[R1]
endm
begin dec2 memLoc
lstexp-
inc2 memLoc
rts
; Restore default values for
; listing control directives.
lstmac-
lstexp+
end
This produces the following output:
9 name lstmacTest
10 000000 extern memLoc
11 000000 section FLASH:CODE(2)
12 000000 code
13
20
21 lstmac+
22 inc2 macro arg
23 mov.l #arg,R1
24 mov.l [R1],R2
25 add #2,R2
26 mov.l R2,[R1]
27 endm
28
29 000000 begin dec2 memLoc
29.1 000000 FB1200000000 mov.l #memLoc,R1
29.2 000006 EC12 mov.l [R1],R2
29.3 000008 6021 sub #2,R1
29.4 00000A E312 mov.l R2,[R1]
30 lstexp-
31 00000C inc2 memLoc
32 000018 02 rts
33 ; Restore default values for
34 ; listing control directives.
35
36 lstmac-
37 lstexp+
38
39 000019 end