beautypg.com

5 disassembling output, Sample outputs, Absolute list file "test.abs – Epson S5U1C62000A User Manual

Page 127

background image

S5U1C62000A MANUAL

EPSON

115

(S1C60/62 FAMILY ASSEMBLER PACKAGE)

CHAPTER 8: DISASSEMBLER

8.5 Disassembling Output

The data/code mnemonics are restored from the target code. As for the branch instructions, a label will
be automatically generated like "LXXXX:" where XXXX denotes a hexadecimal number string. ".org"
pseudo-instruction is used to specify the starting location of each code block.
The following shows examples of disassembled sources:

Sample outputs

Absolute list file "test.abs"

Linker 62 ver x.xx Absolute list file "TEST.ALS" Sun May 03 14:16:16 1998

1:

; main.s

2:

; test program (main routine)

3:

;

4:

5:

;***** INITIAL SP ADDRESS DEFINITION *****

6:

#define

SP_INIT_ADDR 0x80

;SP init addr = 0x80

7:

8:

;***** BOOT, LOOP *****

9:

.global

INIT_RAM_BLK1

; subroutine

10:

.global

INC_RAM_BLK1

; subroutine

11:

12:

.org

0x100

13:

BOOT:

14: 0100 e08

ld

a,SP_INIT_ADDR>>4

; set SP

15: 0101 fe0

ld

sph,a

16: 0102 e00

ld

a, SP_INIT_ADDR&0xf

17: 0103 ff0

ld

spl,a

18: 0104 e42 (+)

pset 0x2

19: 0105 400

call

INIT_RAM_BLK1

; initialize RAM block 1

20:

LOOP:

21: 0106 e42 (+)

pset 0x2

22: 0107 406

call

INC_RAM_BLK1

; increment RAM block 1

23: 0108 006

jp

LOOP

; infinity loop

24:

; sub.s

25:

; test program (subroutines)

26:

27:

.global RAM_BLK1

28:

29:

.org

0x200

30:

31:

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

32:

33:

.global INIT_RAM_BLK1

34:

INIT_RAM_BLK1:

35: 0200 e00

ld

a,RAM_BLK1^h

36: 0201 e80

ld

xp,a

37: 0202 b00

ld

x,RAM_BLK1^l

;set RAM_BLK1 address to x

38: 0203 900

lbpx

mx,0

;set 0x0000 to RAM_BLK1

39: 0204 900

lbpx

mx,0

40: 0205 fdf

ret

41:

42:

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

43:

44:

.global INC_RAM_BLK1

45:

INC_RAM_BLK1:

46: 0206 e00

ld

a,RAM_BLK1^h

47: 0207 e80

ld

xp,a

48: 0208 b00

ld

x,RAM_BLK1^l

;set RAM_BLK1 address to x

49: 0209 e00

ld

a,0

50: 020a f41

scf

51: 020b f28

acpx

mx,a

; increment 16bit value

52: 020c f28

acpx

mx,a

53: 020d f28

acpx

mx,a

54: 020e a98

adc

mx,a

55: 020f fdf

ret