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.

A251 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 A251 V3.52
OBJECT MODULE PLACED IN ASAMPLE3.OBJ
ASSEMBLER INVOKED BY: C:\Keil_v5\C251\BIN\A251.EXE ASAMPLE3.A51 MODSRC
>> GENONLY FIXDRK REGISTERBANK(0) SET(TINY) DEBUG XREF

Source Listing

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

LOC    OBJ             LINE     SOURCE
.
.
.
                        148     PUBLIC  PUTCHAR
                        149
------                  150     CHAR_ROUTINES  SEGMENT  CODE
------                  151     VAR2           SEGMENT  DATA
                        152
------                  153             RSEG  CHAR_ROUTINES
                        154
                        155     ; This routine outputs a character.
                        156     ; The character is given in A.
000000                  157     PUTCHAR:
000000 309900     F     158             JNB  TI,$
000003 C299             159             CLR  TI
000005 F599             160             MOV  SBUF,A
000007 22               161             RET
                        162
                        163
                        164     ; only for demonstration
------                  165             RSEG  VAR2
000000                  166     DUMMY:  DS    40H
                        167
                        168
                        169             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. . . . . .  -- ----  -------
CHAR_ROUTINES. . .  C  SEG   000008H       REL=UNIT, ALN=BYTE
DUMMY. . . . . . .  D  ADDR  0000H     R   SEG=VAR2
PUTCHAR. . . . . .  C  ADDR  0000H     R   SEG=CHAR_ROUTINES
VAR2 . . . . . . .  D  SEG   000040H       REL=UNIT, ALN=BYTE

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.
  • EC indicates the symbol references ECODE memory.
  • ED indicates the symbol references EDATA memory.
  • HD indicates the symbol references HDATA 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. . . . . .  -- ----  -------          1
CHAR_ROUTINES. . .  C  SEG   000008H       REL=UNIT, ALN=BYTE   150# 153
DUMMY. . . . . . .  D  ADDR  0000H     R   SEG=VAR2   166#
PUTCHAR. . . . . .  C  ADDR  0000H     R   SEG=CHAR_ROUTINES   148 157#
VAR2 . . . . . . .  D  SEG   000040H       REL=UNIT, ALN=BYTE   151# 165

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

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.