State.regs[REG_MDR] = State.regs[REG_D0 + ((insn & 0xc) >> 2)];
}
-/* mov */
+/* mov (am), dn */
void OP_70 ()
{
State.regs[REG_D0 + ((insn & 0xc) >> 2)]
= load_mem (State.regs[REG_A0 + (insn & 0x3)], 4);
}
-/* mov */
+/* mov (d8,am), dn */
void OP_F80000 ()
{
+ State.regs[REG_D0 + ((insn & 0xc00) >> 10)]
+ = load_mem ((State.regs[REG_A0 + ((insn & 0x300) >> 8)]
+ + SEXT8 (insn & 0xff)), 4);
}
/* mov */
/* mov (di,am), dn */
void OP_F300 ()
{
- State.regs[REG_D0 + ((insn & 0x30) >> 8)]
+ State.regs[REG_D0 + ((insn & 0x300) >> 8)]
= load_mem ((State.regs[REG_A0 + (insn & 0x3)]
+ State.regs[REG_D0 + ((insn & 0xc) >> 2)]), 4);
}
= load_mem (State.regs[REG_A0 + (insn & 0x3)], 4);
}
-/* mov */
+/* mov (d8,am), an */
void OP_F82000 ()
{
+ State.regs[REG_A0 + ((insn & 0xc00) >> 10)]
+ = load_mem ((State.regs[REG_A0 + ((insn & 0x300) >> 8)]
+ + SEXT8 (insn & 0xff)), 4);
}
/* mov */
/* mov (di,am), an*/
void OP_F380 ()
{
- State.regs[REG_A0 + ((insn & 0x30) >> 8)]
+ State.regs[REG_A0 + ((insn & 0x300) >> 8)]
= load_mem ((State.regs[REG_A0 + (insn & 0x3)]
+ State.regs[REG_D0 + ((insn & 0xc) >> 2)]), 4);
}
{
}
-/* mov */
+/* mov (d8,am), sp */
void OP_F8F000 ()
{
+ State.regs[REG_SP]
+ = load_mem ((State.regs[REG_A0 + ((insn & 0x300) >> 8)]
+ + SEXT8 (insn & 0xff)), 4);
}
/* mov dm, (an) */
State.regs[REG_D0 + ((insn & 0xc) >> 2)]);
}
-/* mov */
+/* mov dm, (d8,an) */
void OP_F81000 ()
{
+ store_mem ((State.regs[REG_A0 + ((insn & 0x300) >> 8)]
+ + SEXT8 (insn & 0xff)), 4,
+ State.regs[REG_D0 + ((insn & 0xc00) >> 10)]);
}
/* mov */
{
store_mem ((State.regs[REG_A0 + (insn & 0x3)]
+ State.regs[REG_D0 + ((insn & 0xc) >> 2)]), 4,
- State.regs[REG_D0 + ((insn & 0x30) >> 8)]);
+ State.regs[REG_D0 + ((insn & 0x300) >> 8)]);
}
/* mov dm, (abs16) */
State.regs[REG_A0 + ((insn & 0xc) >> 2)]);
}
-/* mov */
+/* mov am, (d8,an) */
void OP_F83000 ()
{
+ store_mem ((State.regs[REG_A0 + ((insn & 0x300) >> 8)]
+ + SEXT8 (insn & 0xff)), 4,
+ State.regs[REG_A0 + ((insn & 0xc00) >> 10)]);
}
/* mov */
{
store_mem ((State.regs[REG_A0 + (insn & 0x3)]
+ State.regs[REG_D0 + ((insn & 0xc) >> 2)]), 4,
- State.regs[REG_A0 + ((insn & 0x30) >> 8)]);
+ State.regs[REG_A0 + ((insn & 0x300) >> 8)]);
}
/* mov */
{
}
-/* mov */
+/* mov sp, (d8,an) */
void OP_F8F400 ()
{
+ store_mem (State.regs[REG_A0 + ((insn & 0x300) >> 8)] + SEXT8 (insn & 0xff),
+ 4, State.regs[REG_SP]);
}
/* mov imm16, dn */
= load_mem (State.regs[REG_A0 + (insn & 0x3)], 1);
}
-/* movbu */
+/* movbu (d8,am), dn */
void OP_F84000 ()
{
+ State.regs[REG_D0 + ((insn & 0xc00) >> 10)]
+ = load_mem ((State.regs[REG_A0 + ((insn & 0x300) >> 8)]
+ + SEXT8 (insn & 0xff)), 1);
}
/* movbu */
{
}
-/* movbu */
+/* movbu (d8,sp), dn */
void OP_F8B800 ()
{
+ State.regs[REG_D0 + ((insn & 0x300) >> 8)]
+ = load_mem ((State.regs[REG_SP] + SEXT8 (insn & 0xff)), 1);
}
/* movbu */
/* movbu (di,am), dn */
void OP_F400 ()
{
- State.regs[REG_D0 + ((insn & 0x30) >> 8)]
+ State.regs[REG_D0 + ((insn & 0x300) >> 8)]
= load_mem ((State.regs[REG_A0 + (insn & 0x3)]
+ State.regs[REG_D0 + ((insn & 0xc) >> 2)]), 1);
}
State.regs[REG_D0 + (insn & 0x3)]);
}
-/* movbu */
+/* movbu dm, (d8,an) */
void OP_F85000 ()
{
+ store_mem ((State.regs[REG_A0 + ((insn & 0x300) >> 8)]
+ + SEXT8 (insn & 0xff)), 1,
+ State.regs[REG_D0 + ((insn & 0xc00) >> 10)]);
}
/* movbu */
{
}
-/* movbu */
+/* movbu dm, (d8,sp) */
void OP_F89200 ()
{
+ store_mem ((State.regs[REG_SP] + SEXT8 (insn & 0xff)), 1,
+ State.regs[REG_D0 + ((insn & 0xc00) >> 10)]);
}
/* movbu */
{
store_mem ((State.regs[REG_A0 + (insn & 0x3)]
+ State.regs[REG_D0 + ((insn & 0xc) >> 2)]), 1,
- State.regs[REG_D0 + ((insn & 0x30) >> 8)]);
+ State.regs[REG_D0 + ((insn & 0x300) >> 8)]);
}
/* movbu dm, (abs16) */
= load_mem (State.regs[REG_A0 + (insn & 0x3)], 2);
}
-/* movhu */
+/* movhu (d8,am), dn */
void OP_F86000 ()
{
+ State.regs[REG_D0 + ((insn & 0xc00) >> 10)]
+ = load_mem ((State.regs[REG_A0 + ((insn & 0x300) >> 8)]
+ + SEXT8 (insn & 0xff)), 2);
}
/* movhu */
{
}
-/* movhu */
+/* movhu (d8,sp) dn */
void OP_F8BC00 ()
{
+ State.regs[REG_D0 + ((insn & 0x300) >> 8)]
+ = load_mem ((State.regs[REG_SP] + SEXT8 (insn & 0xff)), 2);
}
/* movhu */
/* movhu (di,am), dn */
void OP_F480 ()
{
- State.regs[REG_D0 + ((insn & 0x30) >> 8)]
+ State.regs[REG_D0 + ((insn & 0x300) >> 8)]
= load_mem ((State.regs[REG_A0 + (insn & 0x3)]
+ State.regs[REG_D0 + ((insn & 0xc) >> 2)]), 2);
}
State.regs[REG_D0 + (insn & 0x3)]);
}
-/* movhu */
+/* movhu dm, (d8,an) */
void OP_F87000 ()
{
+ store_mem ((State.regs[REG_A0 + ((insn & 0x300) >> 8)]
+ + SEXT8 (insn & 0xff)), 2,
+ State.regs[REG_D0 + ((insn & 0xc00) >> 10)]);
}
/* movhu */
{
}
-/* movhu */
+/* movhu dm,(d8,sp) */
void OP_F89300 ()
{
+ store_mem ((State.regs[REG_SP] + SEXT8 (insn & 0xff)), 2,
+ State.regs[REG_D0 + ((insn & 0xc00) >> 10)]);
}
/* movhu */
{
store_mem ((State.regs[REG_A0 + (insn & 0x3)]
+ State.regs[REG_D0 + ((insn & 0xc) >> 2)]), 2,
- State.regs[REG_D0 + ((insn & 0x30) >> 8)]);
+ State.regs[REG_D0 + ((insn & 0x300) >> 8)]);
}
/* movhu dm, (abs16) */
PSW |= ((z ? PSW_Z : 0) | (n ? PSW_N : 0));
}
-/* and */
+/* and imm8, dn */
void OP_F8E000 ()
{
+ int n, z;
+
+ State.regs[REG_D0 + ((insn & 0x300) >> 8)] &= (insn & 0xff);
+ z = (State.regs[REG_D0 + ((insn & 0x300) >> 8)] == 0);
+ n = (State.regs[REG_D0 + ((insn & 0x300) >> 8)] & 0x8000000) != 0;
+ PSW &= ~(PSW_Z | PSW_N | PSW_C | PSW_V);
+ PSW |= ((z ? PSW_Z : 0) | (n ? PSW_N : 0));
}
/* and */
PSW |= ((z ? PSW_Z : 0) | (n ? PSW_N : 0));
}
-/* or */
+/* or imm8, dn */
void OP_F8E400 ()
{
+ int n, z;
+
+ State.regs[REG_D0 + ((insn & 0x300) >> 8)] |= insn & 0xff;
+ z = (State.regs[REG_D0 + ((insn & 0x300) >> 8)] == 0);
+ n = (State.regs[REG_D0 + ((insn & 0x300) >> 8)] & 0x8000000) != 0;
+ PSW &= ~(PSW_Z | PSW_N | PSW_C | PSW_V);
+ PSW |= ((z ? PSW_Z : 0) | (n ? PSW_N : 0));
}
/* or */
PSW |= ((z ? PSW_Z : 0) | (n ? PSW_N : 0));
}
-/* btst */
+/* btst imm8, dn */
void OP_F8EC00 ()
{
+ unsigned long temp;
+ int z, n;
+
+ temp = State.regs[REG_D0 + ((insn & 0x300) >> 8)];
+ temp &= (insn & 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 */
{
}
-/* asr */
+/* asr dm, dn */
void OP_F2B0 ()
{
long temp;
PSW |= ((z ? PSW_Z : 0) | (n ? PSW_N : 0) | (c ? PSW_C : 0));
}
-/* asr */
+/* asr imm8, dn */
void OP_F8C800 ()
{
+ long temp;
+ int z, n, c;
+
+ temp = State.regs[REG_D0 + ((insn & 0x300) >> 8)];
+ c = temp & 1;
+ temp >>= (insn & 0xff);
+ State.regs[REG_D0 + ((insn & 0x300) >> 8)] = temp;
+ z = (State.regs[REG_D0 + ((insn & 0x300) >> 8)] == 0);
+ n = (State.regs[REG_D0 + ((insn & 0x300) >> 8)] & 0x8000000) != 0;
+ PSW &= ~(PSW_Z | PSW_N | PSW_C);
+ PSW |= ((z ? PSW_Z : 0) | (n ? PSW_N : 0) | (c ? PSW_C : 0));
}
-/* lsr */
+/* lsr dm, dn */
void OP_F2A0 ()
{
int z, n, c;
PSW |= ((z ? PSW_Z : 0) | (n ? PSW_N : 0) | (c ? PSW_C : 0));
}
-/* lsr */
+/* lsr dm, dn */
void OP_F8C400 ()
{
+ int z, n, c;
+
+ c = State.regs[REG_D0 + ((insn & 0x300) >> 8)] & 1;
+ State.regs[REG_D0 + ((insn & 0x300) >> 8)] >>= (insn & 0xff);
+ z = (State.regs[REG_D0 + ((insn & 0x3) >> 8)] == 0);
+ n = (State.regs[REG_D0 + ((insn & 0x3) >> 8)] & 0x8000000) != 0;
+ PSW &= ~(PSW_Z | PSW_N | PSW_C);
+ PSW |= ((z ? PSW_Z : 0) | (n ? PSW_N : 0) | (c ? PSW_C : 0));
}
-/* asl */
+/* asl dm, dn */
void OP_F290 ()
{
int n, z;
PSW |= ((z ? PSW_Z : 0) | (n ? PSW_N : 0));
}
-/* asl */
+/* asl imm8, dn */
void OP_F8C000 ()
{
+ int n, z;
+
+ State.regs[REG_D0 + ((insn & 0x300) >> 8)] <<= (insn & 0xff);
+ z = (State.regs[REG_D0 + ((insn & 0x300) >> 8)] == 0);
+ n = (State.regs[REG_D0 + ((insn & 0x300) >> 8)] & 0x8000000) != 0;
+ PSW &= ~(PSW_Z | PSW_N);
+ PSW |= ((z ? PSW_Z : 0) | (n ? PSW_N : 0));
}
/* asl2 dn */