SPRUI04F july 2015 – april 2023
The compiler tools include a feature that interlists C/C++ source statements into the assembly language output of the compiler. The interlist feature enables you to inspect the assembly code generated for each C statement. The interlist behaves differently, depending on whether or not the optimizer is used, and depending on which options you specify.
The easiest way to invoke the interlist feature is to use the --c_src_interlist option. To compile and run the interlist on a program called function.c, enter:
cl6x --c_src_interlist function
The --c_src_interlist option prevents the compiler from deleting the interlisted assembly language output file. The output assembly file, function.asm, is assembled normally.
When you invoke the interlist feature without the optimizer, the interlist runs as a separate pass between the code generator and the assembler. It reads both the assembly and C/C++ source files, merges them, and writes the C/C++ statements into the assembly file as comments.
For information about using the interlist feature with the optimizer, see Section 4.16. Using the --c_src_interlist option can cause performance and/or code size degradation.
The following example shows a typical interlisted assembly file.
_main:
STW .D2 B3,*SP--(12)
STW .D2 A10,*+SP(8)
;------------------------------------------------------------------------------
; 5 | printf("Hello, world\n");
;------------------------------------------------------------------------------
B .S1 _printf
NOP 2
MVKL .S1 SL1+0,A0
MVKH .S1 SL1+0,A0
|| MVKL .S2 RL0,B3
STW .D2 A0,*+SP(4)
|| MVKH .S2 RL0,B3
RL0: ; CALL OCCURS
;------------------------------------------------------------------------------
; 6 | return 0;
;------------------------------------------------------------------------------
ZERO .L1 A10
MV .L1 A10,A4
LDW .D2 *+SP(8),A10
LDW .D2 *++SP(12),B3
NOP 4
B .S2 B3
NOP 5
; BRANCH OCCURS