Keil Logo

C. Listing File Format

This appendix describes the format of the listing file generated by the assembler.

Assembler Listing File Format

The Ax51 assembler, unless overridden by controls, outputs two files: an object file and a listing file. The object file contains the machine code. The listing file contains a formatted copy of your source code with page headers and, if requested through controls (SYMBOL or XREF), a symbol table.

Sample Ax51 Listing



Ax51 MACRO ASSEMBLER V1.40
OBJECT MODULE PLACED IN ASAMPLE1.OBJ
ASSEMBLER INVOKED BY: F:\RK\ZX\ASM\A51.EXE ASAMPLE1.A51 XREF

LOC    OBJ             LINE     SOURCE

                          1     $NOMOD51
                          2     $INCLUDE (REG52.INC)
                    +1    3  +1 $SAVE
                    +1  106  +1 $RESTORE
                        107
                        108     NAME    SAMPLE
                        109
                        110     EXTRN   CODE    (PUT_CRLF, PUTSTRING)
                        111     PUBLIC  TXTBIT
                        112
------                  113     PROG    SEGMENT CODE
------                  114     PCONST  SEGMENT CODE
------                  115     VAR1    SEGMENT DATA
------                  116     BITVAR  SEGMENT BIT
------                  117     STACK   SEGMENT IDATA
                        118
------                  119             RSEG  STACK
000000                  120             DS    10H  ; 16 Bytes Stack
                        121
000000                  122             CSEG  AT   0
                        123             USING   0  ; Register Bank 0
                        124     ; Execution starts at address 0 on power up.
000000 020000     F     125             JMP   START
                        126
------                  127             RSEG  PROG
                        128     ; first set Stack Pointer
000000 758100     F     129     START:  MOV   SP,#STACK 1
                        130
                        131     ; Initialize serial interface
                        132     ; Using TIMER 1 to Generate Baud Rates
                        133     ; Oscillator frequency = 11.059 MHz
000003 758920           134             MOV   TMOD,#00100000B     ;C/T = 0, Mode = 2
000006 758DFD           135             MOV   TH1,#0FDH
000009 D28E             136             SETB  TR1
00000B 759852           137             MOV   SCON,#01010010B
                        138
                        139     ; clear TXTBIT to read form CODE Memory
00000E C200       F     140             CLR   TXTBIT
                        141
                        142     ; This is the main program. It is a loop,
                        143     ; which displays the a text on the console.
000010                  144     REPEAT:
                        145     ; type message
000010 900000     F     146             MOV   DPTR,#TXT
000013 120000     E     147             CALL  PUTSTRING
000016 120000     E     148             CALL  PUT_CRLF
                        149     ; repeat
000019 8000       F     150             SJMP  REPEAT
                        151     ;
------                  152             RSEG  PCONST
000000 54455354         153     TXT:    DB    'TEST PROGRAM',00H
000004 2050524F
000008 4752414D
00000C 00
                        154
                        155     ; only for demonstration
------                  156             RSEG  VAR1
000000                  157     DUMMY:  DS    21H
                        158
                        159     ; TXTBIT = 0 read text from CODE  Memory
                        160     ; TXTBIT = 1 read text from XDATA Memory
------                  161             RSEG  BITVAR
0000.0                  162     TXTBIT: DBIT  1
                        163
                        164             END


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


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

BITVAR . . . . . .  B  SEG   000001H     REL=UNIT, ALN=BIT   116# 161
DUMMY. . . . . . .  D  ADDR  000000H R   SEG=VAR1   157#
PCONST . . . . . .  C  SEG   00000DH     REL=UNIT, ALN=BYTE   114# 152
PROG . . . . . . .  C  SEG   00001BH     REL=UNIT, ALN=BYTE   113# 127
PUTSTRING. . . . .  C  ADDR  -------     EXT   110# 147
PUT_CRLF . . . . .  C  ADDR  -------     EXT   110# 148
REPEAT . . . . . .  C  ADDR  000010H R   SEG=PROG   144# 150
SAMPLE . . . . . .     108
STACK. . . . . . .  I  SEG   000010H     REL=UNIT, ALN=BYTE   117# 119 129
START. . . . . . .  C  ADDR  000000H R   SEG=PROG   125 129#
TXT. . . . . . . .  C  ADDR  000000H R   SEG=PCONST   146 153#
TXTBIT . . . . . .  B  ADDR  0000H.0 R   SEG=BITVAR   111 140 162#
VAR1 . . . . . . .  D  SEG   000021H     REL=UNIT, ALN=BYTE   115# 156


REGISTER BANK(S) USED: 0


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.