Understanding the compiler list file

The assembler and source listing is used to correlate any C source line with the corresponding assembler lines.

The following is a portion of the list file, created by the cc command, for the demonstration kernel extension. This information is included in the compilation listing because the -qsource option for the cc command was used. The left column is the line number in the following source code:

    .
    .
   63 |                 case 1:  /* Increment */
   64 |                         sprintf(buf, "Before increment: j=%d demokext_j=%d\n",
   65 |                                 j, demokext_j);
   66 |                         write_log(fpp, buf, &bytes_written);
   67 |                         demokext_j++;
   68 |                         j++;
   69 |                         sprintf(buf, "After increment: j=%d demokext_j=%d\n",
   70 |                                 j, demokext_j);
   71 |                         write_log(fpp, buf, &bytes_written);
   72 |                         break;
    .
    .

The assembler listing for the corresponding C code included in the compilation listing because the -qlist option was used with the cc command is as follows:

 .
 .
64| 0000B0 l   80BF0030  2  L4A  gr5=j(gr31,48)
64| 0000B4 l   83C20008  1  L4A  gr30=.demokext_j(gr2,0)
64| 0000B8 l   80DE0000  2  L4A  gr6=demokext_j(gr30,0)
64| 0000BC ai  30610048  1  AI   gr3=gr1,72
64| 0000C0 ai  309F005C  1  AI   gr4=gr31,92
64| 0000C4 bl  4BFFFF3D  0  CALL gr3=sprintf,4,buf",gr3,""5",gr4-gr6,sprintf",gr1,cr[01567]",gr0",gr4"-gr12",fp0"-fp13"
64| 0000C8 cror 4DEF7B82  1
66| 0000CC l   80610040  1  L4A  gr3=fpp(gr1,64)
66| 0000D0 ai  30810048  1  AI   gr4=gr1,72
66| 0000D4 ai  30A100AC  1  AI   gr5=gr1,172
66| 0000D8 bl  4800018D  0  CALL gr3=write_log,3,gr3,buf",gr4,bytes_written",gr5,write_log",gr1,cr[01567]",gr0",gr4"-gr12",fp0"-fp13"
66| 0000DC cal 387E0000  2  LR   gr3=gr30
67| 0000E0 l   80830000  1  L4A  gr4=demokext_j(gr3,0)
67| 0000E4 ai  30840001  2  AI   gr4=gr4,1
67| 0000E8 st  90830000  1  ST4A demokext_j(gr3,0)=gr4
68| 0000EC l   809F0030  1  L4A  gr4=j(gr31,48)
68| 0000F0 ai  30A40001  2  AI   gr5=gr4,1
68| 0000F4 st  90BF0030  1  ST4A j(gr31,48)=gr5
69| 0000F8 l   80C30000  1  L4A  gr6=demokext_j(gr3,0)
69| 0000FC ai  30610048  1  AI   gr3=gr1,72
69| 000100 ai  309F0084  1  AI   gr4=gr31,132
69| 000104 bl  4BFFFEFD  0  CALL gr3=sprintf,4,buf",gr3,""6",gr4-gr6,sprintf",gr1,cr[01567]",gr0",gr4"-gr12",fp0"-fp13"
69| 000108 cror 4DEF7B82  1
71| 00010C l   80610040  1  L4A  gr3=fpp(gr1,64)
71| 000110 ai  30810048  1  AI   gr4=gr1,72
71| 000114 ai  30A100AC  1  AI   gr5=gr1,172
71| 000118 bl  4800014D  0  CALL gr3=write_log,3,gr3,buf",gr4,bytes_written",gr5,write_log",gr1,cr[01567]",gr0",gr4"-gr12",fp0"-fp13"
72| 00011C b   48000098  1  B    CL.8,-1
 .
 .

With both the assembler listing and the C source listing, the assembly instructions associated with each C statement can be found. For example, compare the following C source line at line 67 of the demonstration kernel extension

   67 |                         demokext_j++;

With the following assembler instructions:

67| 0000E0 l        80830000   1     L4A      gr4=demokext_j(gr3,0)
67| 0000E4 ai       30840001   2     AI       gr4=gr4,1
67| 0000E8 st       90830000   1     ST4A     demokext_j(gr3,0)=gr4

The offsets of these instructions within the demonstration kernel extension (demokext) are 0000E0, 0000E4, and 0000E8.