Debian Codegraph @

src/cpu/core_normal/support.h

raw symbols SCIP
1 /*
2 * Copyright (C) 2002-2010 The DOSBox Team
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 */
18
19
20 #define LoadMbs(off) (Bit8s)(LoadMb(off))
21 #define LoadMws(off) (Bit16s)(LoadMw(off))
22 #define LoadMds(off) (Bit32s)(LoadMd(off))
23
24 #define LoadRb(reg) reg
25 #define LoadRw(reg) reg
26 #define LoadRd(reg) reg
27
28 #define SaveRb(reg,val) reg=val
29 #define SaveRw(reg,val) reg=val
30 #define SaveRd(reg,val) reg=val
31
32 static INLINE Bit8s Fetchbs() {
33 return Fetchb();
34 }
35 static INLINE Bit16s Fetchws() {
36 return Fetchw();
37 }
38
39 static INLINE Bit32s Fetchds() {
40 return Fetchd();
41 }
42
43
44 #define RUNEXCEPTION() { \
45 CPU_Exception(cpu.exception.which,cpu.exception.error); \
46 continue; \
47 }
48
49 #define EXCEPTION(blah) \
50 { \
51 CPU_Exception(blah); \
52 continue; \
53 }
54
55 //TODO Could probably make all byte operands fast?
56 #define JumpCond16_b(COND) { \
57 SAVEIP; \
58 if (COND) reg_ip+=Fetchbs(); \
59 reg_ip+=1; \
60 continue; \
61 }
62
63 #define JumpCond16_w(COND) { \
64 SAVEIP; \
65 if (COND) reg_ip+=Fetchws(); \
66 reg_ip+=2; \
67 continue; \
68 }
69
70 #define JumpCond32_b(COND) { \
71 SAVEIP; \
72 if (COND) reg_eip+=Fetchbs(); \
73 reg_eip+=1; \
74 continue; \
75 }
76
77 #define JumpCond32_d(COND) { \
78 SAVEIP; \
79 if (COND) reg_eip+=Fetchds(); \
80 reg_eip+=4; \
81 continue; \
82 }
83
84
85 #define SETcc(cc) \
86 { \
87 GetRM; \
88 if (rm >= 0xc0 ) {GetEArb;*earb=(cc) ? 1 : 0;} \
89 else {GetEAa;SaveMb(eaa,(cc) ? 1 : 0);} \
90 }
91
92 #include "helpers.h"
93 #include "table_ea.h"
94 #include "../modrm.h"
95
96