1	.text
2	.org 0
3	;; eZ80 instructions
4
5; AND A,x group
6	and	a,a
7	and	a,b
8	and	a,c
9	and	a,d
10	and	a,e
11	and	a,h
12	and	a,l
13	and	a,(hl)
14	and	a,0xaa
15	and	a,(ix+5)
16	and	a,(iy-5)
17; CP A,x group
18	cp	a,a
19	cp	a,b
20	cp	a,c
21	cp	a,d
22	cp	a,e
23	cp	a,h
24	cp	a,l
25	cp	a,(hl)
26	cp	a,0xaa
27	cp	a,(ix+5)
28	cp	a,(iy-5)
29
30; OR A,x group
31	or	a,a
32	or	a,b
33	or	a,c
34	or	a,d
35	or	a,e
36	or	a,h
37	or	a,l
38	or	a,(hl)
39	or	a,0xaa
40	or	a,(ix+5)
41	or	a,(iy-5)
42
43; SUB A,x group
44	sub	a,a
45	sub	a,b
46	sub	a,c
47	sub	a,d
48	sub	a,e
49	sub	a,h
50	sub	a,l
51	sub	a,(hl)
52	sub	a,0xaa
53	sub	a,(ix+5)
54	sub	a,(iy-5)
55
56; TST A,x group
57	tst	a,a
58	tst	a,b
59	tst	a,c
60	tst	a,d
61	tst	a,e
62	tst	a,h
63	tst	a,l
64	tst	a,(hl)
65	tst	a,0x0f
66
67; XOR A,x group
68	xor	a,a
69	xor	a,b
70	xor	a,c
71	xor	a,d
72	xor	a,e
73	xor	a,h
74	xor	a,l
75	xor	a,(hl)
76	xor	a,0xaa
77	xor	a,(ix+5)
78	xor	a,(iy-5)
79
80; IN r,(BC) group (new naming)
81	in a,(bc)
82	in b,(bc)
83	in c,(bc)
84	in d,(bc)
85	in e,(bc)
86	in h,(bc)
87	in l,(bc)
88
89; OUT (BC),r group (new naming)
90	out (bc),a
91	out (bc),b
92	out (bc),c
93	out (bc),d
94	out (bc),e
95	out (bc),h
96	out (bc),l
97
98; LD rr,(ii+d) group
99	ld	bc,(ix-7)
100	ld	de,(ix-7)
101	ld	hl,(ix-7)
102	ld	ix,(ix-7)
103	ld	iy,(ix-7)
104
105	ld	bc,(iy+38)
106	ld	de,(iy+38)
107	ld	hl,(iy+38)
108	ld	ix,(iy+38)
109	ld	iy,(iy+38)
110
111; LD (ii+d),rr group
112	ld	(ix+126),bc
113	ld	(ix+126),de
114	ld	(ix+126),hl
115	ld	(ix+126),ix
116	ld	(ix+126),iy
117	ld	(iy-98),bc
118	ld	(iy-98),de
119	ld	(iy-98),hl
120	ld	(iy-98),ix
121	ld	(iy-98),iy
122
123; LEA rr,ii+d group
124	lea	bc,ix-27
125	lea	de,ix-27
126	lea	hl,ix-27
127	lea	ix,ix-27
128	lea	iy,ix-27
129	lea	bc,iy+12
130	lea	de,iy+12
131	lea	hl,iy+12
132	lea	ix,iy+12
133	lea	iy,iy+12
134
135; PEA ii+d group
136	pea	ix+127
137	pea	iy-128
138
139; IN0 group
140	in0 a,(0x5)
141	in0 b,(0x5)
142	in0 c,(0x5)
143	in0 d,(0x5)
144	in0 e,(0x5)
145	in0 h,(0x5)
146	in0 l,(0x5)
147
148; OUT0 group
149	out0 (0x5),a
150	out0 (0x5),b
151	out0 (0x5),c
152	out0 (0x5),d
153	out0 (0x5),e
154	out0 (0x5),h
155	out0 (0x5),l
156
157; MLT group
158	mlt bc
159	mlt de
160	mlt hl
161	mlt sp
162
163; TSTIO instruction
164	tstio 0f0h
165
166; SLP instruction
167	slp
168
169; ADLMIX flag manipulation instructions
170	stmix
171	rsmix
172
173; Additional block I/O instructions
174	inim
175	otim
176	ini2
177	indm
178	otdm
179	ind2
180	inimr
181	otimr
182	ini2r
183	indmr
184	otdmr
185	ind2r
186	outi2
187	outd2
188	oti2r
189	otd2r
190	inirx
191	otirx
192	indrx
193	otdrx
194
195; Index registers halves
196	ld a,ixh
197	ld b,ixh
198	ld c,ixh
199	ld d,ixh
200	ld e,ixh
201	ld ixh,ixh
202	ld ixl,ixh
203	ld a,ixl
204	ld b,ixl
205	ld c,ixl
206	ld d,ixl
207	ld e,ixl
208	ld ixh,ixl
209	ld ixl,ixl
210	ld a,iyh
211	ld b,iyh
212	ld c,iyh
213	ld d,iyh
214	ld e,iyh
215	ld iyh,iyh
216	ld iyl,iyh
217	ld a,iyl
218	ld b,iyl
219	ld c,iyl
220	ld d,iyl
221	ld e,iyl
222	ld iyh,iyl
223	ld iyl,iyl
224	ld ixh,a
225	ld ixh,b
226	ld ixh,c
227	ld ixh,d
228	ld ixh,e
229	ld ixh,ixh
230	ld ixh,ixl
231	ld ixh,25
232	ld ixl,a
233	ld ixl,b
234	ld ixl,c
235	ld ixl,d
236	ld ixl,e
237	ld ixl,ixh
238	ld ixl,ixl
239	ld ixl,25
240	ld iyh,a
241	ld iyh,b
242	ld iyh,c
243	ld iyh,d
244	ld iyh,e
245	ld iyh,iyh
246	ld iyh,iyl
247	ld iyh,25
248	ld iyl,a
249	ld iyl,b
250	ld iyl,c
251	ld iyl,d
252	ld iyl,e
253	ld iyl,iyh
254	ld iyl,iyl
255	ld iyl,25
256	add a,ixh
257	add a,ixl
258	add a,iyh
259	add a,iyl
260	adc a,ixh
261	adc a,ixl
262	adc a,iyh
263	adc a,iyl
264	cp a,ixh
265	cp a,ixl
266	cp a,iyh
267	cp a,iyl
268	dec ixh
269	dec ixl
270	dec iyh
271	dec iyl
272	inc ixh
273	inc ixl
274	inc iyh
275	inc iyl
276	sbc a,ixh
277	sbc a,ixl
278	sbc a,iyh
279	sbc a,iyl
280	sub a,ixh
281	sub a,ixl
282	sub a,iyh
283	sub a,iyl
284	and a,ixh
285	and a,ixl
286	and a,iyh
287	and a,iyl
288	or a,ixh
289	or a,ixl
290	or a,iyh
291	or a,iyl
292	xor a,ixh
293	xor a,ixl
294	xor a,iyh
295	xor a,iyl
296
297; Standard Z80 instructions
298
299	adc a,(hl)
300	adc a,(ix+9)
301	adc a,(iy+9)
302	adc a,3
303	adc a,a
304	adc a,b
305	adc a,c
306	adc a,d
307	adc a,e
308	adc a,h
309	adc a,l
310	adc hl,bc
311	adc hl,de
312	adc hl,hl
313	adc hl,sp
314	add a,(hl)
315	add a,(ix+9)
316	add a,(iy+9)
317	add a,3
318	add a,a
319	add a,b
320	add a,c
321	add a,d
322	add a,e
323	add a,h
324	add a,l
325	add hl,bc
326	add hl,de
327	add hl,hl
328	add hl,sp
329	add ix,bc
330	add ix,de
331	add ix,ix
332	add ix,sp
333	add iy,bc
334	add iy,de
335	add iy,iy
336	add iy,sp
337	and (hl)
338	and (ix+9)
339	and (iy+9)
340	and 3
341	and a
342	and b
343	and c
344	and d
345	and e
346	and h
347	and l
348	bit 0,(hl)
349	bit 0,(ix+9)
350	bit 0,(iy+9)
351	bit 0,a
352	bit 0,b
353	bit 0,c
354	bit 0,d
355	bit 0,e
356	bit 0,h
357	bit 0,l
358	bit 1,(hl)
359	bit 1,(ix+9)
360	bit 1,(iy+9)
361	bit 1,a
362	bit 1,b
363	bit 1,c
364	bit 1,d
365	bit 1,e
366	bit 1,h
367	bit 1,l
368	bit 2,(hl)
369	bit 2,(ix+9)
370	bit 2,(iy+9)
371	bit 2,a
372	bit 2,b
373	bit 2,c
374	bit 2,d
375	bit 2,e
376	bit 2,h
377	bit 2,l
378	bit 3,(hl)
379	bit 3,(ix+9)
380	bit 3,(iy+9)
381	bit 3,a
382	bit 3,b
383	bit 3,c
384	bit 3,d
385	bit 3,e
386	bit 3,h
387	bit 3,l
388	bit 4,(hl)
389	bit 4,(ix+9)
390	bit 4,(iy+9)
391	bit 4,a
392	bit 4,b
393	bit 4,c
394	bit 4,d
395	bit 4,e
396	bit 4,h
397	bit 4,l
398	bit 5,(hl)
399	bit 5,(ix+9)
400	bit 5,(iy+9)
401	bit 5,a
402	bit 5,b
403	bit 5,c
404	bit 5,d
405	bit 5,e
406	bit 5,h
407	bit 5,l
408	bit 6,(hl)
409	bit 6,(ix+9)
410	bit 6,(iy+9)
411	bit 6,a
412	bit 6,b
413	bit 6,c
414	bit 6,d
415	bit 6,e
416	bit 6,h
417	bit 6,l
418	bit 7,(hl)
419	bit 7,(ix+9)
420	bit 7,(iy+9)
421	bit 7,a
422	bit 7,b
423	bit 7,c
424	bit 7,d
425	bit 7,e
426	bit 7,h
427	bit 7,l
428	call 0x1234
429	call c,0x1234
430	call m,0x1234
431	call nc,0x1234
432	call nz,0x1234
433	call p,0x1234
434	call pe,0x1234
435	call po,0x1234
436	call z,0x1234
437	ccf
438	cp (hl)
439	cp (ix+9)
440	cp (iy+9)
441	cp 03
442	cp a
443	cp b
444	cp c
445	cp d
446	cp e
447	cp h
448	cp l
449	cpd
450	cpdr
451	cpi
452	cpir
453	cpl
454	daa
455	dec (hl)
456	dec (ix+9)
457	dec (iy+9)
458	dec a
459	dec b
460	dec bc
461	dec c
462	dec d
463	dec de
464	dec e
465	dec h
466	dec hl
467	dec ix
468	dec iy
469	dec l
470	dec sp
471	di
472	djnz .+7
473	ei
474	ex (sp),hl
475	ex (sp),ix
476	ex (sp),iy
477	ex af,af'	;'
478	ex de,hl
479	exx
480	halt
481	im 0
482	im 1
483	im 2
484	in a,(c)
485	in a,(3)
486	in b,(c)
487	in c,(c)
488	in d,(c)
489	in e,(c)
490	in h,(c)
491	in l,(c)
492	inc (hl)
493	inc (ix+9)
494	inc (iy+9)
495	inc a
496	inc b
497	inc bc
498	inc c
499	inc d
500	inc de
501	inc e
502	inc h
503	inc hl
504	inc ix
505	inc iy
506	inc l
507	inc sp
508	ind
509	indr
510	ini
511	inir
512	jp (hl)
513	jp (ix)
514	jp (iy)
515	jp 0x1234
516	jp c,0x1234
517	jp m,0x1234
518	jp nc,0x1234
519	jp nz,0x1234
520	jp p,0x1234
521	jp pe,0x1234
522	jp po,0x1234
523	jp z,0x1234
524	jr .+7
525	jr c,.+7
526	jr nc,.+7
527	jr nz,.+7
528	jr z,.+7
529	ld (0x1234),a
530	ld (0x1234),bc
531	ld (0x1234),de
532	ld (0x1234),hl
533	ld (0x1234),ix
534	ld (0x1234),iy
535	ld (0x1234),sp
536	ld (bc),a
537	ld (de),a
538	ld (hl),3
539	ld (hl),a
540	ld (hl),b
541	ld (hl),c
542	ld (hl),d
543	ld (hl),e
544	ld (hl),h
545	ld (hl),l
546	ld (ix+9),3
547	ld (ix+9),a
548	ld (ix+9),b
549	ld (ix+9),c
550	ld (ix+9),d
551	ld (ix+9),e
552	ld (ix+9),h
553	ld (ix+9),l
554	ld (iy+9),3
555	ld (iy+9),a
556	ld (iy+9),b
557	ld (iy+9),c
558	ld (iy+9),d
559	ld (iy+9),e
560	ld (iy+9),h
561	ld (iy+9),l
562	ld a,(0x1234)
563	ld a,(bc)
564	ld a,(de)
565	ld a,(hl)
566	ld a,(ix+9)
567	ld a,(iy+9)
568	ld a,3
569	ld a,a
570	ld a,b
571	ld a,c
572	ld a,d
573	ld a,e
574	ld a,h
575	ld a,i
576	ld a,l
577	ld a,r
578	ld b,(hl)
579	ld b,(ix+9)
580	ld b,(iy+9)
581	ld b,3
582	ld b,a
583	nop	;ld b,b
584	ld b,c
585	ld b,d
586	ld b,e
587	ld b,h
588	ld b,l
589	ld bc,(0x1234)
590	ld bc,0x1234
591	ld c,(hl)
592	ld c,(ix+9)
593	ld c,(iy+9)
594	ld c,3
595	ld c,a
596	ld c,b
597	nop	;ld c,c
598	ld c,d
599	ld c,e
600	ld c,h
601	ld c,l
602	ld d,(hl)
603	ld d,(ix+9)
604	ld d,(iy+9)
605	ld d,3
606	ld d,a
607	ld d,b
608	ld d,c
609	nop ;ld d,d
610	ld d,e
611	ld d,h
612	ld d,l
613	ld de,(0x1234)
614	ld de,0x1234
615	ld e,(hl)
616	ld e,(ix+9)
617	ld e,(iy+9)
618	ld e,3
619	ld e,a
620	ld e,b
621	ld e,c
622	ld e,d
623	nop ;ld e,e
624	ld e,h
625	ld e,l
626	ld h,(hl)
627	ld h,(ix+9)
628	ld h,(iy+9)
629	ld h,3
630	ld h,a
631	ld h,b
632	ld h,c
633	ld h,d
634	ld h,e
635	ld h,h
636	ld h,l
637	ld hl,(0x1234)
638	ld hl,0x1234
639	ld i,a
640	ld ix,(0x1234)
641	ld ix,0x1234
642	ld iy,(0x1234)
643	ld iy,0x1234
644	ld l,(hl)
645	ld l,(ix+9)
646	ld l,(iy+9)
647	ld l,3
648	ld l,a
649	ld l,b
650	ld l,c
651	ld l,d
652	ld l,e
653	ld l,h
654	ld l,l
655	ld r,a
656	ld sp,(0x1234)
657	ld sp,0x1234
658	ld sp,hl
659	ld sp,ix
660	ld sp,iy
661	ldd
662	lddr
663	ldi
664	ldir
665	neg
666	nop
667	or (hl)
668	or (ix+9)
669	or (iy+9)
670	or 3
671	or a
672	or b
673	or c
674	or d
675	or e
676	or h
677	or l
678	otdr
679	otir
680	out (c),a
681	out (c),b
682	out (c),c
683	out (c),d
684	out (c),e
685	out (c),h
686	out (c),l
687	out (3),a
688	outd
689	outi
690	pop af
691	pop bc
692	pop de
693	pop hl
694	pop ix
695	pop iy
696	push af
697	push bc
698	push de
699	push hl
700	push ix
701	push iy
702	res 0,(hl)
703	res 0,(ix+9)
704	res 0,(iy+9)
705	res 0,a
706	res 0,b
707	res 0,c
708	res 0,d
709	res 0,e
710	res 0,h
711	res 0,l
712	res 1,(hl)
713	res 1,(ix+9)
714	res 1,(iy+9)
715	res 1,a
716	res 1,b
717	res 1,c
718	res 1,d
719	res 1,e
720	res 1,h
721	res 1,l
722	res 2,(hl)
723	res 2,(ix+9)
724	res 2,(iy+9)
725	res 2,a
726	res 2,b
727	res 2,c
728	res 2,d
729	res 2,e
730	res 2,h
731	res 2,l
732	res 3,(hl)
733	res 3,(ix+9)
734	res 3,(iy+9)
735	res 3,a
736	res 3,b
737	res 3,c
738	res 3,d
739	res 3,e
740	res 3,h
741	res 3,l
742	res 4,(hl)
743	res 4,(ix+9)
744	res 4,(iy+9)
745	res 4,a
746	res 4,b
747	res 4,c
748	res 4,d
749	res 4,e
750	res 4,h
751	res 4,l
752	res 5,(hl)
753	res 5,(ix+9)
754	res 5,(iy+9)
755	res 5,a
756	res 5,b
757	res 5,c
758	res 5,d
759	res 5,e
760	res 5,h
761	res 5,l
762	res 6,(hl)
763	res 6,(ix+9)
764	res 6,(iy+9)
765	res 6,a
766	res 6,b
767	res 6,c
768	res 6,d
769	res 6,e
770	res 6,h
771	res 6,l
772	res 7,(hl)
773	res 7,(ix+9)
774	res 7,(iy+9)
775	res 7,a
776	res 7,b
777	res 7,c
778	res 7,d
779	res 7,e
780	res 7,h
781	res 7,l
782	ret
783	ret c
784	ret m
785	ret nc
786	ret nz
787	ret p
788	ret pe
789	ret po
790	ret z
791	reti
792	retn
793	rl (hl)
794	rl (ix+9)
795	rl (iy+9)
796	rl a
797	rl b
798	rl c
799	rl d
800	rl e
801	rl h
802	rl l
803	rla
804	rlc (hl)
805	rlc (ix+9)
806	rlc (iy+9)
807	rlc a
808	rlc b
809	rlc c
810	rlc d
811	rlc e
812	rlc h
813	rlc l
814	rlca
815	rld
816	rr (hl)
817	rr (ix+9)
818	rr (iy+9)
819	rr a
820	rr b
821	rr c
822	rr d
823	rr e
824	rr h
825	rr l
826	rra
827	rrc (hl)
828	rrc (ix+9)
829	rrc (iy+9)
830	rrc a
831	rrc b
832	rrc c
833	rrc d
834	rrc e
835	rrc h
836	rrc l
837	rrca
838	rrd
839	rst 0x00
840	rst 0x08
841	rst 0x10
842	rst 0x18
843	rst 0x20
844	rst 0x28
845	rst 0x30
846	rst 0x38
847	sbc a,(hl)
848	sbc a,(ix+9)
849	sbc a,(iy+9)
850	sbc a,3
851	sbc a,a
852	sbc a,b
853	sbc a,c
854	sbc a,d
855	sbc a,e
856	sbc a,h
857	sbc a,l
858	sbc hl,bc
859	sbc hl,de
860	sbc hl,hl
861	sbc hl,sp
862	scf
863	set 0,(hl)
864	set 0,(ix+9)
865	set 0,(iy+9)
866	set 0,a
867	set 0,b
868	set 0,c
869	set 0,d
870	set 0,e
871	set 0,h
872	set 0,l
873	set 1,(hl)
874	set 1,(ix+9)
875	set 1,(iy+9)
876	set 1,a
877	set 1,b
878	set 1,c
879	set 1,d
880	set 1,e
881	set 1,h
882	set 1,l
883	set 2,(hl)
884	set 2,(ix+9)
885	set 2,(iy+9)
886	set 2,a
887	set 2,b
888	set 2,c
889	set 2,d
890	set 2,e
891	set 2,h
892	set 2,l
893	set 3,(hl)
894	set 3,(ix+9)
895	set 3,(iy+9)
896	set 3,a
897	set 3,b
898	set 3,c
899	set 3,d
900	set 3,e
901	set 3,h
902	set 3,l
903	set 4,(hl)
904	set 4,(ix+9)
905	set 4,(iy+9)
906	set 4,a
907	set 4,b
908	set 4,c
909	set 4,d
910	set 4,e
911	set 4,h
912	set 4,l
913	set 5,(hl)
914	set 5,(ix+9)
915	set 5,(iy+9)
916	set 5,a
917	set 5,b
918	set 5,c
919	set 5,d
920	set 5,e
921	set 5,h
922	set 5,l
923	set 6,(hl)
924	set 6,(ix+9)
925	set 6,(iy+9)
926	set 6,a
927	set 6,b
928	set 6,c
929	set 6,d
930	set 6,e
931	set 6,h
932	set 6,l
933	set 7,(hl)
934	set 7,(ix+9)
935	set 7,(iy+9)
936	set 7,a
937	set 7,b
938	set 7,c
939	set 7,d
940	set 7,e
941	set 7,h
942	set 7,l
943	sla (hl)
944	sla (ix+9)
945	sla (iy+9)
946	sla a
947	sla b
948	sla c
949	sla d
950	sla e
951	sla h
952	sla l
953	sra (hl)
954	sra (ix+9)
955	sra (iy+9)
956	sra a
957	sra b
958	sra c
959	sra d
960	sra e
961	sra h
962	sra l
963	srl (hl)
964	srl (ix+9)
965	srl (iy+9)
966	srl a
967	srl b
968	srl c
969	srl d
970	srl e
971	srl h
972	srl l
973	sub (hl)
974	sub (ix+9)
975	sub (iy+9)
976	sub 3
977	sub a
978	sub b
979	sub c
980	sub d
981	sub e
982	sub h
983	sub l
984	xor (hl)
985	xor (ix+9)
986	xor (iy+9)
987	xor 3
988	xor a
989	xor b
990	xor c
991	xor d
992	xor e
993	xor h
994	xor l
995	ld	bc,(hl)
996	ld	de,(hl)
997	ld	hl,(hl)
998	ld	ix,(hl)
999	ld	iy,(hl)
1000	ld	(hl),bc
1001	ld	(hl),de
1002	ld	(hl),hl
1003	ld	(hl),ix
1004	ld	(hl),iy
1005