Initial submission of the PCem-Experimental source code.

This commit is contained in:
OBattler
2016-06-26 00:34:39 +02:00
parent 09d7c4384f
commit fd2a5bc9f5
610 changed files with 184352 additions and 0 deletions

167
src/x86_ops_movx.h Normal file
View File

@@ -0,0 +1,167 @@
static int opMOVZX_w_b_a16(uint32_t fetchdat)
{
uint8_t temp;
fetch_ea_16(fetchdat);
temp = geteab(); if (abrt) return 1;
cpu_state.regs[reg].w = (uint16_t)temp;
CLOCK_CYCLES(3);
return 0;
}
static int opMOVZX_w_b_a32(uint32_t fetchdat)
{
uint8_t temp;
fetch_ea_32(fetchdat);
temp = geteab(); if (abrt) return 1;
cpu_state.regs[reg].w = (uint16_t)temp;
CLOCK_CYCLES(3);
return 0;
}
static int opMOVZX_l_b_a16(uint32_t fetchdat)
{
uint8_t temp;
fetch_ea_16(fetchdat);
temp = geteab(); if (abrt) return 1;
cpu_state.regs[reg].l = (uint32_t)temp;
CLOCK_CYCLES(3);
return 0;
}
static int opMOVZX_l_b_a32(uint32_t fetchdat)
{
uint8_t temp;
fetch_ea_32(fetchdat);
temp = geteab(); if (abrt) return 1;
cpu_state.regs[reg].l = (uint32_t)temp;
CLOCK_CYCLES(3);
return 0;
}
static int opMOVZX_w_w_a16(uint32_t fetchdat)
{
uint16_t temp;
fetch_ea_16(fetchdat);
temp = geteaw(); if (abrt) return 1;
cpu_state.regs[reg].w = temp;
CLOCK_CYCLES(3);
return 0;
}
static int opMOVZX_w_w_a32(uint32_t fetchdat)
{
uint16_t temp;
fetch_ea_32(fetchdat);
temp = geteaw(); if (abrt) return 1;
cpu_state.regs[reg].w = temp;
CLOCK_CYCLES(3);
return 0;
}
static int opMOVZX_l_w_a16(uint32_t fetchdat)
{
uint16_t temp;
fetch_ea_16(fetchdat);
temp = geteaw(); if (abrt) return 1;
cpu_state.regs[reg].l = (uint32_t)temp;
CLOCK_CYCLES(3);
return 0;
}
static int opMOVZX_l_w_a32(uint32_t fetchdat)
{
uint16_t temp;
fetch_ea_32(fetchdat);
temp = geteaw(); if (abrt) return 1;
cpu_state.regs[reg].l = (uint32_t)temp;
CLOCK_CYCLES(3);
return 0;
}
static int opMOVSX_w_b_a16(uint32_t fetchdat)
{
uint8_t temp;
fetch_ea_16(fetchdat);
temp = geteab(); if (abrt) return 1;
cpu_state.regs[reg].w = (uint16_t)temp;
if (temp & 0x80)
cpu_state.regs[reg].w |= 0xff00;
CLOCK_CYCLES(3);
return 0;
}
static int opMOVSX_w_b_a32(uint32_t fetchdat)
{
uint8_t temp;
fetch_ea_32(fetchdat);
temp = geteab(); if (abrt) return 1;
cpu_state.regs[reg].w = (uint16_t)temp;
if (temp & 0x80)
cpu_state.regs[reg].w |= 0xff00;
CLOCK_CYCLES(3);
return 0;
}
static int opMOVSX_l_b_a16(uint32_t fetchdat)
{
uint8_t temp;
fetch_ea_16(fetchdat);
temp = geteab(); if (abrt) return 1;
cpu_state.regs[reg].l = (uint32_t)temp;
if (temp & 0x80)
cpu_state.regs[reg].l |= 0xffffff00;
CLOCK_CYCLES(3);
return 0;
}
static int opMOVSX_l_b_a32(uint32_t fetchdat)
{
uint8_t temp;
fetch_ea_32(fetchdat);
temp = geteab(); if (abrt) return 1;
cpu_state.regs[reg].l = (uint32_t)temp;
if (temp & 0x80)
cpu_state.regs[reg].l |= 0xffffff00;
CLOCK_CYCLES(3);
return 0;
}
static int opMOVSX_l_w_a16(uint32_t fetchdat)
{
uint16_t temp;
fetch_ea_16(fetchdat);
temp = geteaw(); if (abrt) return 1;
cpu_state.regs[reg].l = (uint32_t)temp;
if (temp & 0x8000)
cpu_state.regs[reg].l |= 0xffff0000;
CLOCK_CYCLES(3);
return 0;
}
static int opMOVSX_l_w_a32(uint32_t fetchdat)
{
uint16_t temp;
fetch_ea_32(fetchdat);
temp = geteaw(); if (abrt) return 1;
cpu_state.regs[reg].l = (uint32_t)temp;
if (temp & 0x8000)
cpu_state.regs[reg].l |= 0xffff0000;
CLOCK_CYCLES(3);
return 0;
}