temp = (State.regs[OP[0]] << 23) >> 23;
op0 = temp;
- psw = State.psw;
+ psw = State.sregs[5];
if ((psw & PSW_OV) != 0)
State.pc += op0;
temp = (State.regs[OP[0]] << 23) >> 23;
op0 = temp;
- psw = State.psw;
+ psw = State.sregs[5];
if ((psw & PSW_CY) != 0)
State.pc += op0;
temp = (State.regs[OP[0]] << 23) >> 23;
op0 = temp;
- psw = State.psw;
+ psw = State.sregs[5];
if ((psw & PSW_Z) != 0)
State.pc += op0;
temp = (State.regs[OP[0]] << 23) >> 23;
op0 = temp;
- psw = State.psw;
+ psw = State.sregs[5];
if ((((psw & PSW_CY) != 0) | ((psw & PSW_Z) != 0)) != 0)
State.pc += op0;
temp = (State.regs[OP[0]] << 23) >> 23;
op0 = temp;
- psw = State.psw;
+ psw = State.sregs[5];
if ((psw & PSW_S) != 0)
State.pc += op0;
temp = (State.regs[OP[0]] << 23) >> 23;
op0 = temp;
- psw = State.psw;
+ psw = State.sregs[5];
if ((((psw & PSW_S) != 0) ^ ((psw & PSW_OV) != 0)) != 0)
State.pc += op0;
temp = (State.regs[OP[0]] << 23) >> 23;
op0 = temp;
- psw = State.psw;
+ psw = State.sregs[5];
if ((((psw & PSW_Z) != 0)
|| (((psw & PSW_S) != 0) ^ ((psw & PSW_OV) != 0))) != 0)
temp = (State.regs[OP[0]] << 23) >> 23;
op0 = temp;
- psw = State.psw;
+ psw = State.sregs[5];
if ((psw & PSW_OV) == 0)
State.pc += op0;
temp = (State.regs[OP[0]] << 23) >> 23;
op0 = temp;
- psw = State.psw;
+ psw = State.sregs[5];
if ((psw & PSW_CY) == 0)
State.pc += op0;
temp = (State.regs[OP[0]] << 23) >> 23;
op0 = temp;
- psw = State.psw;
+ psw = State.sregs[5];
if ((psw & PSW_Z) == 0)
State.pc += op0;
temp = (State.regs[OP[0]] << 23) >> 23;
op0 = temp;
- psw = State.psw;
+ psw = State.sregs[5];
if ((((psw & PSW_CY) != 0) | ((psw & PSW_Z) != 0)) == 0)
State.pc += op0;
temp = (State.regs[OP[0]] << 23) >> 23;
op0 = temp;
- psw = State.psw;
+ psw = State.sregs[5];
if ((psw & PSW_S) == 0)
State.pc += op0;
temp = (State.regs[OP[0]] << 23) >> 23;
op0 = temp;
- psw = State.psw;
+ psw = State.sregs[5];
if ((psw & PSW_SAT) != 0)
State.pc += op0;
temp = (State.regs[OP[0]] << 23) >> 23;
op0 = temp;
- psw = State.psw;
+ psw = State.sregs[5];
if ((((psw & PSW_S) != 0) ^ ((psw & PSW_OV) != 0)) == 0)
State.pc += op0;
temp = (State.regs[OP[0]] << 23) >> 23;
op0 = temp;
- psw = State.psw;
+ psw = State.sregs[5];
if ((((psw & PSW_Z) != 0)
|| (((psw & PSW_S) != 0) ^ ((psw & PSW_OV) != 0))) == 0)
/* Store the result and condition codes. */
State.regs[OP[1]] = result;
- State.psw &= ~(PSW_Z | PSW_S | PSW_CY | PSW_OV);
- State.psw |= ((z ? PSW_Z : 0) | (s ? PSW_S : 0)
- | (cy ? PSW_CY : 0) | (ov ? PSW_OV : 0));
+ State.sregs[5] &= ~(PSW_Z | PSW_S | PSW_CY | PSW_OV);
+ State.sregs[5] |= ((z ? PSW_Z : 0) | (s ? PSW_S : 0)
+ | (cy ? PSW_CY : 0) | (ov ? PSW_OV : 0));
}
/* add sign_extend(imm5), reg */
/* Store the result and condition codes. */
State.regs[OP[1]] = result;
- State.psw &= ~(PSW_Z | PSW_S | PSW_CY | PSW_OV);
- State.psw |= ((z ? PSW_Z : 0) | (s ? PSW_S : 0)
+ State.sregs[5] &= ~(PSW_Z | PSW_S | PSW_CY | PSW_OV);
+ State.sregs[5] |= ((z ? PSW_Z : 0) | (s ? PSW_S : 0)
| (cy ? PSW_CY : 0) | (ov ? PSW_OV : 0));
}
/* Store the result and condition codes. */
State.regs[OP[2]] = result;
- State.psw &= ~(PSW_Z | PSW_S | PSW_CY | PSW_OV);
- State.psw |= ((z ? PSW_Z : 0) | (s ? PSW_S : 0)
+ State.sregs[5] &= ~(PSW_Z | PSW_S | PSW_CY | PSW_OV);
+ State.sregs[5] |= ((z ? PSW_Z : 0) | (s ? PSW_S : 0)
| (cy ? PSW_CY : 0) | (ov ? PSW_OV : 0));
}
/* Store the result and condition codes. */
State.regs[OP[1]] = result;
- State.psw &= ~(PSW_Z | PSW_S | PSW_CY | PSW_OV);
- State.psw |= ((z ? PSW_Z : 0) | (s ? PSW_S : 0)
+ State.sregs[5] &= ~(PSW_Z | PSW_S | PSW_CY | PSW_OV);
+ State.sregs[5] |= ((z ? PSW_Z : 0) | (s ? PSW_S : 0)
| (cy ? PSW_CY : 0) | (ov ? PSW_OV : 0));
}
/* Store the result and condition codes. */
State.regs[OP[1]] = result;
- State.psw &= ~(PSW_Z | PSW_S | PSW_CY | PSW_OV);
- State.psw |= ((z ? PSW_Z : 0) | (s ? PSW_S : 0)
+ State.sregs[5] &= ~(PSW_Z | PSW_S | PSW_CY | PSW_OV);
+ State.sregs[5] |= ((z ? PSW_Z : 0) | (s ? PSW_S : 0)
| (cy ? PSW_CY : 0) | (ov ? PSW_OV : 0));
}
/* Store the result and condition codes. */
State.regs[OP[1]] = result;
- State.psw &= ~(PSW_Z | PSW_S | PSW_OV);
- State.psw |= ((z ? PSW_Z : 0) | (s ? PSW_S : 0)
+ State.sregs[5] &= ~(PSW_Z | PSW_S | PSW_OV);
+ State.sregs[5] |= ((z ? PSW_Z : 0) | (s ? PSW_S : 0)
| (ov ? PSW_OV : 0));
}
&& (op1 & 0x80000000) != (result & 0x80000000));
/* Set condition codes. */
- State.psw &= ~(PSW_Z | PSW_S | PSW_CY | PSW_OV);
- State.psw |= ((z ? PSW_Z : 0) | (s ? PSW_S : 0)
+ State.sregs[5] &= ~(PSW_Z | PSW_S | PSW_CY | PSW_OV);
+ State.sregs[5] |= ((z ? PSW_Z : 0) | (s ? PSW_S : 0)
| (cy ? PSW_CY : 0) | (ov ? PSW_OV : 0));
}
&& (op1 & 0x80000000) != (result & 0x80000000));
/* Set condition codes. */
- State.psw &= ~(PSW_Z | PSW_S | PSW_CY | PSW_OV);
- State.psw |= ((z ? PSW_Z : 0) | (s ? PSW_S : 0)
+ State.sregs[5] &= ~(PSW_Z | PSW_S | PSW_CY | PSW_OV);
+ State.sregs[5] |= ((z ? PSW_Z : 0) | (s ? PSW_S : 0)
| (cy ? PSW_CY : 0) | (ov ? PSW_OV : 0));
}
unsigned int op0, psw, result;
op0 = OP[0] & 0xf;
- psw = State.psw;
+ psw = State.sregs[5];
switch (op0)
{
/* Store the result and condition codes. */
State.regs[OP[1]] = result;
- State.psw &= ~(PSW_Z | PSW_S | PSW_CY | PSW_OV);
- State.psw |= ((z ? PSW_Z : 0) | (s ? PSW_S : 0)
+ State.sregs[5] &= ~(PSW_Z | PSW_S | PSW_CY | PSW_OV);
+ State.sregs[5] |= ((z ? PSW_Z : 0) | (s ? PSW_S : 0)
| (cy ? PSW_CY : 0) | (ov ? PSW_OV : 0)
| (sat ? PSW_SAT : 0));
/* Store the result and condition codes. */
State.regs[OP[1]] = result;
- State.psw &= ~(PSW_Z | PSW_S | PSW_CY | PSW_OV);
- State.psw |= ((z ? PSW_Z : 0) | (s ? PSW_S : 0)
+ State.sregs[5] &= ~(PSW_Z | PSW_S | PSW_CY | PSW_OV);
+ State.sregs[5] |= ((z ? PSW_Z : 0) | (s ? PSW_S : 0)
| (cy ? PSW_CY : 0) | (ov ? PSW_OV : 0)
| (sat ? PSW_SAT : 0));
/* Store the result and condition codes. */
State.regs[OP[1]] = result;
- State.psw &= ~(PSW_Z | PSW_S | PSW_CY | PSW_OV);
- State.psw |= ((z ? PSW_Z : 0) | (s ? PSW_S : 0)
+ State.sregs[5] &= ~(PSW_Z | PSW_S | PSW_CY | PSW_OV);
+ State.sregs[5] |= ((z ? PSW_Z : 0) | (s ? PSW_S : 0)
| (cy ? PSW_CY : 0) | (ov ? PSW_OV : 0)
| (sat ? PSW_SAT : 0));
/* Store the result and condition codes. */
State.regs[OP[1]] = result;
- State.psw &= ~(PSW_Z | PSW_S | PSW_CY | PSW_OV);
- State.psw |= ((z ? PSW_Z : 0) | (s ? PSW_S : 0)
+ State.sregs[5] &= ~(PSW_Z | PSW_S | PSW_CY | PSW_OV);
+ State.sregs[5] |= ((z ? PSW_Z : 0) | (s ? PSW_S : 0)
| (cy ? PSW_CY : 0) | (ov ? PSW_OV : 0)
| (sat ? PSW_SAT : 0));
/* Store the result and condition codes. */
State.regs[OP[1]] = result;
- State.psw &= ~(PSW_Z | PSW_S | PSW_CY | PSW_OV);
- State.psw |= ((z ? PSW_Z : 0) | (s ? PSW_S : 0)
+ State.sregs[5] &= ~(PSW_Z | PSW_S | PSW_CY | PSW_OV);
+ State.sregs[5] |= ((z ? PSW_Z : 0) | (s ? PSW_S : 0)
| (cy ? PSW_CY : 0) | (ov ? PSW_OV : 0)
| (sat ? PSW_SAT : 0));
s = (result & 0x80000000);
/* Store the condition codes. */
- State.psw &= ~(PSW_Z | PSW_S | PSW_OV);
- State.psw |= ((z ? PSW_Z : 0) | (s ? PSW_S : 0));
+ State.sregs[5] &= ~(PSW_Z | PSW_S | PSW_OV);
+ State.sregs[5] |= ((z ? PSW_Z : 0) | (s ? PSW_S : 0));
}
void
/* Store the result and condition codes. */
State.regs[OP[1]] = result;
- State.psw &= ~(PSW_Z | PSW_S | PSW_OV | PSW_CY);
- State.psw |= ((z ? PSW_Z : 0) | (s ? PSW_S : 0)
+ State.sregs[5] &= ~(PSW_Z | PSW_S | PSW_OV | PSW_CY);
+ State.sregs[5] |= ((z ? PSW_Z : 0) | (s ? PSW_S : 0)
| (cy ? PSW_CY : 0) | (ov ? PSW_OV : 0));
}
/* Store the result and condition codes. */
State.regs[OP[1]] = result;
- State.psw &= ~(PSW_Z | PSW_S | PSW_OV | PSW_CY);
- State.psw |= ((z ? PSW_Z : 0) | (s ? PSW_S : 0)
+ State.sregs[5] &= ~(PSW_Z | PSW_S | PSW_OV | PSW_CY);
+ State.sregs[5] |= ((z ? PSW_Z : 0) | (s ? PSW_S : 0)
| (cy ? PSW_CY : 0));
}
/* Store the result and condition codes. */
State.regs[OP[1]] = result;
- State.psw &= ~(PSW_Z | PSW_S | PSW_OV | PSW_CY);
- State.psw |= ((z ? PSW_Z : 0) | (s ? PSW_S : 0)
+ State.sregs[5] &= ~(PSW_Z | PSW_S | PSW_OV | PSW_CY);
+ State.sregs[5] |= ((z ? PSW_Z : 0) | (s ? PSW_S : 0)
| (cy ? PSW_CY : 0));
}
/* Store the result and condition codes. */
State.regs[OP[1]] = result;
- State.psw &= ~(PSW_Z | PSW_S | PSW_OV | PSW_CY);
- State.psw |= ((z ? PSW_Z : 0) | (s ? PSW_S : 0)
+ State.sregs[5] &= ~(PSW_Z | PSW_S | PSW_OV | PSW_CY);
+ State.sregs[5] |= ((z ? PSW_Z : 0) | (s ? PSW_S : 0)
| (cy ? PSW_CY : 0));
}
/* Store the result and condition codes. */
State.regs[OP[1]] = result;
- State.psw &= ~(PSW_Z | PSW_S | PSW_OV | PSW_CY);
- State.psw |= ((z ? PSW_Z : 0) | (s ? PSW_S : 0)
+ State.sregs[5] &= ~(PSW_Z | PSW_S | PSW_OV | PSW_CY);
+ State.sregs[5] |= ((z ? PSW_Z : 0) | (s ? PSW_S : 0)
| (cy ? PSW_CY : 0));
}
/* Store the result and condition codes. */
State.regs[OP[1]] = result;
- State.psw &= ~(PSW_Z | PSW_S | PSW_OV | PSW_CY);
- State.psw |= ((z ? PSW_Z : 0) | (s ? PSW_S : 0)
+ State.sregs[5] &= ~(PSW_Z | PSW_S | PSW_OV | PSW_CY);
+ State.sregs[5] |= ((z ? PSW_Z : 0) | (s ? PSW_S : 0)
| (cy ? PSW_CY : 0));
}
/* Store the result and condition codes. */
State.regs[OP[1]] = result;
- State.psw &= ~(PSW_Z | PSW_S | PSW_OV);
- State.psw |= ((z ? PSW_Z : 0) | (s ? PSW_S : 0));
+ State.sregs[5] &= ~(PSW_Z | PSW_S | PSW_OV);
+ State.sregs[5] |= ((z ? PSW_Z : 0) | (s ? PSW_S : 0));
}
/* ori zero_extend(imm16), reg, reg */
/* Store the result and condition codes. */
State.regs[OP[2]] = result;
- State.psw &= ~(PSW_Z | PSW_S | PSW_OV);
- State.psw |= ((z ? PSW_Z : 0) | (s ? PSW_S : 0));
+ State.sregs[5] &= ~(PSW_Z | PSW_S | PSW_OV);
+ State.sregs[5] |= ((z ? PSW_Z : 0) | (s ? PSW_S : 0));
}
/* and reg, reg */
/* Store the result and condition codes. */
State.regs[OP[1]] = result;
- State.psw &= ~(PSW_Z | PSW_S | PSW_OV);
- State.psw |= ((z ? PSW_Z : 0) | (s ? PSW_S : 0));
+ State.sregs[5] &= ~(PSW_Z | PSW_S | PSW_OV);
+ State.sregs[5] |= ((z ? PSW_Z : 0) | (s ? PSW_S : 0));
}
/* andi zero_extend(imm16), reg, reg */
/* Store the result and condition codes. */
State.regs[OP[2]] = result;
- State.psw &= ~(PSW_Z | PSW_S | PSW_OV);
- State.psw |= (z ? PSW_Z : 0);
+ State.sregs[5] &= ~(PSW_Z | PSW_S | PSW_OV);
+ State.sregs[5] |= (z ? PSW_Z : 0);
}
/* xor reg, reg */
/* Store the result and condition codes. */
State.regs[OP[1]] = result;
- State.psw &= ~(PSW_Z | PSW_S | PSW_OV);
- State.psw |= ((z ? PSW_Z : 0) | (s ? PSW_S : 0));
+ State.sregs[5] &= ~(PSW_Z | PSW_S | PSW_OV);
+ State.sregs[5] |= ((z ? PSW_Z : 0) | (s ? PSW_S : 0));
}
/* xori zero_extend(imm16), reg, reg */
/* Store the result and condition codes. */
State.regs[OP[2]] = result;
- State.psw &= ~(PSW_Z | PSW_S | PSW_OV);
- State.psw |= ((z ? PSW_Z : 0) | (s ? PSW_S : 0));
+ State.sregs[5] &= ~(PSW_Z | PSW_S | PSW_OV);
+ State.sregs[5] |= ((z ? PSW_Z : 0) | (s ? PSW_S : 0));
}
/* not reg1, reg2 */
/* Store the result and condition codes. */
State.regs[OP[1]] = result;
- State.psw &= ~(PSW_Z | PSW_S | PSW_OV);
- State.psw |= ((z ? PSW_Z : 0) | (s ? PSW_S : 0));
+ State.sregs[5] &= ~(PSW_Z | PSW_S | PSW_OV);
+ State.sregs[5] |= ((z ? PSW_Z : 0) | (s ? PSW_S : 0));
}
void
void
OP_16007E0 ()
{
- State.psw |= PSW_ID;
+ State.sregs[5] |= PSW_ID;
}
/* ei */
void
OP_16087E0 ()
{
- State.psw &= ~PSW_ID;
+ State.sregs[5] &= ~PSW_ID;
}
/* halt, not supported */
abort ();
}
-/* ldsr, not supported */
+/* ldsr, reg,reg */
void
OP_2007E0 ()
{
- abort ();
+ unsigned int op0;
+
+ op0 = State.regs[OP[0]];
+ State.sregs[OP[1]] = op0;
}
/* stsr, not supported */
void
OP_4007E0 ()
{
- abort ();
+ unsigned int op0;
+
+ op0 = State.sregs[OP[1]];
+ State.regs[OP[0]] = op0;
}
void