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.

C51 COMPILER V7.20   MEASURE       10/01/2004 14:05:05 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.

C51 COMPILER V7.20, COMPILATION OF MODULE MEASURE
OBJECT MODULE PLACED IN Measure.OBJ
COMPILER INVOKED BY: C:\Keil_v5\C51\BIN\C51.EXE Measure.c HOLD(128,
                     -0,0) OPTIMIZE(9,SPEED) BROWSE DEBUG OBJECT
                     -EXTEND CODE LISTINCLUDE SYMBOLS

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.

  53          char code ERROR [] = "\n*** ERROR: %s\n";
  54
  55          #define PERIOD     -250
  56          #define WRONGINDEX 0xffff
  57
  58
  59          /* The following function is called from */
  60          /* the interrupt service routine. */
  61          /* Save current measurements in save_record */
  62
  63
  64          #pragma REGISTERBANK (1)
  65
  66          static void save_current_measurements (void) {
  67   1        save_record[sindex++] = current;
  68   1        if (sindex == SCNT) sindex = 0;
  69   1        if (sindex == savefirst)  {
  70   2          if (++savefirst == SCNT)  savefirst = 0;
  71   2        }
  72   1      }
  73
  74
  75          /* Timer 0 interrupt service function */
  76          /* executes each 250 usec @ 12 MHz Crystal Clock */
  77
  78          void timer0 (void) interrupt 1 using 1 {
  79   1
  80   1        unsigned char i;
  81   1
  82   1        if (measurement_interval)  {
  83   2          save_current_measurements ();
  84   2          measurement_interval = 0;
  85   2        }

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.

             ; FUNCTION save_current_measurements (BEGIN)
                                           ; SOURCE LINE # 66
                                           ; SOURCE LINE # 67
0000 0500        R     INC     sindex+01H
0002 E500        R     MOV     A,sindex+01H
0004 AE00        R     MOV     R6,sindex
0006 7002              JNZ     ?C0064
0008 0500        R     INC     sindex
000A         ?C0064:
000A 14                DEC     A
000B FF                MOV     R7,A
000C 120000      R     LCALL   L?0079
000F A809              MOV     R0,AR1
0011 FC                MOV     R4,A
0012 7D01              MOV     R5,#01H
0014 120000      R     LCALL   L?0077
                                           ; SOURCE LINE # 68
0017 E500        R     MOV     A,sindex+01H
0019 B4E80A            CJNE    A,#0E8H,?C0001
001C E500        R     MOV     A,sindex
001E B40205            CJNE    A,#02H,?C0001
0021 E4                CLR     A
0022 F500        R     MOV     sindex,A
0024 F500        R     MOV     sindex+01H,A
0026         ?C0001:
                                           ; SOURCE LINE # 69
0026 E500        R     MOV     A,sindex+01H
0028 B5001B      R     CJNE    A,savefirst+01H,?C0004
002B E500        R     MOV     A,sindex
002D B50016      R     CJNE    A,savefirst,?C0004

Symbol Listing

The symbol listing contains symbolic information about program symbols in the compiled source file. Included are symbol name, classification (SFR, structure, typedef, static, public, auto, extern), memory space, data type, offset, and size in bytes. The SYMBOLS directive may be used to include symbol listing output.

NAME                        CLASS   MSPACE  TYPE    OFFSET  SIZE
====                        =====   ======  ====    ======  ====
P4 . . . . . . . . . . . .  SFR      DATA   U_CHAR   00E8H  1
P5 . . . . . . . . . . . .  SFR      DATA   U_CHAR   00F8H  1
BD . . . . . . . . . . . .  ABSBIT   -----  BIT      00DFH  1
current. . . . . . . . . .  PUBLIC   DATA   STRUCT   0000H  11
ERROR. . . . . . . . . . .  PUBLIC   CODE   ARRAY    0416H  16
sindex . . . . . . . . . .  PUBLIC   DATA   U_INT    000BH  2
clock. . . . . . . . . . .  * TAG *  -----  STRUCT   -----  5
  hour . . . . . . . . . .  MEMBER   -----  U_CHAR   0000H  1
  min. . . . . . . . . . .  MEMBER   -----  U_CHAR   0001H  1
  sec. . . . . . . . . . .  MEMBER   -----  U_CHAR   0002H  1
  msec . . . . . . . . . .  MEMBER   -----  U_INT    0003H  2
size_t . . . . . . . . . .  TYPEDEF  -----  U_INT    -----  2
menu . . . . . . . . . . .  STATIC   CODE   ARRAY    00C7H  847
ADCON. . . . . . . . . . .  SFR      DATA   U_CHAR   00D8H  1
mdisplay . . . . . . . . .  STATIC   DATA   BIT      0001H  1
interval . . . . . . . . .  PUBLIC   DATA   STRUCT   0014H  4
interval . . . . . . . . .  * TAG *  -----  STRUCT   -----  4
  min. . . . . . . . . . .  MEMBER   -----  U_CHAR   0000H  1
  sec. . . . . . . . . . .  MEMBER   -----  U_CHAR   0001H  1
  msec . . . . . . . . . .  MEMBER   -----  U_INT    0002H  2
wchar_t. . . . . . . . . .  TYPEDEF  -----  CHAR     -----  1
_getkey. . . . . . . . . .  EXTERN   CODE   PROC     -----  -----
BSY. . . . . . . . . . . .  ABSBIT   -----  BIT      00DCH  1
_toupper . . . . . . . . .  EXTERN   CODE   PROC     -----  -----
_printf. . . . . . . . . .  EXTERN   CODE   PROC     -----  -----
_set_interval. . . . . . .  EXTERN   CODE   PROC     -----  -----
_read_index. . . . . . . .  STATIC   CODE   PROC     0000H  -----
  buffer . . . . . . . . .  AUTO     DATA   PTR      0000H  3
  index. . . . . . . . . .  AUTO     DATA   INT      0003H  2
  args . . . . . . . . . .  * REG *  DATA   U_CHAR   0007H  1
measurement_interval . . .  STATIC   DATA   BIT      0002H  1

Module Information

The module information provides the size of initialized and uninitialized memory areas defined by the source file.

MODULE INFORMATION:   STATIC OVERLAYABLE
   CODE SIZE        =    902    ----
   CONSTANT SIZE    =   1062    ----
   XDATA SIZE       =   8184    ----
   PDATA SIZE       =   ----    ----
   DATA SIZE        =     24       8
   IDATA SIZE       =   ----      15
   BIT SIZE         =      3    ----
END OF MODULE INFORMATION.

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 topic 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.