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.

A166 MACRO ASSEMBLER  ASAMPLE3               10/06/2004 09:13:17 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 A166 V5.03a
OBJECT MODULE PLACED IN ASAMPLE3.OBJ
ASSEMBLER INVOKED BY: C:\Keil_v5\C166\BIN\A166.EXE ASAMPLE3.A66 MODV2
>> SEGMENTED SET(SMALL) DEBUG XREF EP

Source Listing

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

LOC      OBJ      LINE  SOURCE

                     1  NAME    CHAR_IO
                     2
.
.
.
--------            11  CHAR_R  SECTION CODE PUBLIC 'ICODE'
                    12  PUBLIC  PUTCHAR
                    13  PCHAR   PROC    NEAR
                    14
                    15  ; Output the char in R8.
                    16  PUTCHAR:
00000000 9AB6FE70   17          JNB  ASC0_TIC_IR,$
00000004 7EB6       18          BCLR ASC0_TIC_IR
00000006 F6F8B0FE   19          MOV  DPP3:ASC0_TBUF,R8
0000000A CB00       20          RET
                    21
                    22  PCHAR   ENDP
--------            23  CHAR_R  ENDS
.
.
.
                    30          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 form feed 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

ASC0_TBUF. . . . .  WORD   FEB0H    A  SFR
ASC0_TIC . . . . .  WORD   FF6CH    A  SFR
ASC0_TIC_IE. . . .  BIT    FF6CH.6  A
ASC0_TIC_IR. . . .  BIT    FF6CH.7  A
CHAR_IO. . . . . .  ----   ----
CHAR_R . . . . . .  ----   ----     R  SECTION
DPP3 . . . . . . .  WORD   FE06H    A  SFR
DUMMY. . . . . . .  BYTE   0H       R  SEC=VAR2
PCHAR. . . . . . .  NEAR   0H       R  SEC=CHAR_R
PUTCHAR. . . . . .  NEAR   0H       R  PUB SEC=CHAR_R
VAR2 . . . . . . .  ----   ----     R  SECTION

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

Each symbol may have certain attributes.

Attribute Description
EXT The symbol is external.
GLB The symbol is global.
GROUP The symbol represents a group name.
PUB The symbol is public.
SEC= The symbol is a member of the section specified after SEC=.
SECTION The symbol represents a section name.
SFR The symbol is a special function register (SFR) name.

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

ASC0_TBUF. . . . .  WORD   FEB0H    A  SFR   5# 19
ASC0_TIC . . . . .  WORD   FF6CH    A  SFR   6# 7 8
ASC0_TIC_IE. . . .  BIT    FF6CH.6  A     7#
ASC0_TIC_IR. . . .  BIT    FF6CH.7  A     8# 17 18
CHAR_IO. . . . . .  ----   ----
CHAR_R . . . . . .  ----   ----     R  SECTION   11# 23
DUMMY. . . . . . .  BYTE   0H       R  SEC=VAR2   27#
PCHAR. . . . . . .  NEAR   0H       R  SEC=CHAR_R   13# 22
PUTCHAR. . . . . .  NEAR   0H       R  PUB SEC=CHAR_R   12 16#
VAR2 . . . . . . .  ----   ----     R  SECTION   26# 28

In the attributes 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.