Keil Logo

Listing (LST) File

The assembler listing file contains an abundance of information about the assembly process and 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 assembler version number, date, time, and page number.

AA MACRO ASSEMBLER  STARTUP                  11/07/2004 18:54:38 PAGE 1

Command Line

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

MACRO ASSEMBLER AA V0.20
OBJECT MODULE PLACED IN .\ARM_Thumb\Startup.obj
ASSEMBLER INVOKED BY: C:\Keil_v5\ARM\BIN\AA.exe Startup.s DEBUG PRINT(.
                      \ARM_Thumb\Startup.lst) XREF OBJECT(.\ARM_Thum
                      b\Startup.obj) EP

Source Listing

The source code is listed along with the generated instruction opcodes.

LOC      OBJ      LINE     SOURCE
.
.
.
00000094 E59F0000  205     LDR     R0, =Top_Stack
                   206
                   207
00000098 E321F0DB  208     MSR     CPSR_c, #Mode_UND|I_Bit|F_Bit
0000009C E1A0D000  209     MOV     SP, R0
000000A0 E2400004  210     SUB     R0, R0, #UND_Stack_Size
                   211
                   212
000000A4 E321F0D7  213     MSR     CPSR_c, #Mode_ABT|I_Bit|F_Bit
000000A8 E1A0D000  214     MOV     SP, R0
000000AC E2400004  215     SUB     R0, R0, #ABT_Stack_Size
                   216
                   217
000000B0 E321F0D1  218     MSR     CPSR_c, #Mode_FIQ|I_Bit|F_Bit
000000B4 E1A0D000  219     MOV     SP, R0
000000B8 E2400004  220     SUB     R0, R0, #FIQ_Stack_Size
.
.
.
                   255     END

Each line in the listing file is separated into several fields which have special meaning:

Address ObjectRelocLine Source

Where

Address is the state of the address counter in the current section.
Object is the generated object code (in HEX).
Reloc indicates whether the code contains a reference to a relocatable (R) or external (E) expression that must be filled-in by the linker. If there no external or relocatable expressions referenced by this instruction the Reloc field is blank.
Line is the line number issued by the assembler.
Source is the original source code.

Several assembler directives give you flexible control over the details included in the assembler code listing.

  • The COND directive may be used to include conditional assembly in the source listing.
  • The EJECT directive may be used to insert a formfeed in the source listing.
  • The GEN directive may be used to include macro expansions in the source listing.
  • The NOLIST directive may be used to exclude the source code from the listing file.

Symbol Table

The symbol table contains symbolic information obtained while assembling the source file. Included in the table are the symbol name, type, value, and any other attributes. You may use the NOSYMBOLS directive to disable symbol table generation. You may use the NOSYMLIST directive to exclude subsequent symbols from the symbol table.

SYMBOL TABLE LISTING
------ ----- -------

N A M E             TYPE     VALUE     I   ATTRIBUTES

?C?INIT. . . . . .  C  ADDR  -------       EXT
ABT_Stack_Size . .  -- ----  0004H     A
DAbt_Addr. . . . .  C  ADDR  0030H     R   SEG=STARTUPCODE
DAbt_Handler?A . .  C  ADDR  -------       EXT
FIQ_Addr . . . . .  C  ADDR  003CH     R   SEG=STARTUPCODE
FIQ_Handler?A. . .  C  ADDR  -------       EXT
FIQ_Stack_Size . .  -- ----  0004H     A
F_Bit. . . . . . .  -- ----  0040H     A
IRQ_Addr . . . . .  C  ADDR  0038H     R   SEG=STARTUPCODE
IRQ_Handler?A. . .  C  ADDR  -------       EXT
IRQ_Stack_Size . .  -- ----  0080H     A
I_Bit. . . . . . .  -- ----  0080H     A

The values in the I column indicate whether the symbol is absolute (A) or relocatable (R).

Each symbol may have certain attributes.

Attribute Description
ALN= Specifies the alignment for a data variable.
EXT The symbol is external.
PUB The symbol is public.
REL= Specifies the relocation type for a data variable.
SEG= The symbol is a member of the segment specified after SEG=.

Cross Reference

The XREF directive includes cross reference information in the symbol table.

XREF SYMBOL TABLE LISTING
---- ------ ----- -------

N A M E             TYPE     VALUE     I   ATTRIBUTES / REFERENCES

?C?INIT. . . . . .  C  ADDR  -------       EXT   117# 237
ABT_Stack_Size . .  -- ----  0004H     A      45# 54 215
DAbt_Addr. . . . .  C  ADDR  0030H     R   SEG=STARTUPCODE   138 148#
DAbt_Handler?A . .  C  ADDR  -------       EXT   126# 148
FIQ_Addr . . . . .  C  ADDR  003CH     R   SEG=STARTUPCODE   142 151#
FIQ_Handler?A. . .  C  ADDR  -------       EXT   128# 151
FIQ_Stack_Size . .  -- ----  0004H     A      46# 53 220
F_Bit. . . . . . .  -- ----  0040H     A      30# 208 213 218 223 228
IRQ_Addr . . . . .  C  ADDR  0038H     R   SEG=STARTUPCODE   150#
IRQ_Handler?A. . .  C  ADDR  -------       EXT   127# 150
IRQ_Stack_Size . .  -- ----  0080H     A      47# 52 225
I_Bit. . . . . . .  -- ----  0080H     A      29# 208 213 218 223 228

In the Attributes/References column, numbers represent the line number in the source file where the symbol is used. Numbers followed by a number sign ('#') are the line where the symbol is defined.

Refer to the Symbol Table above for more information about the listing.

Warnings and Errors

Problems encountered while assembling a program generate errors and warnings that are output to the screen and to the listing file.

ASSEMBLY COMPLETE.  0 WARNING(S), 0 ERROR(S)

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.