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), ReadWord( cpustate->ea ) ))
21 #define PutbackRMWord(ModRM,val) \
23 if (ModRM >= 0xc0) cpustate->regs.w[Mod_RM.RM.w[ModRM]]=val; \
24 else WriteWord(cpustate->ea,val); \
27 #define GetnextRMWord ReadWord(cpustate->ea+2)
29 #define GetRMWordOffset(offs) \
30 ReadWord(cpustate->ea-cpustate->eo+(UINT16)(cpustate->eo+offs))
32 #define GetRMByteOffset(offs) \
33 ReadByte(cpustate->ea-cpustate->eo+(UINT16)(cpustate->eo+offs))
35 #define PutRMWord(ModRM,val) \
38 cpustate->regs.w[Mod_RM.RM.w[ModRM]]=val; \
40 (*GetEA[ModRM])(cpustate); \
41 WriteWord( cpustate->ea ,val); \
45 #define PutRMWordOffset(offs, val) \
46 WriteWord( cpustate->ea-cpustate->eo+(UINT16)(cpustate->eo+offs), val)
48 #define PutRMByteOffset(offs, val) \
49 WriteByte( cpustate->ea-cpustate->eo+(UINT16)(cpustate->eo+offs), val)
51 #define PutImmRMWord(ModRM) \
55 FETCHWORD(cpustate->regs.w[Mod_RM.RM.w[ModRM]]) \
57 (*GetEA[ModRM])(cpustate); \
59 WriteWord( cpustate->ea , val); \
63 #define GetRMByte(ModRM) \
64 ((ModRM) >= 0xc0 ? cpustate->regs.b[Mod_RM.RM.b[ModRM]] : ReadByte( (*GetEA[ModRM])(cpustate) ))
66 #define PutRMByte(ModRM,val) \
69 cpustate->regs.b[Mod_RM.RM.b[ModRM]]=val; \
71 WriteByte( (*GetEA[ModRM])(cpustate) ,val); \
74 #define PutImmRMByte(ModRM) \
77 cpustate->regs.b[Mod_RM.RM.b[ModRM]]=FETCH; \
79 (*GetEA[ModRM])(cpustate); \
80 WriteByte( cpustate->ea , FETCH ); \
84 #define PutbackRMByte(ModRM,val) \
87 cpustate->regs.b[Mod_RM.RM.b[ModRM]]=val; \
89 WriteByte(cpustate->ea,val); \
92 #define DEF_br8(dst,src) \
93 unsigned ModRM = FETCHOP; \
94 unsigned src = RegByte(ModRM); \
95 unsigned dst = GetRMByte(ModRM)
97 #define DEF_wr16(dst,src) \
98 unsigned ModRM = FETCHOP; \
99 unsigned src = RegWord(ModRM); \
100 unsigned dst = GetRMWord(ModRM)
102 #define DEF_r8b(dst,src) \
103 unsigned ModRM = FETCHOP; \
104 unsigned dst = RegByte(ModRM); \
105 unsigned src = GetRMByte(ModRM)
107 #define DEF_r16w(dst,src) \
108 unsigned ModRM = FETCHOP; \
109 unsigned dst = RegWord(ModRM); \
110 unsigned src = GetRMWord(ModRM)
112 #define DEF_ald8(dst,src) \
113 unsigned src = FETCHOP; \
114 unsigned dst = cpustate->regs.b[AL]
116 #define DEF_axd16(dst,src) \
117 unsigned src = FETCHOP; \
118 unsigned dst = cpustate->regs.w[AX]; \