File: indexed12.s

package info (click to toggle)
binutils 2.32.51.20190821-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 309,676 kB
  • sloc: ansic: 1,201,497; asm: 658,869; cpp: 130,432; exp: 69,370; makefile: 56,804; sh: 23,583; lisp: 14,519; yacc: 14,467; perl: 2,111; ada: 1,681; lex: 1,649; pascal: 1,446; python: 991; cs: 879; sed: 195; xml: 95; awk: 25
file content (115 lines) | stat: -rw-r--r-- 3,160 bytes parent folder | download | duplicates (38)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
;;
;; This file verifies the 68HC12 indexed addressing modes
;; with a 5, 9 and 16-bit offset.
;;
	.sect .text
	.globl _main
_main:
	nop
;;; Global check (1st)
	ldab	L1-_main,x	; Offset/const of these 2 insns must be
	ldaa	#L1-_main	; identical (likewise for 2nd global check)
;;; Test gas relax with difference of symbols (same section)
	ldaa	L2-L1,x		; -> ldaa 2,x (5-bit offset), text seg
	adda	L1-L2,y		; -> adda -2,y (5-bit offset), text seg

	orab	L7-L6,sp	; -> orab 8,sp  (5-bit offset), text seg
	anda	L8-L7,sp	; -> anda 15,sp (5-bit offset), text seg
	eora	L7-L8,sp	; -> eora -15,sp (5-bit offset), text seg
	eorb	L7-L9,sp	; -> eorb -16,sp (5-bit offset), text seg

	andb	L9-L7,sp	; -> andb 16,sp (9-bit offset), text seg
	staa	L7-L10,x	; -> staa -17,x (9-bit offset), text seg
	stab	L11-L10,y	; -> stab 128,y (9-bit offset), text seg
	stab	L10-L11,y	; -> stab -128,y (9-bit offset), text seg
	stab	L11-L10+1,y	; -> stab 129,y (9-bit offset), text seg
	stab	L10-L11-1,y	; -> stab -129,y (9-bit offset), text seg
	stab	L11-1-L10,y	; -> stab 127,y (9-bit offset), text seg
	stab	L10-1-L11,y	; -> stab -129,y (9-bit offset), text seg

	tst	L12-L10,x	; -> tst 255,x (9-bit offset), text seg
	tst	L10-L12,x	; -> tst -255,x (9-bit offset), text seg
	tst	L12-L10+1,x	; -> tst 256,x (16-bit offset), text seg
	mina	L13-L10,x	; -> mina 256,x (16-bit offset)
	mina	L10-L13,x	; -> mina -256,x (9-bit offset)

	maxa	L14-L10,x	; -> maxa 257,x (16-bit offset)
	maxa	L10-L14,x	; -> maxa -257,x (16-bit offset)

;;; Test gas relax with difference of symbols (different section)
	ldaa	D2-D1,x		; -> ldaa 2,x (5-bit offset), data seg
	adda	D1-D2,y		; -> adda -2,y (5-bit offset), data seg

	orab	D7-D6,sp	; -> orab 8,sp  (5-bit offset), data seg
	anda	D8-D7,sp	; -> anda 15,sp (5-bit offset), data seg
	eora	D7-D8,sp	; -> eora -15,sp (5-bit offset), data seg
	eorb	D7-D9,sp	; -> eorb -16,sp (5-bit offset), data seg

	andb	D9-D7,sp	; -> andb 16,sp (9-bit offset), data seg
	staa	D7-D10,x	; -> staa -17,x (9-bit offset), data seg
	stab	D11-D10,y	; -> stab 128,y (9-bit offset), data seg
	stab	D10-D11,y	; -> stab -128,y (9-bit offset), data seg
	stab	D11-D10+1,y	; -> stab 129,y (9-bit offset), data seg
	stab	D10-D11+1,y	; -> stab -127,y (9-bit offset), data seg
	stab	D11-1-D10,y	; -> stab 127,y (9-bit offset), data seg
	stab	D10-1-D11,y	; -> stab -129,y (9-bit offset), data seg

	tst	D12-D10,x	; -> tst 255,x (9-bit offset), data seg
	tst	D10-D12,x	; -> tst -255,x (9-bit offset), data seg
	tst	D12-D10+1,x	; -> tst 256,x (16-bit offset), data seg
	mina	D13-D10,x	; -> mina 256,x (16-bit offset)
	mina	D10-D13,x	; -> mina -256,x (9-bit offset)

	maxa	D14-D10,x	; -> maxa 257,x (16-bit offset)
	maxa	D10-D14,x	; -> maxa -257,x (16-bit offset)

;;; Global check (2nd)
	ldab	L1-_main,x
	ldaa	#L1-_main

;;; Indexed addressing with external symbol
	ldab	_external+128,x
	bra	L2
L1:
	.dc.w	0xaabb
L2:
L6:
	.ds.b	8, 0xa7
L7:
	.ds.b	15, 0xa7
L8:
	nop
L9:
	nop
L10:
	.skip	128
L11:
	.skip	127
L12:
	nop
L13:
	nop
L14:
	rts

	.sect .data
D1:
	.dc.w	0xaabb
D2:
D6:
	.ds.b	8, 0xa7
D7:
	.ds.b	15, 0xa7
D8:
	nop
D9:
	nop
D10:
	.skip	128
D11:
	.skip	127
D12:
	nop
D13:
	nop
D14: