Add missing files from last commit.
This commit is contained in:
parent
9312de19ac
commit
f822488656
89 changed files with 18428 additions and 6383 deletions
645
src/x86_ops_arith.h
Normal file
645
src/x86_ops_arith.h
Normal file
|
|
@ -0,0 +1,645 @@
|
|||
#define OP_ARITH(name, operation, setflags, flagops) \
|
||||
static int op ## name ## _b_rmw_a16(uint32_t fetchdat) \
|
||||
{ \
|
||||
int tempc = CF_SET(); \
|
||||
fetch_ea_16(fetchdat); \
|
||||
if (mod == 3) \
|
||||
{ \
|
||||
uint8_t dst = getr8(rm); \
|
||||
uint8_t src = getr8(reg); \
|
||||
setflags ## 8 flagops; \
|
||||
setr8(rm, operation); \
|
||||
cycles -= timing_rr; \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
uint8_t dst = geteab(); if (abrt) return 0; \
|
||||
uint8_t src = getr8(reg); \
|
||||
seteab(operation); if (abrt) return 0; \
|
||||
setflags ## 8 flagops; \
|
||||
cycles -= timing_mr; \
|
||||
} \
|
||||
return 0; \
|
||||
} \
|
||||
static int op ## name ## _b_rmw_a32(uint32_t fetchdat) \
|
||||
{ \
|
||||
int tempc = CF_SET(); \
|
||||
fetch_ea_32(fetchdat); \
|
||||
if (mod == 3) \
|
||||
{ \
|
||||
uint8_t dst = getr8(rm); \
|
||||
uint8_t src = getr8(reg); \
|
||||
setflags ## 8 flagops; \
|
||||
setr8(rm, operation); \
|
||||
cycles -= timing_rr; \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
uint8_t dst = geteab(); if (abrt) return 0; \
|
||||
uint8_t src = getr8(reg); \
|
||||
seteab(operation); if (abrt) return 0; \
|
||||
setflags ## 8 flagops; \
|
||||
cycles -= timing_mr; \
|
||||
} \
|
||||
return 0; \
|
||||
} \
|
||||
\
|
||||
static int op ## name ## _w_rmw_a16(uint32_t fetchdat) \
|
||||
{ \
|
||||
int tempc = CF_SET(); \
|
||||
fetch_ea_16(fetchdat); \
|
||||
if (mod == 3) \
|
||||
{ \
|
||||
uint16_t dst = regs[rm].w; \
|
||||
uint16_t src = regs[reg].w; \
|
||||
setflags ## 16 flagops; \
|
||||
regs[rm].w = operation; \
|
||||
cycles -= timing_rr; \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
uint16_t dst = geteaw(); if (abrt) return 0; \
|
||||
uint16_t src = regs[reg].w; \
|
||||
seteaw(operation); if (abrt) return 0; \
|
||||
setflags ## 16 flagops; \
|
||||
cycles -= timing_mr; \
|
||||
} \
|
||||
return 0; \
|
||||
} \
|
||||
static int op ## name ## _w_rmw_a32(uint32_t fetchdat) \
|
||||
{ \
|
||||
int tempc = CF_SET(); \
|
||||
fetch_ea_32(fetchdat); \
|
||||
if (mod == 3) \
|
||||
{ \
|
||||
uint16_t dst = regs[rm].w; \
|
||||
uint16_t src = regs[reg].w; \
|
||||
setflags ## 16 flagops; \
|
||||
regs[rm].w = operation; \
|
||||
cycles -= timing_rr; \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
uint16_t dst = geteaw(); if (abrt) return 0; \
|
||||
uint16_t src = regs[reg].w; \
|
||||
seteaw(operation); if (abrt) return 0; \
|
||||
setflags ## 16 flagops; \
|
||||
cycles -= timing_mr; \
|
||||
} \
|
||||
return 0; \
|
||||
} \
|
||||
\
|
||||
static int op ## name ## _l_rmw_a16(uint32_t fetchdat) \
|
||||
{ \
|
||||
int tempc = CF_SET(); \
|
||||
fetch_ea_16(fetchdat); \
|
||||
if (mod == 3) \
|
||||
{ \
|
||||
uint32_t dst = regs[rm].l; \
|
||||
uint32_t src = regs[reg].l; \
|
||||
setflags ## 32 flagops; \
|
||||
regs[rm].l = operation; \
|
||||
cycles -= timing_rr; \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
uint32_t dst = geteal(); if (abrt) return 0; \
|
||||
uint32_t src = regs[reg].l; \
|
||||
seteal(operation); if (abrt) return 0; \
|
||||
setflags ## 32 flagops; \
|
||||
cycles -= timing_mrl; \
|
||||
} \
|
||||
return 0; \
|
||||
} \
|
||||
static int op ## name ## _l_rmw_a32(uint32_t fetchdat) \
|
||||
{ \
|
||||
int tempc = CF_SET(); \
|
||||
fetch_ea_32(fetchdat); \
|
||||
if (mod == 3) \
|
||||
{ \
|
||||
uint32_t dst = regs[rm].l; \
|
||||
uint32_t src = regs[reg].l; \
|
||||
setflags ## 32 flagops; \
|
||||
regs[rm].l = operation; \
|
||||
cycles -= timing_rr; \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
uint32_t dst = geteal(); if (abrt) return 0; \
|
||||
uint32_t src = regs[reg].l; \
|
||||
seteal(operation); if (abrt) return 0; \
|
||||
setflags ## 32 flagops; \
|
||||
cycles -= timing_mrl; \
|
||||
} \
|
||||
return 0; \
|
||||
} \
|
||||
\
|
||||
static int op ## name ## _b_rm_a16(uint32_t fetchdat) \
|
||||
{ \
|
||||
int tempc = CF_SET(); \
|
||||
uint8_t dst, src; \
|
||||
fetch_ea_16(fetchdat); \
|
||||
dst = getr8(reg); \
|
||||
src = geteab(); if (abrt) return 0; \
|
||||
setflags ## 8 flagops; \
|
||||
setr8(reg, operation); \
|
||||
cycles -= (mod == 3) ? timing_rr : timing_rm; \
|
||||
return 0; \
|
||||
} \
|
||||
static int op ## name ## _b_rm_a32(uint32_t fetchdat) \
|
||||
{ \
|
||||
int tempc = CF_SET(); \
|
||||
uint8_t dst, src; \
|
||||
fetch_ea_32(fetchdat); \
|
||||
dst = getr8(reg); \
|
||||
src = geteab(); if (abrt) return 0; \
|
||||
setflags ## 8 flagops; \
|
||||
setr8(reg, operation); \
|
||||
cycles -= (mod == 3) ? timing_rr : timing_rm; \
|
||||
return 0; \
|
||||
} \
|
||||
\
|
||||
static int op ## name ## _w_rm_a16(uint32_t fetchdat) \
|
||||
{ \
|
||||
int tempc = CF_SET(); \
|
||||
uint16_t dst, src; \
|
||||
fetch_ea_16(fetchdat); \
|
||||
dst = regs[reg].w; \
|
||||
src = geteaw(); if (abrt) return 0; \
|
||||
setflags ## 16 flagops; \
|
||||
regs[reg].w = operation; \
|
||||
cycles -= (mod == 3) ? timing_rr : timing_rm; \
|
||||
return 0; \
|
||||
} \
|
||||
static int op ## name ## _w_rm_a32(uint32_t fetchdat) \
|
||||
{ \
|
||||
int tempc = CF_SET(); \
|
||||
uint16_t dst, src; \
|
||||
fetch_ea_32(fetchdat); \
|
||||
dst = regs[reg].w; \
|
||||
src = geteaw(); if (abrt) return 0; \
|
||||
setflags ## 16 flagops; \
|
||||
regs[reg].w = operation; \
|
||||
cycles -= (mod == 3) ? timing_rr : timing_rm; \
|
||||
return 0; \
|
||||
} \
|
||||
\
|
||||
static int op ## name ## _l_rm_a16(uint32_t fetchdat) \
|
||||
{ \
|
||||
int tempc = CF_SET(); \
|
||||
uint32_t dst, src; \
|
||||
fetch_ea_16(fetchdat); \
|
||||
dst = regs[reg].l; \
|
||||
src = geteal(); if (abrt) return 0; \
|
||||
setflags ## 32 flagops; \
|
||||
regs[reg].l = operation; \
|
||||
cycles -= (mod == 3) ? timing_rr : timing_rml; \
|
||||
return 0; \
|
||||
} \
|
||||
static int op ## name ## _l_rm_a32(uint32_t fetchdat) \
|
||||
{ \
|
||||
int tempc = CF_SET(); \
|
||||
uint32_t dst, src; \
|
||||
fetch_ea_32(fetchdat); \
|
||||
dst = regs[reg].l; \
|
||||
src = geteal(); if (abrt) return 0; \
|
||||
setflags ## 32 flagops; \
|
||||
regs[reg].l = operation; \
|
||||
cycles -= (mod == 3) ? timing_rr : timing_rml; \
|
||||
return 0; \
|
||||
} \
|
||||
\
|
||||
static int op ## name ## _AL_imm(uint32_t fetchdat) \
|
||||
{ \
|
||||
int tempc = CF_SET(); \
|
||||
uint8_t dst = AL; \
|
||||
uint8_t src = getbytef(); \
|
||||
setflags ## 8 flagops; \
|
||||
AL = operation; \
|
||||
cycles -= timing_rr; \
|
||||
return 0; \
|
||||
} \
|
||||
\
|
||||
static int op ## name ## _AX_imm(uint32_t fetchdat) \
|
||||
{ \
|
||||
int tempc = CF_SET(); \
|
||||
uint16_t dst = AX; \
|
||||
uint16_t src = getwordf(); \
|
||||
setflags ## 16 flagops; \
|
||||
AX = operation; \
|
||||
cycles -= timing_rr; \
|
||||
return 0; \
|
||||
} \
|
||||
\
|
||||
static int op ## name ## _EAX_imm(uint32_t fetchdat) \
|
||||
{ \
|
||||
int tempc = CF_SET(); \
|
||||
uint32_t dst = EAX; \
|
||||
uint32_t src = getlong(); \
|
||||
setflags ## 32 flagops; \
|
||||
EAX = operation; \
|
||||
cycles -= timing_rr; \
|
||||
return 0; \
|
||||
}
|
||||
|
||||
OP_ARITH(ADD, dst + src, setadd, (dst, src))
|
||||
OP_ARITH(ADC, dst + src + tempc, setadc, (dst, src))
|
||||
OP_ARITH(SUB, dst - src, setsub, (dst, src))
|
||||
OP_ARITH(SBB, dst - (src + tempc), setsbc, (dst, src))
|
||||
OP_ARITH(OR, dst | src, setznp, (dst | src))
|
||||
OP_ARITH(AND, dst & src, setznp, (dst & src))
|
||||
OP_ARITH(XOR, dst ^ src, setznp, (dst ^ src))
|
||||
|
||||
static int opCMP_b_rmw_a16(uint32_t fetchdat)
|
||||
{
|
||||
uint8_t dst;
|
||||
fetch_ea_16(fetchdat);
|
||||
dst = geteab(); if (abrt) return 0;
|
||||
setsub8(dst, getr8(reg));
|
||||
if (is486) cycles -= ((mod == 3) ? 1 : 2);
|
||||
else cycles -= ((mod == 3) ? 2 : 5);
|
||||
return 0;
|
||||
}
|
||||
static int opCMP_b_rmw_a32(uint32_t fetchdat)
|
||||
{
|
||||
uint8_t dst;
|
||||
fetch_ea_32(fetchdat);
|
||||
dst = geteab(); if (abrt) return 0;
|
||||
setsub8(dst, getr8(reg));
|
||||
if (is486) cycles -= ((mod == 3) ? 1 : 2);
|
||||
else cycles -= ((mod == 3) ? 2 : 5);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int opCMP_w_rmw_a16(uint32_t fetchdat)
|
||||
{
|
||||
uint16_t dst;
|
||||
fetch_ea_16(fetchdat);
|
||||
dst = geteaw(); if (abrt) return 0;
|
||||
setsub16(dst, regs[reg].w);
|
||||
if (is486) cycles -= ((mod == 3) ? 1 : 2);
|
||||
else cycles -= ((mod == 3) ? 2 : 5);
|
||||
return 0;
|
||||
}
|
||||
static int opCMP_w_rmw_a32(uint32_t fetchdat)
|
||||
{
|
||||
uint16_t dst;
|
||||
fetch_ea_32(fetchdat);
|
||||
dst = geteaw(); if (abrt) return 0;
|
||||
setsub16(dst, regs[reg].w);
|
||||
if (is486) cycles -= ((mod == 3) ? 1 : 2);
|
||||
else cycles -= ((mod == 3) ? 2 : 5);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int opCMP_l_rmw_a16(uint32_t fetchdat)
|
||||
{
|
||||
uint32_t dst;
|
||||
fetch_ea_16(fetchdat);
|
||||
dst = geteal(); if (abrt) return 0;
|
||||
setsub32(dst, regs[reg].l);
|
||||
if (is486) cycles -= ((mod == 3) ? 1 : 2);
|
||||
else cycles -= ((mod == 3) ? 2 : 5);
|
||||
return 0;
|
||||
}
|
||||
static int opCMP_l_rmw_a32(uint32_t fetchdat)
|
||||
{
|
||||
uint32_t dst;
|
||||
fetch_ea_32(fetchdat);
|
||||
dst = geteal(); if (abrt) return 0;
|
||||
setsub32(dst, regs[reg].l);
|
||||
if (is486) cycles -= ((mod == 3) ? 1 : 2);
|
||||
else cycles -= ((mod == 3) ? 2 : 5);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int opCMP_b_rm_a16(uint32_t fetchdat)
|
||||
{
|
||||
uint8_t src;
|
||||
fetch_ea_16(fetchdat);
|
||||
src = geteab(); if (abrt) return 0;
|
||||
setsub8(getr8(reg), src);
|
||||
cycles -= (mod == 3) ? timing_rr : timing_rm;
|
||||
return 0;
|
||||
}
|
||||
static int opCMP_b_rm_a32(uint32_t fetchdat)
|
||||
{
|
||||
uint8_t src;
|
||||
fetch_ea_32(fetchdat);
|
||||
src = geteab(); if (abrt) return 0;
|
||||
setsub8(getr8(reg), src);
|
||||
cycles -= (mod == 3) ? timing_rr : timing_rm;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int opCMP_w_rm_a16(uint32_t fetchdat)
|
||||
{
|
||||
uint16_t src;
|
||||
fetch_ea_16(fetchdat);
|
||||
src = geteaw(); if (abrt) return 0;
|
||||
setsub16(regs[reg].w, src);
|
||||
cycles -= (mod == 3) ? timing_rr : timing_rm;
|
||||
return 0;
|
||||
}
|
||||
static int opCMP_w_rm_a32(uint32_t fetchdat)
|
||||
{
|
||||
uint16_t src;
|
||||
fetch_ea_32(fetchdat);
|
||||
src = geteaw(); if (abrt) return 0;
|
||||
setsub16(regs[reg].w, src);
|
||||
cycles -= (mod == 3) ? timing_rr : timing_rm;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int opCMP_l_rm_a16(uint32_t fetchdat)
|
||||
{
|
||||
uint32_t src;
|
||||
fetch_ea_16(fetchdat);
|
||||
src = geteal(); if (abrt) return 0;
|
||||
setsub32(regs[reg].l, src);
|
||||
cycles -= (mod == 3) ? timing_rr : timing_rml;
|
||||
return 0;
|
||||
}
|
||||
static int opCMP_l_rm_a32(uint32_t fetchdat)
|
||||
{
|
||||
uint32_t src;
|
||||
fetch_ea_32(fetchdat);
|
||||
src = geteal(); if (abrt) return 0;
|
||||
setsub32(regs[reg].l, src);
|
||||
cycles -= (mod == 3) ? timing_rr : timing_rml;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int opCMP_AL_imm(uint32_t fetchdat)
|
||||
{
|
||||
uint8_t src = getbytef();
|
||||
setsub8(AL, src);
|
||||
cycles -= timing_rr;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int opCMP_AX_imm(uint32_t fetchdat)
|
||||
{
|
||||
uint16_t src = getwordf();
|
||||
setsub16(AX, src);
|
||||
cycles -= timing_rr;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int opCMP_EAX_imm(uint32_t fetchdat)
|
||||
{
|
||||
uint32_t src = getlong();
|
||||
setsub32(EAX, src);
|
||||
cycles -= timing_rr;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int opTEST_b_a16(uint32_t fetchdat)
|
||||
{
|
||||
uint8_t temp, temp2;
|
||||
fetch_ea_16(fetchdat);
|
||||
temp = geteab(); if (abrt) return 0;
|
||||
temp2 = getr8(reg);
|
||||
setznp8(temp & temp2);
|
||||
if (is486) cycles -= ((mod == 3) ? 1 : 2);
|
||||
else cycles -= ((mod == 3) ? 2 : 5);
|
||||
return 0;
|
||||
}
|
||||
static int opTEST_b_a32(uint32_t fetchdat)
|
||||
{
|
||||
uint8_t temp, temp2;
|
||||
fetch_ea_32(fetchdat);
|
||||
temp = geteab(); if (abrt) return 0;
|
||||
temp2 = getr8(reg);
|
||||
setznp8(temp & temp2);
|
||||
if (is486) cycles -= ((mod == 3) ? 1 : 2);
|
||||
else cycles -= ((mod == 3) ? 2 : 5);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int opTEST_w_a16(uint32_t fetchdat)
|
||||
{
|
||||
uint16_t temp, temp2;
|
||||
fetch_ea_16(fetchdat);
|
||||
temp = geteaw(); if (abrt) return 0;
|
||||
temp2 = regs[reg].w;
|
||||
setznp16(temp & temp2);
|
||||
if (is486) cycles -= ((mod == 3) ? 1 : 2);
|
||||
else cycles -= ((mod == 3) ? 2 : 5);
|
||||
return 0;
|
||||
}
|
||||
static int opTEST_w_a32(uint32_t fetchdat)
|
||||
{
|
||||
uint16_t temp, temp2;
|
||||
fetch_ea_32(fetchdat);
|
||||
temp = geteaw(); if (abrt) return 0;
|
||||
temp2 = regs[reg].w;
|
||||
setznp16(temp & temp2);
|
||||
if (is486) cycles -= ((mod == 3) ? 1 : 2);
|
||||
else cycles -= ((mod == 3) ? 2 : 5);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int opTEST_l_a16(uint32_t fetchdat)
|
||||
{
|
||||
uint32_t temp, temp2;
|
||||
fetch_ea_16(fetchdat);
|
||||
temp = geteal(); if (abrt) return 0;
|
||||
temp2 = regs[reg].l;
|
||||
setznp32(temp & temp2);
|
||||
if (is486) cycles -= ((mod == 3) ? 1 : 2);
|
||||
else cycles -= ((mod == 3) ? 2 : 5);
|
||||
return 0;
|
||||
}
|
||||
static int opTEST_l_a32(uint32_t fetchdat)
|
||||
{
|
||||
uint32_t temp, temp2;
|
||||
fetch_ea_32(fetchdat);
|
||||
temp = geteal(); if (abrt) return 0;
|
||||
temp2 = regs[reg].l;
|
||||
setznp32(temp & temp2);
|
||||
if (is486) cycles -= ((mod == 3) ? 1 : 2);
|
||||
else cycles -= ((mod == 3) ? 2 : 5);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int opTEST_AL(uint32_t fetchdat)
|
||||
{
|
||||
uint8_t temp = getbytef();
|
||||
setznp8(AL & temp);
|
||||
cycles -= timing_rr;
|
||||
return 0;
|
||||
}
|
||||
static int opTEST_AX(uint32_t fetchdat)
|
||||
{
|
||||
uint16_t temp = getwordf();
|
||||
setznp16(AX & temp);
|
||||
cycles -= timing_rr;
|
||||
return 0;
|
||||
}
|
||||
static int opTEST_EAX(uint32_t fetchdat)
|
||||
{
|
||||
uint32_t temp = getlong(); if (abrt) return 0;
|
||||
setznp32(EAX & temp);
|
||||
cycles -= timing_rr;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
#define ARITH_MULTI(ea_width, flag_width) \
|
||||
dst = getea ## ea_width(); if (abrt) return 0; \
|
||||
switch (rmdat&0x38) \
|
||||
{ \
|
||||
case 0x00: /*ADD ea, #*/ \
|
||||
setea ## ea_width(dst + src); if (abrt) return 0; \
|
||||
setadd ## flag_width(dst, src); \
|
||||
cycles -= (mod == 3) ? timing_rr : timing_mr; \
|
||||
break; \
|
||||
case 0x08: /*OR ea, #*/ \
|
||||
dst |= src; \
|
||||
setea ## ea_width(dst); if (abrt) return 0; \
|
||||
setznp ## flag_width(dst); \
|
||||
cycles -= (mod == 3) ? timing_rr : timing_mr; \
|
||||
break; \
|
||||
case 0x10: /*ADC ea, #*/ \
|
||||
setea ## ea_width(dst + src + tempc); if (abrt) return 0; \
|
||||
setadc ## flag_width(dst, src); \
|
||||
cycles -= (mod == 3) ? timing_rr : timing_mr; \
|
||||
break; \
|
||||
case 0x18: /*SBB ea, #*/ \
|
||||
setea ## ea_width(dst - (src + tempc)); if (abrt) return 0; \
|
||||
setsbc ## flag_width(dst, src); \
|
||||
cycles -= (mod == 3) ? timing_rr : timing_mr; \
|
||||
break; \
|
||||
case 0x20: /*AND ea, #*/ \
|
||||
dst &= src; \
|
||||
setea ## ea_width(dst); if (abrt) return 0; \
|
||||
setznp ## flag_width(dst); \
|
||||
cycles -= (mod == 3) ? timing_rr : timing_mr; \
|
||||
break; \
|
||||
case 0x28: /*SUB ea, #*/ \
|
||||
setea ## ea_width(dst - src); if (abrt) return 0; \
|
||||
setsub ## flag_width(dst, src); \
|
||||
cycles -= (mod == 3) ? timing_rr : timing_mr; \
|
||||
break; \
|
||||
case 0x30: /*XOR ea, #*/ \
|
||||
dst ^= src; \
|
||||
setea ## ea_width(dst); if (abrt) return 0; \
|
||||
setznp ## flag_width(dst); \
|
||||
cycles -= (mod == 3) ? timing_rr : timing_mr; \
|
||||
break; \
|
||||
case 0x38: /*CMP ea, #*/ \
|
||||
setsub ## flag_width(dst, src); \
|
||||
if (is486) cycles -= ((mod == 3) ? 1 : 2); \
|
||||
else cycles -= ((mod == 3) ? 2 : 7); \
|
||||
break; \
|
||||
}
|
||||
|
||||
|
||||
static int op80_a16(uint32_t fetchdat)
|
||||
{
|
||||
uint8_t src, dst;
|
||||
|
||||
fetch_ea_16(fetchdat);
|
||||
src = getbyte(); if (abrt) return 0;
|
||||
ARITH_MULTI(b, 8);
|
||||
|
||||
return 0;
|
||||
}
|
||||
static int op80_a32(uint32_t fetchdat)
|
||||
{
|
||||
uint8_t src, dst;
|
||||
|
||||
fetch_ea_32(fetchdat);
|
||||
src = getbyte(); if (abrt) return 0;
|
||||
ARITH_MULTI(b, 8);
|
||||
|
||||
return 0;
|
||||
}
|
||||
static int op81_w_a16(uint32_t fetchdat)
|
||||
{
|
||||
uint16_t src, dst;
|
||||
|
||||
fetch_ea_16(fetchdat);
|
||||
src = getword(); if (abrt) return 0;
|
||||
ARITH_MULTI(w, 16);
|
||||
|
||||
return 0;
|
||||
}
|
||||
static int op81_w_a32(uint32_t fetchdat)
|
||||
{
|
||||
uint16_t src, dst;
|
||||
|
||||
fetch_ea_32(fetchdat);
|
||||
src = getword(); if (abrt) return 0;
|
||||
ARITH_MULTI(w, 16);
|
||||
|
||||
return 0;
|
||||
}
|
||||
static int op81_l_a16(uint32_t fetchdat)
|
||||
{
|
||||
uint32_t src, dst;
|
||||
|
||||
fetch_ea_16(fetchdat);
|
||||
src = getlong(); if (abrt) return 0;
|
||||
ARITH_MULTI(l, 32);
|
||||
|
||||
return 0;
|
||||
}
|
||||
static int op81_l_a32(uint32_t fetchdat)
|
||||
{
|
||||
uint32_t src, dst;
|
||||
|
||||
fetch_ea_32(fetchdat);
|
||||
src = getlong(); if (abrt) return 0;
|
||||
ARITH_MULTI(l, 32);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int op83_w_a16(uint32_t fetchdat)
|
||||
{
|
||||
uint16_t src, dst;
|
||||
|
||||
fetch_ea_16(fetchdat);
|
||||
src = getbyte(); if (abrt) return 0;
|
||||
if (src & 0x80) src |= 0xff00;
|
||||
ARITH_MULTI(w, 16);
|
||||
|
||||
return 0;
|
||||
}
|
||||
static int op83_w_a32(uint32_t fetchdat)
|
||||
{
|
||||
uint16_t src, dst;
|
||||
|
||||
fetch_ea_32(fetchdat);
|
||||
src = getbyte(); if (abrt) return 0;
|
||||
if (src & 0x80) src |= 0xff00;
|
||||
ARITH_MULTI(w, 16);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int op83_l_a16(uint32_t fetchdat)
|
||||
{
|
||||
uint32_t src, dst;
|
||||
|
||||
fetch_ea_16(fetchdat);
|
||||
src = getbyte(); if (abrt) return 0;
|
||||
if (src & 0x80) src |= 0xffffff00;
|
||||
ARITH_MULTI(l, 32);
|
||||
|
||||
return 0;
|
||||
}
|
||||
static int op83_l_a32(uint32_t fetchdat)
|
||||
{
|
||||
uint32_t src, dst;
|
||||
|
||||
fetch_ea_32(fetchdat);
|
||||
src = getbyte(); if (abrt) return 0;
|
||||
if (src & 0x80) src |= 0xffffff00;
|
||||
ARITH_MULTI(l, 32);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Loading…
Reference in a new issue