+ SEXT16 (insn & 0xffff)), 4);
}
-/* mov */
+/* mov (d32,am), dn */
void OP_FC000000 ()
{
+ State.regs[REG_D0 + ((insn & 0xc0000) >> 18)]
+ = load_mem ((State.regs[REG_A0 + ((insn & 0x30000) >> 16)]
+ + ((insn & 0xffff) << 16) | extension), 4);
}
/* mov (d8,sp), dn */
= load_mem (State.regs[REG_SP] + (insn & 0xffff), 4);
}
-/* mov */
+/* mov (d32,sp), dn */
void OP_FCB40000 ()
{
+ State.regs[REG_D0 + ((insn & 0x30000) >> 16)]
+ = load_mem (State.regs[REG_SP] + (((insn & 0xffff) << 16) + extension), 4);
}
/* mov (di,am), dn */
State.regs[REG_D0 + ((insn & 0x30000) >> 16)] = load_mem ((insn & 0xffff), 4);
}
-/* mov */
+/* mov (abs32), dn */
void OP_FCA40000 ()
{
+ State.regs[REG_D0 + ((insn & 0x30000) >> 16)]
+ = load_mem ((((insn & 0xffff) << 16) + extension), 4);
}
/* mov (am), an */
+ SEXT16 (insn & 0xffff)), 4);
}
-/* mov */
+/* mov (d32,am), an */
void OP_FC200000 ()
{
+ State.regs[REG_A0 + ((insn & 0xc0000) >> 18)]
+ = load_mem ((State.regs[REG_A0 + ((insn & 0x30000) >> 16)]
+ + ((insn & 0xffff) << 16) + extension), 4);
}
/* mov (d8,sp), an */
= load_mem (State.regs[REG_SP] + (insn & 0xffff), 4);
}
-/* mov */
+/* mov (d32,sp), an */
void OP_FCB00000 ()
{
+ State.regs[REG_A0 + ((insn & 0x30000) >> 16)]
+ = load_mem (State.regs[REG_SP] + (((insn & 0xffff) << 16) + extension), 4);
}
-/* mov (di,am), an*/
+/* mov (di,am), an */
void OP_F380 ()
{
State.regs[REG_A0 + ((insn & 0x300) >> 8)]
State.regs[REG_A0 + ((insn & 0x30000) >> 16)] = load_mem ((insn & 0xffff), 4);
}
-/* mov */
+/* mov (abs32), an */
void OP_FCA00000 ()
{
+ State.regs[REG_A0 + ((insn & 0x30000) >> 16)]
+ = load_mem ((((insn & 0xffff) << 16) + extension), 4);
}
/* mov (d8,am), sp */
State.regs[REG_D0 + ((insn & 0xc0000) >> 18)]);
}
-/* mov */
+/* mov dm (d32,an) */
void OP_FC100000 ()
{
+ store_mem ((State.regs[REG_A0 + ((insn & 0x30000) >> 16)]
+ + ((insn & 0xffff) << 16) + extension), 4,
+ State.regs[REG_D0 + ((insn & 0xc0000) >> 18)]);
}
/* mov dm, (d8,sp) */
State.regs[REG_D0 + ((insn & 0xc0000) >> 18)]);
}
-/* mov */
+/* mov dm, (d32,sp) */
void OP_FC910000 ()
{
+ store_mem (State.regs[REG_SP] + (((insn & 0xffff) << 16) + extension), 4,
+ State.regs[REG_D0 + ((insn & 0xc0000) >> 18)]);
}
/* mov dm, (di,an) */
store_mem ((insn & 0xffff), 4, State.regs[REG_D0 + ((insn & 0xc0000) >> 18)]);
}
-/* mov */
+/* mov dm, (abs32) */
void OP_FC810000 ()
{
+ store_mem ((((insn & 0xffff) << 16) + extension), 4, State.regs[REG_D0 + ((insn & 0xc0000) >> 18)]);
}
/* mov am, (an) */
State.regs[REG_A0 + ((insn & 0xc00) >> 10)]);
}
-/* mov am (d16,an) */
+/* mov am, (d16,an) */
void OP_FA300000 ()
{
store_mem ((State.regs[REG_A0 + ((insn & 0x30000) >> 17)]
State.regs[REG_A0 + ((insn & 0xc0000) >> 18)]);
}
-/* mov */
+/* mov am, (d32,an) */
void OP_FC300000 ()
{
+ store_mem ((State.regs[REG_A0 + ((insn & 0x30000) >> 17)]
+ + ((insn & 0xffff) << 16) + extension), 4,
+ State.regs[REG_A0 + ((insn & 0xc0000) >> 18)]);
}
/* mov am, (d8,sp) */
State.regs[REG_A0 + ((insn & 0xc0000) >> 18)]);
}
-/* mov */
+/* mov am, (d32,sp) */
void OP_FC900000 ()
{
+ store_mem (State.regs[REG_SP] + (((insn & 0xffff) << 16) + extension), 4,
+ State.regs[REG_A0 + ((insn & 0xc0000) >> 18)]);
}
/* mov am, (di,an) */
store_mem ((insn & 0xffff), 4, State.regs[REG_A0 + ((insn & 0xc0000) >> 18)]);
}
-/* mov */
+/* mov am, (abs32) */
void OP_FC800000 ()
{
+ store_mem ((((insn & 0xffff) << 16) + extension), 4, State.regs[REG_A0 + ((insn & 0xc0000) >> 18)]);
}
/* mov sp, (d8,an) */
State.regs[REG_A0 + ((insn & 0x30000) >> 16)] = value;
}
-/* mov */
+/* mov imm32,dn */
void OP_FCCC0000 ()
{
+ unsigned long value;
+
+ value = (insn & 0xffff) << 16 | extension;
+ State.regs[REG_D0 + ((insn & 0x30000) >> 16)] = value;
}
/* mov imm16, an */
State.regs[REG_A0 + ((insn & 0x30000) >> 16)] = value;
}
-/* mov imm32, an*/
+/* mov imm32, an */
void OP_FCDC0000 ()
{
unsigned long value;
+ SEXT16 (insn & 0xffff)), 1);
}
-/* movbu */
+/* movbu (d32,am), dn */
void OP_FC400000 ()
{
+ State.regs[REG_D0 + ((insn & 0xc0000) >> 18)]
+ = load_mem ((State.regs[REG_A0 + ((insn & 0x30000) >> 16)]
+ + ((insn & 0xffff) << 16) + extension), 1);
}
/* movbu (d8,sp), dn */
= load_mem ((State.regs[REG_SP] + (insn & 0xffff)), 1);
}
-/* movbu */
+/* movbu (d32,sp), dn */
void OP_FCB80000 ()
{
+ State.regs[REG_D0 + ((insn & 0x30000) >> 16)]
+ = load_mem (State.regs[REG_SP] + (((insn & 0xffff) << 16) + extension), 1);
}
/* movbu (di,am), dn */
State.regs[REG_D0 + ((insn & 0x30000) >> 16)] = load_mem ((insn & 0xffff), 1);
}
-/* movbu */
+/* movbu (abs32), dn */
void OP_FCA80000 ()
{
+ State.regs[REG_D0 + ((insn & 0x30000) >> 16)]
+ = load_mem ((((insn & 0xffff) << 16) + extension), 1);
}
/* movbu dm, (an) */
void OP_FA500000 ()
{
store_mem ((State.regs[REG_A0 + ((insn & 0x30000) >> 16)]
- + SEXT8 (insn & 0xffff)), 1,
+ + SEXT16 (insn & 0xffff)), 1,
State.regs[REG_D0 + ((insn & 0xc0000) >> 18)]);
}
-/* movbu */
+/* movbu dm, (d32,an) */
void OP_FC500000 ()
{
+ store_mem ((State.regs[REG_A0 + ((insn & 0x30000) >> 16)]
+ + ((insn & 0xffff) << 16) + extension), 1,
+ State.regs[REG_D0 + ((insn & 0xc0000) >> 18)]);
}
/* movbu dm, (d8,sp) */
State.regs[REG_D0 + ((insn & 0xc00) >> 10)]);
}
-/* movbu */
+/* movbu dm (d32,sp) */
void OP_FC920000 ()
{
+ store_mem (State.regs[REG_SP] + (((insn & 0xffff) << 16) + extension), 2,
+ State.regs[REG_D0 + ((insn & 0xc00) >> 10)]);
}
/* movbu dm, (di,an) */
store_mem ((insn & 0xffff), 1, State.regs[REG_D0 + ((insn & 0xc0000) >> 18)]);
}
-/* movbu */
+/* movbu dm, (abs32) */
void OP_FC820000 ()
{
+ store_mem ((((insn & 0xffff) << 16) + extension), 1, State.regs[REG_D0 + ((insn & 0xc0000) >> 18)]);
}
/* movhu (am), dn */
+ SEXT16 (insn & 0xffff)), 2);
}
-/* movhu */
+/* movhu (d32,am), dn */
void OP_FC600000 ()
{
+ State.regs[REG_D0 + ((insn & 0xc0000) >> 18)]
+ = load_mem ((State.regs[REG_A0 + ((insn & 0x30000) >> 16)]
+ + ((insn & 0xffff) << 16) + extension), 2);
}
/* movhu (d8,sp) dn */
= load_mem ((State.regs[REG_SP] + (insn & 0xffff)), 2);
}
-/* movhu */
+/* movhu (d32,sp), dn */
void OP_FCBC0000 ()
{
+ State.regs[REG_D0 + ((insn & 0x30000) >> 16)]
+ = load_mem (State.regs[REG_SP] + (((insn & 0xffff) << 16) + extension), 2);
}
/* movhu (di,am), dn */
State.regs[REG_D0 + ((insn & 0x30000) >> 16)] = load_mem ((insn & 0xffff), 2);
}
-/* movhu */
+/* movhu (abs32), dn */
void OP_FCAC0000 ()
{
+ State.regs[REG_D0 + ((insn & 0x30000) >> 16)]
+ = load_mem ((((insn & 0xffff) << 16) + extension), 2);
}
/* movhu dm, (an) */
State.regs[REG_D0 + ((insn & 0xc0000) >> 18)]);
}
-/* movhu */
+/* movhu dm, (d32,an) */
void OP_FC700000 ()
{
+ store_mem ((State.regs[REG_A0 + ((insn & 0x30000) >> 16)]
+ + ((insn & 0xffff) << 16) + extension), 2,
+ State.regs[REG_D0 + ((insn & 0xc0000) >> 18)]);
}
/* movhu dm,(d8,sp) */
State.regs[REG_D0 + ((insn & 0xc0000) >> 18)]);
}
-/* movhu */
+/* movhu dm,(d32,sp) */
void OP_FC930000 ()
{
+ store_mem (State.regs[REG_SP] + (((insn & 0xffff) << 16) + extension), 2,
+ State.regs[REG_D0 + ((insn & 0xc0000) >> 18)]);
}
/* movhu dm, (di,an) */
store_mem ((insn & 0xffff), 2, State.regs[REG_D0 + ((insn & 0xc0000) >> 18)]);
}
-/* movhu */
+/* movhu dm, (abs32) */
void OP_FC830000 ()
{
+ store_mem ((((insn & 0xffff) << 16) + extension), 2, State.regs[REG_D0 + ((insn & 0xc0000) >> 18)]);
}
/* ext dn */
PSW &= ~(PSW_V | PSW_C | PSW_N);
}
-/* add dm,dn*/
+/* add dm,dn */
void OP_E0 ()
{
int z, c, n, v;
| (c ? PSW_C : 0) | (v ? PSW_V : 0));
}
-/* add am, dn*/
+/* add am, dn */
void OP_F150 ()
{
int z, c, n, v;
| (c ? PSW_C : 0) | (v ? PSW_V : 0));
}
-/* add imm8, sp*/
+/* add imm8, sp */
void OP_F8FE00 ()
{
int z, c, n, v;
| (c ? PSW_C : 0) | (v ? PSW_V : 0));
}
-/* add */
+/* add imm32, sp */
void OP_FCFE0000 ()
{
int z, c, n, v;
| (c ? PSW_C : 0) | (v ? PSW_V : 0));
}
-/* addc */
+/* addc dm,dn */
void OP_F140 ()
{
int z, c, n, v;
State.regs[REG_A0 + (insn & 0x3)] = value;
}
-/* sub */
+/* sub imm32, dn */
void OP_FCC40000 ()
{
int z, c, n, v;
State.regs[REG_D0 + ((insn & 0x300) >> 16)] = value;
}
-/* sub */
+/* sub imm32, an */
void OP_FCD40000 ()
{
int z, c, n, v;
State.regs[REG_A0 + ((insn & 0x300) >> 16)] = value;
}
-/* subc */
+/* subc dm, dn */
void OP_F180 ()
{
int z, c, n, v;
State.regs[REG_D0 + (insn & 0x3)] = value;
}
-/* mul */
+/* mul dm, dn */
void OP_F240 ()
{
unsigned long long temp;
PSW |= ((z ? PSW_Z : 0) | (n ? PSW_N : 0));
}
-/* mulu */
+/* mulu dm, dn */
void OP_F250 ()
{
unsigned long long temp;
PSW |= ((z ? PSW_Z : 0) | (n ? PSW_N : 0));
}
-/* div */
+/* div dm, dn */
void OP_F260 ()
{
long long temp;
PSW |= ((z ? PSW_Z : 0) | (n ? PSW_N : 0));
}
-/* divu */
+/* divu dm, dn */
void OP_F270 ()
{
unsigned long long temp;
PSW |= ((z ? PSW_Z : 0) | (n ? PSW_N : 0));
}
-/* and */
+/* and imm32, dn */
void OP_FCE00000 ()
{
+ int n, z;
+
+ State.regs[REG_D0 + ((insn & 0x30000) >> 16)]
+ &= ((insn & 0xffff) << 16 | extension);
+ z = (State.regs[REG_D0 + ((insn & 0x30000) >> 16)] == 0);
+ n = (State.regs[REG_D0 + ((insn & 0x30000) >> 16)] & 0x8000000) != 0;
+ PSW &= ~(PSW_Z | PSW_N | PSW_C | PSW_V);
+ PSW |= ((z ? PSW_Z : 0) | (n ? PSW_N : 0));
}
/* and imm16, psw */
PSW |= ((z ? PSW_Z : 0) | (n ? PSW_N : 0));
}
-/* or */
+/* or imm32, dn */
void OP_FCE40000 ()
{
+ int n, z;
+
+ State.regs[REG_D0 + ((insn & 0x30000) >> 16)]
+ |= ((insn & 0xffff) << 16 | extension);
+ z = (State.regs[REG_D0 + ((insn & 0x30000) >> 16)] == 0);
+ n = (State.regs[REG_D0 + ((insn & 0x30000) >> 16)] & 0x8000000) != 0;
+ PSW &= ~(PSW_Z | PSW_N | PSW_C | PSW_V);
+ PSW |= ((z ? PSW_Z : 0) | (n ? PSW_N : 0));
}
/* or imm16,psw */
PSW |= ((z ? PSW_Z : 0) | (n ? PSW_N : 0));
}
-/* xor */
+/* xor imm32, dn */
void OP_FCE80000 ()
{
+ int n, z;
+
+ State.regs[REG_D0 + ((insn & 0x30000) >> 16)]
+ ^= ((insn & 0xffff) << 16 | extension);
+ z = (State.regs[REG_D0 + ((insn & 0x30000) >> 16)] == 0);
+ n = (State.regs[REG_D0 + ((insn & 0x30000) >> 16)] & 0x8000000) != 0;
+ PSW &= ~(PSW_Z | PSW_N | PSW_C | PSW_V);
+ PSW |= ((z ? PSW_Z : 0) | (n ? PSW_N : 0));
}
-/* not */
+/* not dn */
void OP_F230 ()
{
int n, z;
PSW |= (z ? PSW_Z : 0) | (n ? PSW_N : 0);
}
-/* btst */
+/* btst imm32, dn */
void OP_FCEC0000 ()
{
+ unsigned long temp;
+ int z, n;
+
+ temp = State.regs[REG_D0 + ((insn & 0x30000) >> 16)];
+ temp &= ((insn & 0xffff) << 16 | extension);
+ n = (temp & 0x80000000) != 0;
+ z = (temp == 0);
+ PSW &= ~(PSW_Z | PSW_N | PSW_C | PSW_V);
+ PSW |= (z ? PSW_Z : 0) | (n ? PSW_N : 0);
}
-/* btst */
+/* btst imm8,(abs32) */
void OP_FE020000 ()
{
+ unsigned long temp;
+ int n, z;
+
+ temp = load_mem (((insn & 0xffff) << 16) | (extension >> 8), 1);
+ temp &= (extension & 0xff);
+ n = (temp & 0x80000000) != 0;
+ z = (temp == 0);
+ PSW &= ~(PSW_Z | PSW_N | PSW_C | PSW_V);
+ PSW |= (z ? PSW_Z : 0) | (n ? PSW_N : 0);
}
/* btst imm8,(d8,an) */
PSW |= (z ? PSW_Z : 0);
}
-/* bset */
+/* bset imm8, (abs32) */
void OP_FE000000 ()
{
+ unsigned long temp;
+ int z;
+
+ temp = load_mem (((insn & 0xffff) << 16 | (extension >> 8)), 1);
+ z = (temp & (extension & 0xff)) == 0;
+ temp |= (extension & 0xff);
+ store_mem ((((insn & 0xffff) << 16) | (extension >> 8)), 1, temp);
+ PSW &= ~(PSW_Z | PSW_N | PSW_C | PSW_V);
+ PSW |= (z ? PSW_Z : 0);
}
/* bset imm8,(d8,an) */
PSW |= (z ? PSW_Z : 0);
}
-/* bclr */
+/* bclr imm8, (abs32) */
void OP_FE010000 ()
{
+ unsigned long temp;
+ int z;
+
+ temp = load_mem (((insn & 0xffff) << 16) | (extension >> 8), 1);
+ z = (temp & (extension & 0xff)) == 0;
+ temp = ~temp & (extension & 0xff);
+ store_mem (((insn & 0xffff) << 16) | (extension >> 8), 1, temp);
+ PSW &= ~(PSW_Z | PSW_N | PSW_C | PSW_V);
+ PSW |= (z ? PSW_Z : 0);
}
/* bclr imm8,(d8,an) */
State.pc += (((insn & 0xffff) << 16) | extension) - 6;
}
-/* ret */
+/* ret reg_list, imm8 */
void OP_DF0000 ()
{
unsigned int sp;