1 .data
2foodata: .word 42
3	 .text
4footext:
5	.global add
6add:
7	add r0, r1
8	add #0, r2
9	.global add2
10add2:
11	add2 #-1, r3
12	.global addc
13addc:
14	addc r4, r5
15	.global addn
16addn:
17	addn r6, r7
18	addn #15, r8
19	.global addn2
20addn2:
21	addn2 #-16, r9
22	.global sub
23sub:
24	sub r10, r11
25	.global subc
26subc:
27	subc r12, r13
28	.global subn
29subn:
30	subn r14, r15
31	.global cmp
32cmp:
33	cmp ac, fp
34	cmp #1, sp
35	.global cmp2
36cmp2:
37	cmp2 #-15, r0
38	.global and
39and:
40	and r1, r2
41	and r3, @r4
42	.global andh
43andh:
44	andh r5, @r6
45	.global andb
46andb:
47	andb r7, @r8
48	.global or
49or:
50	or r9, r10
51	or r11, @r12
52	.global orh
53orh:
54	orh r13, @r14
55	.global orb
56orb:
57	orb r15, @ac
58	.global eor
59eor:
60	eor fp, sp
61	eor r0, @r1
62	.global eorh
63eorh:
64	eorh r2, @r3
65	.global eorb
66eorb:
67	eorb r4, @r5
68	.global bandl
69bandl:
70	bandl #15, @r6
71	.global bandh
72nadh:
73	bandh #7, @r7
74	.global borl
75borl:
76	borl #3, @r8
77	.global borh
78borh:
79	borh #13, @r9
80	.global beorl
81beorl:
82	beorl #15, @r10
83	.global beorh
84beorh:
85	beorh #1, @r11
86	.global btstl
87btstl:
88	btstl #0, @r12
89	.global btsth
90btsth:
91	btsth #8, @r13
92	.global mul
93mul:
94	mul r14, r15
95	.global mulu
96mulu:
97	mulu ac, fp
98	.global muluh
99muluh:
100	muluh sp, r0
101	.global mulh
102mulh:
103	mulh r1, r2
104	.global div0s
105div0s:
106	div0s r3
107	.global div0u
108div0u:
109	div0u r4
110	.global div1
111div1:
112	div1 r5
113	.global div2
114div2:
115	div2 r6
116	.global div3
117div3:
118	div3
119	.global div4s
120div4s:
121	div4s
122	.global lsl
123lsl:
124	lsl r7, r8
125	lsl #3, r9
126	.global lsl2
127lsl2:
128	lsl2 #0, r10
129	.global lsr
130lsr:
131	lsr r11, r12
132	lsr #15, r13
133	.global lsr2
134lsr2:
135	lsr2 #15, r14
136	.global asr
137asr:
138	asr r15, ac
139	asr #6, fp
140	.global asr2
141asr2:
142	asr2 #7, sp
143	.global ldi_8
144ldi_8:
145	ldi:8 #0xff, r2
146	.global ld
147ld:
148	ld @r3, r4
149	ld @(R13, r5), r6
150	ld @(R14, 0x1fc), r7
151	ld @(R15, 0x3c), r8
152	ld @r15+, r9
153	ld @r15+, ps
154	ld @R15+, tbr
155	ld @r15+, rp
156	ld @R15+, ssp
157	.global lduh
158lduh:
159	lduh @r10, r11
160	lduh @(r13, r12), r13
161	lduh @(r14, #-256), r15
162	.global ldub
163ldub:
164	ldub @ac, fp
165	ldub @(r13, sp), r0
166	ldub @(r14, -128), r1
167	.global st
168st:
169	st r2, @r3
170	st r4, @(r13, r5)
171	st r6, @(r14, -512)
172	st r7, @(r15, 0x3c)
173	st r8, @ - r15
174	st MDH, @-r15
175	st PS, @ - r15
176	.global lsth
177sth:
178	sth r9, @r10
179	sth r11, @(r13, r12)
180	sth r13, @(r14, 128)
181	.global stb
182stb:
183	STB r14, @r15
184	stb r0, @(r13, r1)
185	STB r2, @(r14, -128)
186	.global mov
187mov:
188	mov r3, r4
189	MOV mdl, r5
190	mov ps, r6
191	mov r7, usp
192	mov r8, ps
193	.global jmp
194jmp:
195	jmp @r9
196	.global ret
197ret:
198	ret
199	.global bra
200bra:
201	bra footext
202	.global bno
203bno:
204	bno footext
205	.global beq
206beq:
207	beq footext
208	.global bne
209bne:
210	bne footext
211	.global bc
212bc:
213	bc footext
214	.global bnc
215bnc:
216	bnc footext
217	.global bn
218bn:
219	bn footext
220	.global bp
221bp:
222	bp footext
223	.global bv
224bv:
225	bv footext
226	.global bnv
227bnv:
228	bnv footext
229	.global blt
230blt:
231	blt footext
232	.global bge
233bge:
234	bge footext
235	.global ble
236ble:
237	ble footext
238	.global bgt
239bgt:
240	bgt footext
241	.global bls
242bls:
243	bls footext
244	.global bhi
245bhi:
246	bhi footext
247delay_footext:
248	.global jmp_d
249jmp_d:
250	jmp:d @r11
251	nop
252	.global ret_d
253ret_d:
254	ret:d
255	nop
256	.global bra_d
257bra_d:
258	bra:D delay_footext
259	nop
260	.global bno_d
261bno_d:
262	bno:d delay_footext
263	nop
264	.global beq_d
265beq_d:
266	beq:D delay_footext
267	nop
268	.global bne_d
269bne_d:
270	bne:d delay_footext
271	nop
272	.global bc_d
273bc_d:
274	bc:d delay_footext
275	nop
276	.global bnc_d
277bnc_d:
278	bnc:d delay_footext
279	nop
280	.global bn_d
281bn_d:
282	bn:d delay_footext
283	nop
284	.global bp_d
285bp_d:
286	bp:d delay_footext
287	nop
288	.global bv_d
289bv_d:
290	bv:d delay_footext
291	nop
292	.global bnv_d
293bnv_d:
294	bnv:d delay_footext
295	nop
296	.global blt_d
297blt_d:
298	blt:d delay_footext
299	nop
300	.global bge_d
301bge_d:
302	bge:d delay_footext
303	nop
304	.global ble_d
305ble_d:
306	ble:d delay_footext
307	nop
308	.global bgt_d
309bgt_d:
310	bgt:d delay_footext
311	nop
312	.global bls_d
313bls_d:
314	bls:d delay_footext
315	nop
316	.global bhi_d
317bhi_d:
318	bhi:d delay_footext
319	nop
320	.global ldres
321ldres:
322	ldres @r2+, #8
323	.global stres
324stres:
325	stres #15, @r3+
326	.global nop
327nop:
328	nop
329	.global andccr
330andccr:
331	andccr #255
332	.global orccr
333orccr:
334	orccr #125
335	.global stilm
336stilm:
337	stilm #97
338	.global addsp
339addsp:
340	addsp #-512
341	.global extsb
342extsb:
343	extsb r9
344	.global extub
345extub:
346	extub r10
347	.global extsh
348extsh:
349	extsh r11
350	.global extuh
351extuh:
352	extuh r12
353	.global enter
354enter:
355	enter #1020
356	.global leave
357leave:
358	leave
359	.global xchb
360xchb:
361	xchb @r14, r15
362	.global ldi_32
363ldi_32:
364	ldi:32 #0x12345678, r0
365	.global copop
366copop:
367	copop #15, #1, cr3, cr4
368	copop #15, #4, cr5, cr6
369	copop #15, #255, cr7, cr0
370	.global copld
371copld:
372	copld #0, #0, r4, cr0
373	.global copst
374copst:
375	copst #7, #2, cr1, r5
376	.global copsv
377copsv:
378	copsv #8, #3, cr2, r6
379	.global ldm0
380ldm0:
381	ldm0 (r0, r2, r3, r7)
382	.global ldm1
383ldm1:
384	ldm1 (r8, r11, r15)
385	.global stm0
386stm0:
387	stm0 (r2, r3)
388	.global stm1
389stm1:
390	stm1 (r13, r14)
391	.global call
392call:
393	call footext
394	call @r10
395	.global call_d
396call_d:
397	call:D footext
398	nop
399	call:d @r12
400	nop
401	.global dmov
402dmov:
403	dmov @0x88, r13
404	dmov r13, @0x54
405	dmov @0x44, @r13+
406	dmov @R13+, @0x2
407	dmov @0x2c, @-r15
408	dmov @r15+, @38
409	.global dmovh
410dmovh:
411	dmovh @0x88, r13
412	dmovh r13, @0x52
413	dmovh @0x34, @r13 +
414	dmovh @r13+, @0x52
415	.global dmovb
416dmovb:
417	dmovb @0x91, r13
418	dmovb r13, @0x53
419	dmovb @71, @r13+
420	dmovb @r13+, @0x0
421	.global ldi_20
422ldi_20:
423 	ldi:20 #0x000fffff, r1
424finish:
425        ldi:32 #0x8000,r0
426	mov    r0,ssp
427        ldi:32 #1,r0
428	int    #10
429	.global inte
430inte:
431	inte
432	.global reti
433reti:
434	reti
435