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.

A51 MACRO ASSEMBLER   ASAMPLE3               05/19/2004 19:57:04 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 A51 V7.09
OBJECT MODULE PLACED IN ASAMPLE3.OBJ
ASSEMBLER INVOKED BY: C:\Keil_v5\C51\BIN\A51.EXE ASAMPLE3.A51 GEN
>> SET(SMALL) DEBUG EP

Source Listing

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

LOC  OBJ            LINE     SOURCE

                       1     $rb (0,1)
                       2     NAME    CHAR_IO
                       3     ;
                       4     PUBLIC  PUTCHAR
                       5
                       6     CHAR_ROUTINES  SEGMENT  CODE
                       7     VAR2           SEGMENT  DATA
                       8
----                   9             RSEG  CHAR_ROUTINES
                      10
                      11     ; This routine outputs a character.
                      12     ; The character is given in A.
0000                  13     PUTCHAR:
0000 3099FD           14             JNB  TI,$
0003 C299             15             CLR  TI
0005 F599             16             MOV  SBUF,A
0007 22               17             RET
.
.
.
                      25             END

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.

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

N A M E             T Y P E  V A L U E   ATTRIBUTES

CHAR_IO. . . . . .  N NUMB   -----
CHAR_ROUTINES. . .  C SEG    0008H       REL=UNIT
DUMMY. . . . . . .  D ADDR   0000H   R   SEG=VAR2
PUTCHAR. . . . . .  C ADDR   0000H   R   SEG=CHAR_ROUTINES
SBUF . . . . . . .  D ADDR   0099H   A
TI . . . . . . . .  B ADDR   0098H.1 A
VAR2 . . . . . . .  D SEG    0040H       REL=UNIT

The following characters are used with the indicated type:

  • B indicates the symbol references BIT memory.
  • C indicates the symbol references CODE memory.
  • D indicates the symbol references DATA memory.
  • I indicates the symbol references IDATA memory.
  • N indicates the symbol is a number.
  • X indicates the symbol references XDATA memory.

The following abbreviations are used with the indicated type:

  • ADDR indicates the symbol is an address.
  • NUMB indicates the symbol is a number.
  • SEG indicates the symbol is a segment.

The value listed is the address of the symbol (for addresses) or the size (for segments). An A following the address indicates the address is absolute or non-relocatable. An R following the address indicates the address is relocatable.

Cross Reference

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

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

N A M E             T Y P E  V A L U E   ATTRIBUTES / REFERENCES

CHAR_IO. . . . . .  N NUMB   -----          2
CHAR_ROUTINES. . .  C SEG    0008H       REL=UNIT   6# 9
DUMMY. . . . . . .  D ADDR   0000H   R   SEG=VAR2   22#
PUTCHAR. . . . . .  C ADDR   0000H   R   SEG=CHAR_ROUTINES   4 13#
SBUF . . . . . . .  D ADDR   0099H   A      16
TI . . . . . . . .  B ADDR   0098H.1 A      14 15
VAR2 . . . . . . .  D SEG    0040H       REL=UNIT   7# 21

The REFERENCES column lists each line number where the specified symbol is accessed. Line numbers followed by the pound character ('#') are the line where the symbol is defined.

Register Banks

Space is reserved (by the linker) for the register banks used in the object module. The register banks used are listed as follows:

REGISTER BANK(S) USED: 0 1

You may use the REGISTERBANK and NOREGISTERBANK directives to specify the register banks used within a module.

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