Commit | Line | Data |
---|---|---|
27bdea3d SC |
1 | ;;; Bug #1825: gas assemble PC-relative indexed addressing modes incorrectly |
2 | ;;; http://savannah.gnu.org/bugs/?func=detailbug&bug_id=1825&group_id=2424 | |
3 | ;;; | |
4 | .sect .text | |
5 | .globl _main | |
6 | _main: | |
7 | nop | |
8 | ldx L1,pc ; Assemble to 5-bit > 0 offset | |
9 | bra L2 | |
10 | L1: | |
11 | .dc.w 0xaabb | |
12 | L2: | |
13 | subd L1,pc ; Assemble to 5-bit < 0 offset | |
14 | L3: | |
15 | .ds.b 14, 0xA7 | |
16 | ldab L3,pc ; 5-bit < 0 offset | |
17 | ldab L4,pc ; 5-bit > 0 offset | |
5da0c277 | 18 | .skip 15 |
27bdea3d SC |
19 | L4: |
20 | .skip 128 | |
21 | subd L4,pc ; 9-bit < 0 offset | |
22 | addd L5,pc ; 9-bit > 0 offset | |
23 | .skip 128 | |
24 | L5: | |
5da0c277 | 25 | .skip 256-3 |
27bdea3d SC |
26 | orab L5,pc ; 9 bit < 0 offset (min value) |
27 | oraa L6,pc ; 9 bit > 0 offset (max value) | |
28 | .skip 255 | |
29 | L6: | |
5da0c277 SC |
30 | .skip 256-2 |
31 | orab L6,pc ; 16 bit < 0 offset | |
27bdea3d SC |
32 | anda _main,pc ; 16 bit < 0 offset |
33 | andb L7,pc | |
34 | .skip 256 | |
35 | L7: | |
36 | stab external,pc ; External 16-bit PCREL | |
37 | ldd _table,pc | |
38 | addd _table+2,pc | |
39 | subd _table+4,pc | |
40 | addd _table+8,pc | |
41 | addd _table+12,pc | |
42 | addd _table+16,pc | |
43 | rts | |
44 | nop | |
45 | _table: | |
46 | .ds.b 16,0 |