Keil Logo

Listing (LST) File

The compiler listing file contains an abundance of information about the compilation process. It is composed of a number of sections, each of which is described below in the order in which they appear in the file.

Page Header

Each listing page includes a header with the compiler version number, source file name, date, time, and page number.

ARM COMPILER V1.00, MEASURE       10/01/2004 13:39:37 PAGE 1

Command Line

The entire command line that was used to invoke the compiler is included in the listing file. This often helps diagnose problems with the command line.

ARM COMPILER V1.00, COMPILATION OF MODULE MEASURE
OBJECT MODULE PLACED IN .\Obj\Measure.obj
COMPILER INVOKED BY: C:\Keil_v5\ARM\BIN\CA.exe Measure.c BROWSE DEB
                     -UG CODE SYMBOLS PRINT(.\LST\MEASURE.LST) T
                     -ABS(4) OBJECT(.\Obj\Measure.obj)

Source Code

The source code listing outputs the line number as well as the source code on that line.

You may use the COND directive to include all conditional code (code in #if blocks) in the source code listing. The NOCOND directive may be used to exclude uncompiled conditional code blocks from the listing file.

You may use the LISTINCLUDE directive to include the contents of #include files in the source code listing. By default, include file contents are not output in the listing file.

   48          char ERROR [] = "\n*** ERROR: %s\n";
   49
   50          #define WRONGINDEX 0xffff
   51
   52         /* The following function is called from */
   53         /* the interrupt service routine. */
   54         /* Save current measurements in save_record */
   55
   56          void save_current_measurements (void) {
   57   1        save_record[sindex++] = current;
   58   1        if (sindex == SCNT) sindex = 0;
   59   1        if (sindex == savefirst)  {
   60   2          if (++savefirst == SCNT)  savefirst = 0;
   61   2        }
   62   1      }
   63
   64
   65
   66         /* Timer 0 interrupt service function */
   67         /* executes each 1 msec @ 20 MHz Crystal Clock */
   68
   69          void tc0 (void) __irq {
   70   1        int i;
   71   1
   72   1        if (measurement_interval)  {
   73   2          save_current_measurements ();
   74   2          measurement_interval = 0;
   75   2        }

Externals Listing

The externals listing contains the external code and data references generated by the compiler from the C source code. This lists variables and routines that are found in other modules or libraries (and that are public symbols). The linker resolves these references at link time.

*** EXTERNALS:
 EXTERN CODE16 (getchar?T)
 EXTERN CODE16 (printf?T)
 EXTERN CODE16 (sscanf?T)
 EXTERN CODE16 (toupper?T)
 EXTERN CODE16 (init_serial?T)

Publics Listing

The publics listing contains the symbol names of code and data that are defined in the source file as public symbols. The linker uses these public symbols to resolve external references from other modules at link time.

*** PUBLICS:
 PUBLIC         menu
 PUBLIC         save_current_measurements?T
 PUBLIC         save_current_measurements?A
 PUBLIC         tc0?A
 PUBLIC         read_index?T
 PUBLIC         clear_records?T
 PUBLIC         main
 PUBLIC         ERROR

Data Listing

The data listing contains the names and data for variables defined in your source file. Constant data are stored in the ?CON?filename segment while initialized data are stored in the ?DT0?filename segment.

*** DATA SEGMENT '?CON?Measure':
 00000000          ??S_12:
 00000000            DB          'UNKNOWN COMMAND',0x00
 00000010          ??S_11:
 00000010            DB          0x0A,'Clear Measurement Records',0x0A,0x00
 0000002C          ??S_10:
 0000002C            DB          0x0A,'Quit Measurement Recording',0x0A
 00000048            DB          0x00
.
.
.
*** DATA SEGMENT '?DT0?Measure':
 0000001C          current:
 0000001C            DS          20
 00000044          setinterval:
 00000044            DS          4
 0000004C          interval:
 0000004C            DS          4
 00000054          save_record:
 00000054            DS          400
 00000374          ERROR:
 00000374           BEGIN_INIT
 00000374            DB          0x0A,'*** ERROR: %s',0x0A,0x00
 00000384           END_INIT

Assembly Listing

The assembly listing contains the assembly code generated by the compiler for the C source code. The CODE directive may be used to include the assembly listing output.

*** CODE SEGMENT '?PR?save_current_measurements?T?Measure':
   57:   save_record[sindex++] = current;
 00000000  4800      LDR         R1,=current ; current
 00000002  4800      LDR         R0,=sindex ; sindex
 00000004  6802      LDR         R2,[R0,#0x0] ; sindex
 00000006  1C13      MOV         R3,R2
 00000008  3301      ADD         R3,#0x1
 0000000A  6003      STR         R3,[R0,#0x0] ; sindex
 0000000C  2014      MOV         R0,#0x14
 0000000E  4342      MUL         R2,R0
 00000010  4800      LDR         R0,=save_record ; save_record
 00000012  1880      ADD         R0,R2 ; save_record
 00000014  2214      MOV         R2,#0x14
 00000016          L_79:
 00000016  780B      LDRB        R3,[R1,#0x0]
 00000018  7003      STRB        R3,[R0,#0x0]
 0000001A  1C49      ADD         R1,R1,#0x1
 0000001C  1C40      ADD         R0,R0,#0x1
 0000001E  1E52      SUB         R2,R2,#0x1
 00000020  D1F9      BNE         L_79  ; T=0x00000016
   58:   if (sindex == SCNT) sindex = 0;
 00000022  4800      LDR         R0,=sindex ; sindex
 00000024  6800      LDR         R0,[R0,#0x0] ; sindex
 00000026  2814      CMP         R0,#0x14
 00000028  D102      BNE         L_1  ; T=0x00000030
 0000002A  2100      MOV         R1,#0x0
 0000002C  4800      LDR         R0,=sindex ; sindex
 0000002E  6001      STR         R1,[R0,#0x0] ; sindex
 00000030          L_1:
   59:   if (sindex == savefirst)  {
 00000030  4800      LDR         R0,=savefirst ; savefirst
 00000032  6800      LDR         R0,[R0,#0x0] ; savefirst
 00000034  4800      LDR         R1,=sindex ; sindex
 00000036  6809      LDR         R1,[R1,#0x0] ; sindex
 00000038  4281      CMP         R1,R0
 0000003A  D107      BNE         L_2  ; T=0x0000004C

Warnings and Errors

Problems encountered while compiling may cause errors and/or warnings that are output to the screen and to the listing file. Refer to the Error Messages chapter for details about error and warning messages.

  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.