15
#define RegWord(ModRM) cpustate->regs.w[Mod_RM.reg.w[ModRM]]
16
#define RegByte(ModRM) cpustate->regs.b[Mod_RM.reg.b[ModRM]]
18
#define GetRMWord(ModRM) \
19
((ModRM) >= 0xc0 ? cpustate->regs.w[Mod_RM.RM.w[ModRM]] : ( (*GetEA[ModRM])(cpustate), i80286_check_permission(cpustate, cpustate->ea_seg, cpustate->eo, I80286_WORD, I80286_READ), ReadWord( cpustate->ea ) ))
21
#define PutbackRMWord(ModRM,val) \
23
if (ModRM >= 0xc0) cpustate->regs.w[Mod_RM.RM.w[ModRM]]=val; \
26
i80286_check_permission(cpustate, cpustate->ea_seg, cpustate->eo, I80286_WORD, I80286_WRITE); \
27
WriteWord(cpustate->ea,val); \
31
#define GetnextRMWord \
33
i80286_check_permission(cpustate, cpustate->ea_seg, cpustate->ea + 2 - cpustate->base[cpustate->ea_seg], I80286_WORD, I80286_READ), \
34
ReadWord(cpustate->ea+2) \
37
#define GetRMWordOffset(offs) \
39
i80286_check_permission(cpustate, cpustate->ea_seg, (UINT16)(cpustate->eo+offs), I80286_WORD, I80286_READ), \
40
ReadWord(cpustate->ea-cpustate->eo+(UINT16)(cpustate->eo+offs)) \
43
#define GetRMByteOffset(offs) \
45
i80286_check_permission(cpustate, cpustate->ea_seg, (UINT16)(cpustate->eo+offs), I80286_BYTE, I80286_READ), \
46
ReadByte(cpustate->ea-cpustate->eo+(UINT16)(cpustate->eo+offs)) \
49
#define PutRMWord(ModRM,val) \
52
cpustate->regs.w[Mod_RM.RM.w[ModRM]]=val; \
54
(*GetEA[ModRM])(cpustate); \
55
i80286_check_permission(cpustate, cpustate->ea_seg, cpustate->eo, I80286_WORD, I80286_WRITE); \
56
WriteWord( cpustate->ea ,val); \
60
#define PutRMWordOffset(offs, val) \
61
i80286_check_permission(cpustate, cpustate->ea_seg, (UINT16)(cpustate->eo+offs), I80286_WORD, I80286_WRITE); \
62
WriteWord( cpustate->ea-cpustate->eo+(UINT16)(cpustate->eo+offs), val)
64
#define PutRMByteOffset(offs, val) \
65
i80286_check_permission(cpustate, cpustate->ea_seg, (UINT16)(cpustate->eo+offs), I80286_BYTE, I80286_WRITE); \
66
WriteByte( cpustate->ea-cpustate->eo+(UINT16)(cpustate->eo+offs), val)
68
#define PutImmRMWord(ModRM) \
72
FETCHWORD(cpustate->regs.w[Mod_RM.RM.w[ModRM]]) \
74
(*GetEA[ModRM])(cpustate); \
75
i80286_check_permission(cpustate, cpustate->ea_seg, cpustate->eo, I80286_WORD, I80286_WRITE); \
77
WriteWord( cpustate->ea , val); \
81
#define GetRMByte(ModRM) \
82
((ModRM) >= 0xc0 ? cpustate->regs.b[Mod_RM.RM.b[ModRM]] : ( (*GetEA[ModRM])(cpustate), i80286_check_permission(cpustate, cpustate->ea_seg, cpustate->eo, I80286_BYTE, I80286_READ), ReadByte( cpustate->ea )) )
84
#define PutRMByte(ModRM,val) \
87
cpustate->regs.b[Mod_RM.RM.b[ModRM]]=val; \
90
(*GetEA[ModRM])(cpustate); \
91
i80286_check_permission(cpustate, cpustate->ea_seg, cpustate->eo, I80286_BYTE, I80286_WRITE); \
92
WriteByte( cpustate->ea,val); \
96
#define PutImmRMByte(ModRM) \
99
cpustate->regs.b[Mod_RM.RM.b[ModRM]]=FETCH; \
101
(*GetEA[ModRM])(cpustate); \
102
i80286_check_permission(cpustate, cpustate->ea_seg, cpustate->eo, I80286_BYTE, I80286_WRITE); \
103
WriteByte( cpustate->ea , FETCH ); \
107
#define PutbackRMByte(ModRM,val) \
110
cpustate->regs.b[Mod_RM.RM.b[ModRM]]=val; \
113
i80286_check_permission(cpustate, cpustate->ea_seg, cpustate->eo, I80286_BYTE, I80286_WRITE); \
114
WriteByte(cpustate->ea,val); \
118
#define DEF_br8(dst,src) \
119
unsigned ModRM = FETCHOP; \
120
unsigned src = RegByte(ModRM); \
121
unsigned dst = GetRMByte(ModRM)
123
#define DEF_wr16(dst,src) \
124
unsigned ModRM = FETCHOP; \
125
unsigned src = RegWord(ModRM); \
126
unsigned dst = GetRMWord(ModRM)
128
#define DEF_r8b(dst,src) \
129
unsigned ModRM = FETCHOP; \
130
unsigned dst = RegByte(ModRM); \
131
unsigned src = GetRMByte(ModRM)
133
#define DEF_r16w(dst,src) \
134
unsigned ModRM = FETCHOP; \
135
unsigned dst = RegWord(ModRM); \
136
unsigned src = GetRMWord(ModRM)
138
#define DEF_ald8(dst,src) \
139
unsigned src = FETCHOP; \
140
unsigned dst = cpustate->regs.b[AL]
142
#define DEF_axd16(dst,src) \
143
unsigned src = FETCHOP; \
144
unsigned dst = cpustate->regs.w[AX]; \