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.
28 void returnHook(void);
29 #define RETURNHOOK returnHook()
34 #define RET_CC(ccn, cc, n) \
35 OPDEF(ret_ ## ccn, 0xC0+n*8) \
47 RET_CC(nz
, !TESTZF
, 0)
49 RET_CC(nc
, !TESTCF
, 2)
51 RET_CC(po
, !TESTPF
, 4)
56 #define POP_RR(rrn, rr, n) \
57 OPDEF(pop_ ## rrn, 0xC1+n*0x10) \
79 dtmp
= BCBK
, BCBK
= BC
, BC
= dtmp
;
80 dtmp
= DEBK
, DEBK
= DE
, DE
= dtmp
;
81 dtmp
= HLBK
, HLBK
= HL
, HL
= dtmp
;
86 #define JP_RR(rrn, rr) \
87 OPDEF(jp_ ## rrn, 0xE9) \
95 #define LD_SP_RR(rrn, rr) \
96 OPDEF(ld_sp_ ## rrn, 0xF9) \
104 #define JP_CC(ccn, cc, n) \
105 OPDEF(jp_ ## ccn ## _nn, 0xC2+n*8) \
117 JP_CC(nz
, !TESTZF
, 0)
119 JP_CC(nc
, !TESTCF
, 2)
121 JP_CC(po
, !TESTPF
, 4)
133 OPDEF(out_in_a
, 0xD3)
147 #define EX_ISP_RR(rrn, rr) \
148 OPDEF(ex_isp_ ## rrn, 0xE3) \
150 register dbyte dtmp; \
159 OPDEF(ex_de_hl
, 0xEB)
185 #define CALL_CC(ccn, cc, n) \
186 OPDEF(call_ ## ccn ## _nn, 0xC4+n*8) \
193 register dbyte dtmp; \
202 CALL_CC(nz
, !TESTZF
, 0)
203 CALL_CC(z
, TESTZF
, 1)
204 CALL_CC(nc
, !TESTCF
, 2)
205 CALL_CC(c
, TESTCF
, 3)
206 CALL_CC(po
, !TESTPF
, 4)
207 CALL_CC(pe
, TESTPF
, 5)
208 CALL_CC(p
, !TESTSF
, 6)
209 CALL_CC(m
, TESTSF
, 7)
213 #define PUSH_RR(rrn, rr, n) \
214 OPDEF(push_ ## rrn, 0xC5+n*0x10) \
297 #define RST_NN(nnn, n) \
298 OPDEF(rst_ ## nnn, 0xC7+n*8) \
316 #include "z80_op4x.c"