1	.text
2	.global foo
3foo:
4	adc	r4		; MSP430 instruction for comparison purposes.
5
6	adcx	r4
7	adcx.a	bar
8	adcx.b	r6
9	adcx.w	r7
10
11	addcx	r8, r9
12	addcx.a	#0x12345, r10
13	addcx.b	r11, r12
14	addcx.w	r13, r14
15
16	ADDX    @R9, PC
17	ADDX    R9, PC
18	ADDX.A  #FE000h, PC
19	ADDX.A  &EDE, PC
20	ADDX.A  @R9+, PC
21	ADDX.A  EDE, PC
22	addx.b	r1, r2
23	addx.w	r3, r4
24	ADDX    K(R4), R5
25
26	ANDX    #1234, 4(R6)
27	ANDX    4(R7), 4(R6)
28	ANDX    @R5+, 4(R6)
29	ANDX    EDE, 4(R6)
30	ANDX    EDE, TONI
31	ANDX.A  @R5, 4(R6)
32	ANDX.A  R5, 4(R6)
33	ANDX.B  &EDE, 4(R6)
34	andx.w	r1, r2
35
36	bicx	#0xa0, r14
37	bicx.a	#0xa0, r14
38	bicx.b	#0xa0, r14
39	bicx.w	#0xa0, r14
40
41	bisx	#8, r11
42	bisx.a	#8, r11
43	bisx.b	#8, r11
44	bisx.w	#8, r11
45
46	BITX    #20, R8
47	BITX    &EDE, &TONI
48	BITX    &EDE, R8
49	BITX    2(R5), R8
50	BITX    8(SP), &EDE
51	BITX    @R5+, &EDE
52	BITX    @R5+, R8
53	BITX    @R5, R8
54	BITX    EDE, &TONI
55	BITX.B  #12, &EDE
56	BITX.B  @R5, &EDE
57	BITX.B  EDE, R8
58	BITX.B  R5, R8
59	BITX.W  R5, &EDE
60
61	clrx	TONI
62	clrx.a	fooz
63	clrx.b	bar
64	clrx.w	baz
65
66	cmpx	#0, r15
67	cmpx.a	#01800h, ede
68	cmpx.b	@r1, r15
69	cmpx.w	@r2+, &pin
70
71	dadcx	fooz
72	dadcx.a 0(r12)
73	dadcx.b	bar
74	dadcx.w r12
75
76	daddx	@r5, r7
77	daddx.a	#10h, &decdr
78	daddx.b 2(r6), r4
79	daddx.w bcd, r4
80
81	decx	toni
82	decx.a	fooz
83	decx.b	bar
84	decx.w	fred
85
86	decdx	toni
87	decdx.a	fooz
88	decdx.b	bar
89	decdx.w	fred
90
91	incx	r4
92	incx.a	r5
93	incx.b	r6
94	incx.w	r7
95
96	incdx	r8
97	incdx.a	r9
98	incdx.b	r10
99	incdx.w	r11
100
101	invx	r12
102	invx.a	LEO
103	invx.b	r14
104	invx.w	r15
105
106	movx	#foo, r4
107	movx.a	#foo, r5
108	movx.b	#foo, r6
109	movx.w	#foo, r7
110	MOVX    &X, R5
111	MOVX    #X, R5
112	MOVX    R5, &Y
113	MOVX    #0xabcde, &Y
114	MOVX    &X, &Y
115	MOVX    #X, &Y
116	MOVX    X, R5
117	MOVX    R5, Y
118	MOVX    #0xabcde, Y
119	MOVX    X, Y
120
121	sbcx	r15
122	sbcx.a	012345h
123	sbcx.b	r15
124	sbcx.w	0(r7)
125
126	subcx	r15, r15
127	subcx.a	#012345h, r15
128	subcx.b	r15, r15
129	subcx.w	@r5+, 0(r7)
130
131	SUBX    2(R6), PC
132	SUBX.A  #4455, ede
133	SUBX.B  2(R6), PC
134	SUBX.W  2(R6), PC
135
136	tstx	LEO
137	tstx.a	foo
138	tstx.b	bar
139	tstx.w	baz
140
141	XORX    #5A5Ah, EDE
142	XORX    &EDE, TONI
143	XORX    @R8, EDE
144	XORX    R8, EDE
145	XORX.B  2(R6), EDE
146	XORX.B  @R8+, EDE
147	xorx.a	toni, &cntr
148	xorx.w	@r5, r6
149	xorx.a	#12345, 0x45678h(r15)
150
151	adda	#0x12345, r7
152	adda	r6, r14
153
154	bra	#bar
155	bra	#011044H
156	bra	r5
157	bra	&ede
158	bra	@r5
159	bra	@r5+
160	bra	0x9876(r5)
161
162	calla	r5
163	calla	0x1234(r6)
164	calla	@r7
165	calla	@r8+
166	calla	&foo
167	calla	bar
168	calla	#011004h
169
170	clra	r6
171
172	cmpa	r1, r2
173	cmpa	#0xfedcb, r3
174
175	decda	r5
176	incda	r5
177
178	mova 	R9,R8
179	MOVA 	#12345h,R12
180	MOVA	100h(R9),R8
181	MOVA	&EDE,R12
182	MOVA	@R9,R8
183	MOVA	@R9+,R8
184	MOVA	R8,100h(R9)
185	MOVA	R13,&EDE
186
187	reta
188	reti
189
190	suba	r5, r6
191	suba	#0xfffff, r6
192
193	tsta	fooz
194
195	popm	#1, r5
196	popm.a	#3, r15
197	popm.w	#8, r12
198
199	popx	r10
200	popx.a	r10
201	popx.b	r10
202	popx.w	r10
203
204	pushm	#1, r9
205	pushm.a	#2, r9
206	pushm.w	#3, r9
207
208	pushx	r8
209	pushx.a	r8
210	pushx.b	&ede
211	pushx.w	r8
212
213	rlam	#1, r15
214	rlam.a	#2, r15
215	rlam.w	#3, r15
216
217	rlax	r6
218	rlax.a	r6
219	rlax.w	r6
220
221	rlcx	r6
222	rlcx.a	r6
223	rlcx.w	r6
224
225	rram	#1, r6
226	rram.a	#4, r6
227	rram.w	#2, r6
228
229	rrax	r11
230	rrax.a	r11
231	rrax.w	r11
232
233	rrcm	#4, r5
234	rrcm.a	#1, r5
235	rrcm.w	#3, r5
236
237	rrcx	r13
238	rrcx.a	r13
239	rrcx.w	r13
240
241	rrum	#3, r4
242	rrum.a	#2, r4
243	rrum.w	#1, r4
244
245	rrux	r4
246	rrux.a	r7
247	rrux.b	r5
248	rrux.w	r6
249
250	swpbx	r1
251	swpbx.a	ede
252	swpbx.w	r12
253
254	sxtx	r2
255	sxtx.a	&ede
256	sxtx.w	r2
257
258	rpt	#5
259	rrax.a	r5
260	rpt	r5
261	rrax.a	r5
262
263	;; The following are all aliases for similarly named instructions
264	;; without the period.  Eg: add.a -> adda
265	add.a	r1, r2
266	br.a	r1
267	call.a	r1
268	clr.a	r1
269	cmp.a	r1, r2
270	decd.a	r1
271	incd.a	r1
272	mov.a	r1, r2
273	ret.a
274	sub.a	r1, r2
275	tst.a	fooz
276
277	;; Check that repeat counts can be used with shift instructions.
278	rpt r1 { rrux.w r1
279	rpt #2 { rrcx.w r2
280	rpt #3 { rrax.b r7
281	rpt r4 { rrax.a r4
282	rpt #5 { rlax.b r5
283	rpt #6 { rlcx.a r6
284