Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Скачиваний:
59
Добавлен:
14.04.2015
Размер:
2.03 Mб
Скачать

Keil Software — A51/AX51/A251 Macro Assembler and Utilities

419

 

 

Macro / Include File / Save Stack Format

In the listing file, the assembler displays the macro nesting level, the include file level, and the level of the SAVE/RESTORE stack. These nesting levels are shown before and after the LINE number as shown in the following listing.

LOC

OBJ

 

LINE

 

SOURCE

 

 

 

 

 

 

1

 

$GEN

; Enable Macro

Listing

 

 

 

2

 

 

 

 

 

 

 

 

3

 

MYMACRO

MACRO

 

; A sample macro

 

 

 

4

 

 

INC

A

; Macro Level 1

 

 

 

5

 

 

MACRO2

 

 

 

 

 

6

 

 

ENDM

 

 

 

 

 

7

 

 

 

 

 

 

 

 

8

 

MACRO2

MACRO

 

; Macro 2

 

 

 

9

 

 

NOP

 

; Macro Level 2

 

 

 

10

 

 

ENDM

 

 

 

 

 

11

 

 

 

 

 

 

 

 

12

 

 

 

 

 

------

 

 

13

 

MYPROG

SEGMENT

CODE

 

------

 

 

14

 

 

RSEG

MYPROG

 

 

 

 

15

 

 

 

 

 

000000

7400

 

16

 

 

MOV

A,#0

 

 

 

 

17

 

 

MYMACRO

 

 

000002

04

 

18+1

 

 

INC

A

; Macro Level 1

 

 

 

19+1

 

 

MACRO2

 

 

000003

00

 

20+2

 

 

NOP

 

; Macro Level 2

 

 

 

21

 

$INCLUDE (MYFILE.INC)

; A include file

 

 

+1

22

 

; This is a comment

; Include Level 1

 

 

+1

23

 

 

MACRO2

 

 

000004

00

+1

24+1

 

 

NOP

 

; Macro Level 1

000005

7401

 

25

 

 

MOV

A,#1

 

 

 

 

26

+1

$SAVE

 

 

; Save Control

 

 

 

27

+1

 

MYMACRO

 

; SAVE Level 1

000007

04

 

28+1+1

 

INC

A

; Macro Level 1

 

 

 

29+1+1

 

MACRO2

 

 

000008

00

 

30+2+1

 

NOP

 

; Macro Level 2

 

 

 

31

+1

$RESTORE

 

 

000009

00

 

32

 

 

NOP

 

 

 

 

 

33

 

 

END

 

 

C

Symbol Table

The symbol table is a list of all symbols defined in the program along with the status information about the symbol. Any predefined symbols used will also be listed in the symbol table. If the XREF control is used, the symbol table will contain information about where the symbol was used in the program.

420

Appendix C. Listing File Format

 

 

The status information includes a NAME field, a TYPE field, a VALUE field, and an

ATTRIBUTES field.

The TYPE field specifies the type of the symbol: ADDR if it is a memory address, NUMB if it is a pure number (e.g., as defined by EQU), SEG if it is a relocatable segment, and REG if a register. For ADDR and SEG symbols, the segment type is added.

The VALUE field shows the value of the symbol when the assembly was completed. For REG symbols, the name of the register is given. For NUMB and ADDR symbols, their absolute value (or if relocatable, their offset) is given, followed by A (absolute) or R (relocatable). For SEG symbols, the segment size

C is given here. Bit address and size are given by the byte part, a period (.), followed by the bit part. The scope attribute, if any, is PUB (public) or EXT (external). These are given after the VALUE field.

The ATTRIBUTES field contains an additional piece of information for some symbols: relocation type for segments, segment name for relocatable symbols.

Example Symbol Table Listing

SYMBOL TABLE LISTING

 

 

 

 

 

------ ----- -------

 

 

 

 

 

N A M E

T Y P E

V A L U E

ATTRIBUTES

BITVAR . . . . . .

B

SEG

000001H

 

REL=UNIT, ALN=BIT

DUMMY. . . . . . .

D

ADDR

000000H

R

SEG=VAR1

PCONST . . . . . .

C

SEG

00000DH

 

REL=UNIT, ALN=BYTE

PROG . . . . . . .

C

SEG

00001BH

 

REL=UNIT, ALN=BYTE

PUTSTRING. . . . .

C

ADDR

-------

 

EXT

PUT_CRLF . . . . .

C

ADDR

-------

 

EXT

REPEAT . . . . . .

C

ADDR

000010H

R

SEG=PROG

SAMPLE . . . . . .

 

 

 

 

 

STACK. . . . . . .

I

SEG

000010H

 

REL=UNIT, ALN=BYTE

START. . . . . . .

C

ADDR

000000H

R

SEG=PROG

TXT. . . . . . . .

C

ADDR

000000H

R

SEG=PCONST

TXTBIT . . . . . .

B

ADDR

0000H.0

R

SEG=BITVAR

VAR1 . . . . . . .

D

SEG

000021H

 

REL=UNIT, ALN=BYTE

If the XREF control is used, then the symbol table listing will also contain all of the line numbers of each line of code that the symbol was used. If the value of the symbol was changed or defined on a line, then that line will have a hash mark

(#) following it. The line numbers are displayed in decimal.

Keil Software — A51/AX51/A251 Macro Assembler and Utilities

421

 

 

Listing File Trailer

At the end of the listing, the assembler prints a message in the following format:

REGISTER BANK(S) USED: [r r r r]

ASSEMBLY COMPLETE.

(n) WARNING(S), (m) ERROR(S)

where

 

r

are the numbers of the register banks used.

n

is the number of warnings found in the program.

m

is the number of errors found in the program.

C

422

Appendix C. Listing File Format

 

 

C

Соседние файлы в папке HLP