aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-m68hc11/adj-brset.s
blob: 1aaff41cb9f69277a2686e7ea0d139f6e3b2d813 (plain)
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
;;; Test 68HC11 linker relaxation and fixup of brclr/brset branches
;;; 
	.sect .text
	.globl _start
_start:
start:
	brclr	140,x#200,L8	; Branch adjustment covers the whole test
;;; The 'addd' is relaxed and we win 1 byte.  The next brclr/brset
;;; branch must be fixed and reduced by 1.  We check for different
;;; addressing modes because the instruction has different opcode and
;;; different lengths.
L1:
	addd	_toto
	brclr	20,x,#3,L1
	brclr	90,x,#99,L3	; Likewise with forward branch
L2:
	addd	_toto
	brclr	19,y,#4,L2
	brclr	91,y,#98,L4
L3:
	addd	_toto
	brset	18,x,#5,L3
	brset	92,x,#97,L5
L4:
	addd	_toto
	brset	17,y,#6,L4
	brset	93,y,#96,L5
L5:
	addd	_toto
	brset	*_table,#7,L5
	brset	*_table+10,#95,L7
L6:
	addd	_toto
	brclr	*_table+1,#8,L6
	brset	*_table+11,#94,L8
L7:
	addd	_toto
	brclr	*_table+1,#8,L6
L8:
	brclr	140,x#200,_start ; Branch adjustment covers the whole test
	rts

	.sect	.page0
_bar:
	.long	0
_toto:
	.long	0
	.skip	32
stack:
	.skip	10
_table: