{
State.regs[REG_D0 + ((insn & 0xc0000) >> 18)]
= load_mem ((State.regs[REG_A0 + ((insn & 0x30000) >> 16)]
- + ((insn & 0xffff) << 16) | extension), 4);
+ + ((insn & 0xffff) << 16) + extension), 4);
}
/* mov (d8,sp), dn */
{
unsigned long value;
- value = (insn & 0xffff) << 16 | extension;
+ value = ((insn & 0xffff) << 16) + extension;
State.regs[REG_D0 + ((insn & 0x30000) >> 16)] = value;
}
{
unsigned long value;
- value = (insn & 0xffff) << 16 | extension;
+ value = ((insn & 0xffff) << 16) + extension;
State.regs[REG_A0 + ((insn & 0x30000) >> 16)] = value;
}
unsigned long reg1, imm, value;
reg1 = State.regs[REG_D0 + ((insn & 0x30000) >> 16)];
- imm = ((insn & 0xffff) << 16) | extension;
+ imm = ((insn & 0xffff) << 16) + extension;
value = reg1 + imm;
State.regs[REG_D0 + ((insn & 0x30000) >> 16)] = value;
unsigned long reg1, imm, value;
reg1 = State.regs[REG_A0 + ((insn & 0x30000) >> 16)];
- imm = ((insn & 0xffff) << 16) | extension;
+ imm = ((insn & 0xffff) << 16) + extension;
value = reg1 + imm;
State.regs[REG_A0 + ((insn & 0x30000) >> 16)] = value;
void OP_F8FE00 (insn, extension)
unsigned long insn, extension;
{
- int z, c, n, v;
unsigned long reg1, imm, value;
reg1 = State.regs[REG_SP];
void OP_FAFE0000 (insn, extension)
unsigned long insn, extension;
{
- int z, c, n, v;
unsigned long reg1, imm, value;
reg1 = State.regs[REG_SP];
void OP_FCFE0000 (insn, extension)
unsigned long insn, extension;
{
- int z, c, n, v;
unsigned long reg1, imm, value;
reg1 = State.regs[REG_SP];
- imm = ((insn & 0xffff) << 16) | extension;
+ imm = ((insn & 0xffff) << 16) + extension;
value = reg1 + imm;
State.regs[REG_SP] = value;
}
unsigned long reg1, imm, value;
reg1 = State.regs[REG_D0 + ((insn & 0x30000) >> 16)];
- imm = ((insn & 0xffff) << 16) | extension;
+ imm = ((insn & 0xffff) << 16) + extension;
value = reg1 - imm;
z = (value == 0);
unsigned long reg1, imm, value;
reg1 = State.regs[REG_A0 + ((insn & 0x30000) >> 16)];
- imm = ((insn & 0xffff) << 16) | extension;
+ imm = ((insn & 0xffff) << 16) + extension;
value = reg1 - imm;
z = (value == 0);
unsigned long reg1, imm, value;
reg1 = State.regs[REG_D0 + ((insn & 0x30000) >> 16)];
- imm = ((insn & 0xffff) << 16) | extension;
+ imm = ((insn & 0xffff) << 16) + extension;
value = reg1 - imm;
z = (value == 0);
unsigned long reg1, imm, value;
reg1 = State.regs[REG_A0 + ((insn & 0x30000) >> 16)];
- imm = ((insn & 0xffff) << 16) | extension;
+ imm = ((insn & 0xffff) << 16) + extension;
value = reg1 - imm;
z = (value == 0);
int n, z;
State.regs[REG_D0 + ((insn & 0x30000) >> 16)]
- &= ((insn & 0xffff) << 16 | extension);
+ &= ((insn & 0xffff) << 16) + extension;
z = (State.regs[REG_D0 + ((insn & 0x30000) >> 16)] == 0);
n = (State.regs[REG_D0 + ((insn & 0x30000) >> 16)] & 0x80000000) != 0;
PSW &= ~(PSW_Z | PSW_N | PSW_C | PSW_V);
int n, z;
State.regs[REG_D0 + ((insn & 0x30000) >> 16)]
- |= ((insn & 0xffff) << 16 | extension);
+ |= ((insn & 0xffff) << 16) + extension;
z = (State.regs[REG_D0 + ((insn & 0x30000) >> 16)] == 0);
n = (State.regs[REG_D0 + ((insn & 0x30000) >> 16)] & 0x80000000) != 0;
PSW &= ~(PSW_Z | PSW_N | PSW_C | PSW_V);
int n, z;
State.regs[REG_D0 + ((insn & 0x30000) >> 16)]
- ^= ((insn & 0xffff) << 16 | extension);
+ ^= ((insn & 0xffff) << 16) + extension;
z = (State.regs[REG_D0 + ((insn & 0x30000) >> 16)] == 0);
n = (State.regs[REG_D0 + ((insn & 0x30000) >> 16)] & 0x80000000) != 0;
PSW &= ~(PSW_Z | PSW_N | PSW_C | PSW_V);
int z, n;
temp = State.regs[REG_D0 + ((insn & 0x30000) >> 16)];
- temp &= ((insn & 0xffff) << 16 | extension);
+ temp &= ((insn & 0xffff) << 16) + extension;
n = (temp & 0x80000000) != 0;
z = (temp == 0);
PSW &= ~(PSW_Z | PSW_N | PSW_C | PSW_V);
int c,n,z;
value = State.regs[REG_D0 + (insn & 0x3)];
- if (value & 0x1)
- c = 1;
+ c = (value & 0x1);
value >>= 1;
value |= ((PSW & PSW_C) != 0) ? 0x80000000 : 0;
int c,n,z;
value = State.regs[REG_D0 + (insn & 0x3)];
- if (value & 0x80000000)
- c = 1;
+ c = (value & 0x80000000) ? 1 : 0;
value <<= 1;
value |= ((PSW & PSW_C) != 0);
/* The dispatching code will add 2 after we return, so
we subtract two here to make things right. */
if (!((PSW & PSW_Z)
- || (((PSW & PSW_N) != 0) ^ (PSW & PSW_V) != 0)))
+ || (((PSW & PSW_N) != 0) ^ ((PSW & PSW_V) != 0))))
State.pc += SEXT8 (insn & 0xff) - 2;
}
{
/* The dispatching code will add 2 after we return, so
we subtract two here to make things right. */
- if (!(((PSW & PSW_N) != 0) ^ (PSW & PSW_V) != 0))
+ if (!(((PSW & PSW_N) != 0) ^ ((PSW & PSW_V) != 0)))
State.pc += SEXT8 (insn & 0xff) - 2;
}
/* The dispatching code will add 2 after we return, so
we subtract two here to make things right. */
if ((PSW & PSW_Z)
- || (((PSW & PSW_N) != 0) ^ (PSW & PSW_V) != 0))
+ || (((PSW & PSW_N) != 0) ^ ((PSW & PSW_V) != 0)))
State.pc += SEXT8 (insn & 0xff) - 2;
}
{
/* The dispatching code will add 2 after we return, so
we subtract two here to make things right. */
- if (((PSW & PSW_N) != 0) ^ (PSW & PSW_V) != 0)
+ if (((PSW & PSW_N) != 0) ^ ((PSW & PSW_V) != 0))
State.pc += SEXT8 (insn & 0xff) - 2;
}
void OP_DC000000 (insn, extension)
unsigned long insn, extension;
{
- State.pc += (((insn & 0xffffff) << 8) | extension) - 5;
+ State.pc += (((insn & 0xffffff) << 8) + extension) - 5;
}
/* call label:16,reg_list,imm8 */
State.mem[sp+2] = (next_pc & 0xff0000) >> 16;
State.mem[sp+3] = (next_pc & 0xff000000) >> 24;
State.regs[REG_MDR] = next_pc;
- State.pc += (((insn & 0xffff) << 16) | extension) - 6;
+ State.pc += (((insn & 0xffff) << 16) + extension) - 6;
}
/* ret reg_list, imm8 */
unsigned int sp;
unsigned long mask;
- State.regs[REG_SP] += insn & 0xff;
+ sp = State.regs[REG_SP] + (insn & 0xff);
+ State.regs[REG_SP] = sp;
State.pc = (State.mem[sp] | (State.mem[sp+1] << 8)
| (State.mem[sp+2] << 16) | (State.mem[sp+3] << 24));
State.pc -= 3;