CHAPTER 7: DISASSEMBLER

7.5 Disassembling Output

The data/code mnemonics are restored from the target code. As for the branch instructions, a label will be automatically generated such as "CODEx:" where "x" denotes a hexadecimal number string. Other reference symbols will also be generated as "LABELx", "IOx" and "RAMx". The ".org" pseudo-instruction is used to specify the starting location of each code block.

The following shows examples of disassembled sources:Sample outputsAbsolute list file "test.als"

Linker 63 ver x.xx Absolute list file "TEST.ALS" Mom Jan 15 12:40:41 2001

1:

 

 

 

; sub.s

 

 

2:

 

 

 

; AS63 test program (subroutine)

 

3:

 

 

 

 

 

 

4:

 

 

 

.global RAM_BLK1

 

5:

 

 

 

 

 

 

6:

 

 

 

;***** RAM block 1 initialize *****

 

7:

 

 

 

 

 

 

8:

 

 

 

.global INIT_RAM_BLK1

 

9:

 

 

 

INIT_RAM_BLK1:

 

10:

0000

0800

 

ldb

%ext,RAM_BLK1@h

 

11:

0001

0a04

 

ldb

%xl,RAM_BLK1@l

;set RAM_BLK1 address to x

12:

0002

1e90

 

ld

[%x]+,0x0

 

13:

0003

1e90

 

ld

[%x]+,0x0

 

14:

0004

1e90

 

ld

[%x]+,0x0

 

15:

0005

1e80

 

ld

[%x],0x0

;set 0x0000 to RAM_BLK1

16:

0006

1ff8

 

ret

 

 

17:

 

 

 

 

 

 

18:

 

 

 

;***** RAM block 1 increment *****

 

19:

 

 

 

 

 

 

20:

 

 

 

.global INC_RAM_BLK1

 

21:

 

 

 

INC_RAM_BLK1:

 

 

22:

0007

0800

 

ldb

%ext,RAM_BLK1@h

 

23:

0008

0a04

 

ldb

%xl,RAM_BLK1@l

;set RAM_BLK1 address to x

24:

0009

1911

 

add

[%x]+,1

 

25:

000a

1990

 

adc

[%x]+,0

 

26:

000b

1990

 

adc

[%x]+,0

 

27:

000c

1980

 

adc

[%x],0

; increment 16bit value

28:

000d

1ff8

 

ret

 

 

29:

 

 

 

; main.s

 

 

30:

 

 

 

; AS63 test program (main routine)

 

31:

 

 

 

;

 

 

32:

 

 

 

 

 

 

33:

 

 

 

;***** INITIAL SP1 & SP2 ADDRESS DEFINITION *****

34:

 

 

 

 

 

 

35:

 

 

 

#ifdef SMALL_RAM

 

36:

 

 

 

.set SP1_INIT_ADDR 0xb

;SP1 init addr = 0x2c

37:

 

 

 

#else

 

 

38:

 

 

 

.set SP1_INIT_ADDR 0x4b

;SP1 init addr = 0x12c

39:

 

 

 

#endif

 

 

40:

 

 

 

 

 

 

41:

 

 

 

.set SP2_INIT_ADDR 0x1f

;SP2 init addr = 0x1f

42:

 

 

 

 

 

 

43:

 

 

 

 

 

 

44:

 

 

 

;***** NMI & BOOT, LOOP *****

 

45:

 

 

 

 

 

 

46:

 

 

 

.global INIT_RAM_BLK1

; subroutine in sub.s

47:

 

 

 

.global INC_RAM_BLK1

; subroutine in sub.s

48:

 

 

 

 

 

 

49:

 

 

 

.org

0x100

 

50:

 

 

 

NMI:

 

 

51:

0100

08fe

(+)

ldb

ext,fe

 

52:

0101

02fe

 

calr

INIT_RAM_BLK1

; initialize RAM block 1

53:

0102

1ff9

 

reti

 

; in NMI(watchdog timer)

54:

 

 

 

 

 

 

114

EPSON

S5U1C63000A MANUAL

 

 

(S1C63 FAMILY ASSEMBLER PACKAGE)