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.

C166 COMPILER V5.00, MEASURE       01/11/2004 16:16:23 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.

C166 COMPILER V5.00, COMPILATION OF MODULE MEASURE
OBJECT MODULE PLACED IN .\Object\Measure.obj
COMPILER INVOKED BY: C:\Keil_v5\C166\BIN\C166.EXE Measure.c REGFILE
                     -(.\Object\measure.ORC) BROWSE MOD167 DEBUG
                     -CODE LISTINCLUDE SYMBOLS PRINT(.\Listing\M
                     -easure.lst) PREPRINT(.\Listing\Measure.i)
                     -OBJECT(.\Object\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.

   46         const char ERROR [] = "\n*** ERROR: %s\n";
   47
   48         #define PERIOD     -2500
   49         #define WRONGINDEX 0xffff
   50
   51
   52         /* The following function is called from */
   53         /* the interrupt service routine. */
   54         /* Save current measurements in save_record */
   55
   56         static void save_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 @ 40 MHz Crystal Clock */
   68
   69         static void timer0(void) interrupt 0x20 using INTREGS {
   70  1      /* Int Vector at 0080H, other Reg Bank */
   71  1
   72  1        unsigned char i;
   73  1
   74  1        if (measurement_interval)  {
   75  2          save_measurements ();
   76  2          measurement_interval = 0;
   77  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_measurements (BEGIN  RMASK = @0x40D0)
                                           ; SOURCE LINE # 56
                                           ; SOURCE LINE # 57
0000 F2F40A20 R    MOV       R4,sindex
0004 248F0A20 R    SUB       sindex,ONES
0008 5C44          SHL       R4,#04H
000A E6F60A00 R    MOV       R6,#save_record
000E 0064          ADD       R6,R4
0010 E6F40C20 R    MOV       R4,#current
0014 E6F71000      MOV       R7,#010H
0018         ?C0078:
0018 E864          MOV       [R6],[R4+]
001A 0862          ADD       R6,#02H
001C 2872          SUB       R7,#02H
001E 3DFC          JMPR      cc_NZ,?C0078
                                           ; SOURCE LINE # 58
0020 F2F40A20 R    MOV       R4,sindex
0024 46F40002      CMP       R4,#0200H
0028 3D02          JMPR      cc_NZ,?C0001
002A F68E0A20 R    MOV       sindex,ZEROS
002E         ?C0001:
                                           ; SOURCE LINE # 59
002E F2F40400 R    MOV       R4,savefirst
0032 42F40A20 R    CMP       R4,sindex
0036 3D09          JMPR      cc_NZ,?C0002

In the assembly listing, function headers include a comment with a compiler-generated register mask (RMASK = @0x40D0). Function masks are used when global register optimization is enabled by the REGFILE directive. The register mask is a 16-bit number that indicates which registers are used by a function. Each bit in the mask refers to one register. The encoding for the register mask is as follows:

Bit Position
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
-- DPP3 MDx R12 R11 R10 R9 R8 R7 R6 R5 R4 R3 R2 R1 DPP0

Two special values of the register mask specify all registers or no registers:

  • 0x0000 specifies that the function uses all registers.
  • 0x8000 specifies that the function uses no registers.

For example, a register mask value of 0x40D0 indicates that the function uses DPP3, R7, R6, and R4.

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    SPACE  TYPE   OFFSET   SIZE
--------------------------------------------------------------------
wchar_t. . . . . . . . . . . .  typedef         char   -----    1
interval . . . . . . . . . . .  --tag--         struct -----    4
  min. . . . . . . . . . . . .  member          uchar     0H    1
  sec. . . . . . . . . . . . .  member          uchar     1H    1
  msec . . . . . . . . . . . .  member          uint      2H    2
PSW. . . . . . . . . . . . . .  sfr             uint   FF10H    2
S0RIR. . . . . . . . . . . . .  absbit          bit    FF6EH.7  1
T8REL. . . . . . . . . . . . .  sfr             uint   F056H    2
T7REL. . . . . . . . . . . . .  sfr             uint   F054H    2
WDT. . . . . . . . . . . . . .  sfr             uint   FEAEH    2
IEN. . . . . . . . . . . . . .  absbit          bit    FF10H.11 1
sscanf . . . . . . . . . . . .  extern   NCODE  funct  -----
toupper. . . . . . . . . . . .  extern   NCODE  funct  -----
printf . . . . . . . . . . . .  extern   NCODE  funct  -----
set_interval . . . . . . . . .  extern   NCODE  funct  -----
measure_display. . . . . . . .  extern   NCODE  funct  -----
set_time . . . . . . . . . . .  extern   NCODE  funct  -----
getline. . . . . . . . . . . .  extern   NCODE  funct  -----
_getkey. . . . . . . . . . . .  extern   NCODE  funct  -----
clear_records. . . . . . . . .  static   NCODE  funct  -----
  idx. . . . . . . . . . . . .  --reg--         uint   -----    2
timer0 . . . . . . . . . . . .  static   NCODE  funct  -----
  i. . . . . . . . . . . . . .  --reg--         uchar  -----    1
save_measurements. . . . . . .  static   NCODE  funct  -----
main . . . . . . . . . . . . .  public   NCODE  funct  -----
  cmdbuf . . . . . . . . . . .  static   NDATA0 array  201CH    15
  i. . . . . . . . . . . . . .  --reg--         uchar  -----    1
  idx. . . . . . . . . . . . .  --reg--         uint   -----    2
read_index . . . . . . . . . .  static   NCODE  funct  -----
  buffer . . . . . . . . . . .  --reg--         ptr    -----    2
  index. . . . . . . . . . . .  auto            int       0H    2
  args . . . . . . . . . . . .  --reg--         int    -----    2
ERROR. . . . . . . . . . . . .  public   NCONST array     0H    16
menu . . . . . . . . . . . . .  static   NCONST array    7AH    847
interval . . . . . . . . . . .  public   NDATA0 struct    0H    4
savefirst. . . . . . . . . . .  static   NDATA0 uint      4H    2
setinterval. . . . . . . . . .  public   NDATA0 struct    6H    4
save_record. . . . . . . . . .  static   NDATA0 array     AH    8192
sindex . . . . . . . . . . . .  static   NDATA0 uint   200AH    2
current. . . . . . . . . . . .  public   NDATA0 struct 200CH    16
cmdbuf . . . . . . . . . . . .  static   NDATA0 array  201CH    15
measurement_interval . . . . .  static   BIT0   bit       0H    1
mdisplay . . . . . . . . . . .  static   BIT0   bit       1H    1
startflag. . . . . . . . . . .  static   BIT0   bit       2H    1

Module Information

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

MODULE INFORMATION:   INITIALIZED  UNINITIALIZED
  CODE SIZE        =         910     --------
  NEAR-CONST SIZE  =        1062     --------
  FAR-CONST SIZE   =    --------     --------
  HUGE-CONST SIZE  =    --------     --------
  XHUGE-CONST SIZE =    --------     --------
  NEAR-DATA SIZE   =        8235     --------
  FAR-DATA SIZE    =    --------     --------
  XHUGE-DATA SIZE  =    --------     --------
  IDATA-DATA SIZE  =    --------     --------
  SDATA-DATA SIZE  =    --------     --------
  BDATA-DATA SIZE  =    --------     --------
  HUGE-DATA SIZE   =    --------     --------
  BIT SIZE         =           3     --------
  INIT'L SIZE      =    --------     --------
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 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.