2 * Copyright (C) 1996-1998 Szeredi Miklos
3 * Email: mszeredi@inf.bme.hu
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version. See the file COPYING.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
27 #define RET_CC(ccn, cc, n) \
28 OPDEF(ret_ ## ccn, 0xC0+n*8) \
39 RET_CC(nz
, !TESTZF
, 0)
41 RET_CC(nc
, !TESTCF
, 2)
43 RET_CC(po
, !TESTPF
, 4)
48 #define POP_RR(rrn, rr, n) \
49 OPDEF(pop_ ## rrn, 0xC1+n*0x10) \
70 dtmp
= BCBK
, BCBK
= BC
, BC
= dtmp
;
71 dtmp
= DEBK
, DEBK
= DE
, DE
= dtmp
;
72 dtmp
= HLBK
, HLBK
= HL
, HL
= dtmp
;
77 #define JP_RR(rrn, rr) \
78 OPDEF(jp_ ## rrn, 0xE9) \
86 #define LD_SP_RR(rrn, rr) \
87 OPDEF(ld_sp_ ## rrn, 0xF9) \
95 #define JP_CC(ccn, cc, n) \
96 OPDEF(jp_ ## ccn ## _nn, 0xC2+n*8) \
108 JP_CC(nz
, !TESTZF
, 0)
110 JP_CC(nc
, !TESTCF
, 2)
112 JP_CC(po
, !TESTPF
, 4)
124 OPDEF(out_in_a
, 0xD3)
138 #define EX_ISP_RR(rrn, rr) \
139 OPDEF(ex_isp_ ## rrn, 0xE3) \
141 register dbyte dtmp; \
150 OPDEF(ex_de_hl
, 0xEB)
176 #define CALL_CC(ccn, cc, n) \
177 OPDEF(call_ ## ccn ## _nn, 0xC4+n*8) \
184 register dbyte dtmp; \
193 CALL_CC(nz
, !TESTZF
, 0)
194 CALL_CC(z
, TESTZF
, 1)
195 CALL_CC(nc
, !TESTCF
, 2)
196 CALL_CC(c
, TESTCF
, 3)
197 CALL_CC(po
, !TESTPF
, 4)
198 CALL_CC(pe
, TESTPF
, 5)
199 CALL_CC(p
, !TESTSF
, 6)
200 CALL_CC(m
, TESTSF
, 7)
204 #define PUSH_RR(rrn, rr, n) \
205 OPDEF(push_ ## rrn, 0xC5+n*0x10) \
288 #define RST_NN(nnn, n) \
289 OPDEF(rst_ ## nnn, 0xC7+n*8) \
305 #include "z80_op4x.c"