summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/cpu/clipper/clipper.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/cpu/clipper/clipper.cpp')
-rw-r--r--src/devices/cpu/clipper/clipper.cpp124
1 files changed, 62 insertions, 62 deletions
diff --git a/src/devices/cpu/clipper/clipper.cpp b/src/devices/cpu/clipper/clipper.cpp
index 3c4741d39dd..e60cad16d71 100644
--- a/src/devices/cpu/clipper/clipper.cpp
+++ b/src/devices/cpu/clipper/clipper.cpp
@@ -140,7 +140,7 @@ void clipper_device::device_start()
void clipper_device::device_reset()
{
- /*
+ /*
* From C300 documentation, on reset:
* psw: T cleared, BIG set from hardware, others undefined
* ssw: EI, TP, M, U, K, KU, UU, P cleared, ID set from hardware, others undefined
@@ -155,7 +155,7 @@ void clipper_device::device_reset()
memset(m_f, 0, sizeof(m_f));
// FIXME: figure out how to branch to the boot code properly
- m_pc = 0x7f100000;
+ m_pc = 0x7f100000;
m_irq = 0;
m_nmi = 0;
}
@@ -165,7 +165,7 @@ void clipper_device::state_string_export(const device_state_entry &entry, std::s
switch (entry.index())
{
case STATE_GENFLAGS:
- str = string_format("%c%c%c%c",
+ str = string_format("%c%c%c%c",
PSW(C) ? 'C' : '.',
PSW(V) ? 'V' : '.',
PSW(Z) ? 'Z' : '.',
@@ -393,7 +393,7 @@ int clipper_device::execute_instruction ()
case 0x00: // noop
break;
- case 0x10:
+ case 0x10:
// movwp: move word to processor register
// treated as a noop if target ssw in user mode
// R1 == 3 means "fast" mode - avoids pipeline flush
@@ -406,7 +406,7 @@ int clipper_device::execute_instruction ()
}
// FLAGS: CVZN
break;
- case 0x11:
+ case 0x11:
// movpw: move processor register to word
switch (R1)
{
@@ -414,24 +414,24 @@ int clipper_device::execute_instruction ()
case 1: m_r[R2] = m_ssw; break;
}
break;
- case 0x12:
+ case 0x12:
// calls: call supervisor
next_pc = intrap(EXCEPTION_SUPERVISOR_CALL_BASE + (m_info.subopcode & 0x7f) * 8, next_pc);
break;
- case 0x13:
+ case 0x13:
// ret: return from subroutine
next_pc = m_data->read_dword(m_r[R2]);
m_r[R2] += 4;
// TRAPS: C,U,A,P,R
break;
- case 0x14:
+ case 0x14:
// pushw: push word
m_r[R1] -= 4;
m_data->write_dword(m_r[R1], m_r[R2]);
// TRAPS: A,P,W
break;
- case 0x16:
+ case 0x16:
// popw: pop word
m_r[R2] = m_data->read_dword(m_r[R1]);
m_r[R1] += 4;
@@ -445,22 +445,22 @@ int clipper_device::execute_instruction ()
break;
case 0x21:
// subs: subtract single floating
- *((float *)&m_f[R2]) -= *((float *)&m_f[R1]);
+ *((float *)&m_f[R2]) -= *((float *)&m_f[R1]);
// TRAPS: F_IVUX
break;
case 0x22:
// addd: add double floating
- m_f[R2] += m_f[R1];
+ m_f[R2] += m_f[R1];
// TRAPS: F_IVUX
break;
case 0x23:
// subd: subtract double floating
- m_f[R2] -= m_f[R1];
+ m_f[R2] -= m_f[R1];
// TRAPS: F_IVUX
break;
case 0x24:
// movs: move single floating
- *((float *)&m_f[R2]) = *((float *)&m_f[R1]);
+ *((float *)&m_f[R2]) = *((float *)&m_f[R1]);
break;
case 0x25:
// cmps: compare single floating
@@ -468,7 +468,7 @@ int clipper_device::execute_instruction ()
break;
case 0x26:
// movd: move double floating
- m_f[R2] = m_f[R1];
+ m_f[R2] = m_f[R1];
break;
case 0x27:
// cmpd: compare double floating
@@ -487,7 +487,7 @@ int clipper_device::execute_instruction ()
break;
case 0x2a:
// muld: multiply double floating
- m_f[R2] *= m_f[R1];
+ m_f[R2] *= m_f[R1];
// TRAPS: F_IVUX
break;
case 0x2b:
@@ -497,21 +497,21 @@ int clipper_device::execute_instruction ()
break;
case 0x2c:
// movsw: move single floating to word
- m_r[R2] = *((s32 *)&m_f[R1]);
+ m_r[R2] = *((s32 *)&m_f[R1]);
break;
case 0x2d:
// movws: move word to single floating
- *((s32 *)&m_f[R2]) = m_r[R1];
+ *((s32 *)&m_f[R2]) = m_r[R1];
break;
case 0x2e:
// movdl: move double floating to longword
- ((double *)m_r)[R2 >> 1] = m_f[R1];
+ ((double *)m_r)[R2 >> 1] = m_f[R1];
break;
case 0x2f:
// movld: move longword to double floating
- m_f[R2] = ((double *)m_r)[R1 >> 1];
+ m_f[R2] = ((double *)m_r)[R1 >> 1];
break;
- case 0x30:
+ case 0x30:
// shaw: shift arithmetic word
if (m_r[R1] > 0)
{
@@ -530,7 +530,7 @@ int clipper_device::execute_instruction ()
}
// FLAGS: 0VZN
break;
- case 0x31:
+ case 0x31:
// shal: shift arithmetic longword
if (m_r[R1] > 0)
{
@@ -549,7 +549,7 @@ int clipper_device::execute_instruction ()
}
// FLAGS: 0VZN
break;
- case 0x32:
+ case 0x32:
// shlw: shift logical word
if (m_r[R1] > 0)
m_r[R2] <<= m_r[R1];
@@ -558,7 +558,7 @@ int clipper_device::execute_instruction ()
// FLAGS: 00ZN
FLAGS(0, 0, m_r[R2] == 0, m_r[R2] < 0);
break;
- case 0x33:
+ case 0x33:
// shll: shift logical longword
if (m_r[R1] > 0)
((u64 *)m_r)[R2 >> 1] <<= m_r[R1];
@@ -567,7 +567,7 @@ int clipper_device::execute_instruction ()
// FLAGS: 00ZN
FLAGS(0, 0, ((s64 *)m_r)[R2 >> 1] == 0, ((s64 *)m_r)[R2 >> 1] < 0);
break;
- case 0x34:
+ case 0x34:
// rotw: rotate word
if (m_r[R1] > 0)
m_r[R2] = rotl32(m_r[R2], m_r[R1]);
@@ -576,7 +576,7 @@ int clipper_device::execute_instruction ()
// FLAGS: 00ZN
FLAGS(0, 0, m_r[R2] == 0, m_r[R2] < 0);
break;
- case 0x35:
+ case 0x35:
// rotl: rotate longword
if (m_r[R1] > 0)
((u64 *)m_r)[R2 >> 1] = rotl64(((u64 *)m_r)[R2 >> 1], m_r[R1]);
@@ -586,7 +586,7 @@ int clipper_device::execute_instruction ()
FLAGS(0, 0, ((s64 *)m_r)[R2 >> 1] == 0, ((s64 *)m_r)[R2 >> 1] < 0);
break;
- case 0x38:
+ case 0x38:
// shai: shift arithmetic immediate
if (m_info.imm > 0)
{
@@ -606,7 +606,7 @@ int clipper_device::execute_instruction ()
// FLAGS: 0VZN
// TRAPS: I
break;
- case 0x39:
+ case 0x39:
// shali: shift arithmetic longword immediate
if (m_info.imm > 0)
{
@@ -626,7 +626,7 @@ int clipper_device::execute_instruction ()
// FLAGS: 0VZN
// TRAPS: I
break;
- case 0x3a:
+ case 0x3a:
// shli: shift logical immediate
if (m_info.imm > 0)
m_r[R2] <<= m_info.imm;
@@ -636,7 +636,7 @@ int clipper_device::execute_instruction ()
// FLAGS: 00ZN
// TRAPS: I
break;
- case 0x3b:
+ case 0x3b:
// shlli: shift logical longword immediate
if (m_info.imm > 0)
((u64 *)m_r)[R2 >> 1] <<= m_info.imm;
@@ -646,7 +646,7 @@ int clipper_device::execute_instruction ()
// FLAGS: 00ZN
// TRAPS: I
break;
- case 0x3c:
+ case 0x3c:
// roti: rotate immediate
if (m_info.imm > 0)
m_r[R2] = rotl32(m_r[R2], m_info.imm);
@@ -656,7 +656,7 @@ int clipper_device::execute_instruction ()
// FLAGS: 00ZN
// TRAPS: I
break;
- case 0x3d:
+ case 0x3d:
// rotli: rotate longword immediate
if (m_info.imm > 0)
((u64 *)m_r)[R2 >> 1] = rotl64(((u64 *)m_r)[R2 >> 1], m_info.imm);
@@ -667,8 +667,8 @@ int clipper_device::execute_instruction ()
// TRAPS: I
break;
- case 0x44:
- case 0x45:
+ case 0x44:
+ case 0x45:
// call: call subroutine
m_r[R2] -= 4;
m_data->write_dword(m_r[R2], next_pc);
@@ -713,8 +713,8 @@ int clipper_device::execute_instruction ()
break;
#endif
- case 0x60:
- case 0x61:
+ case 0x60:
+ case 0x61:
// loadw: load word
m_r[R2] = m_data->read_dword(m_info.address);
// TRAPS: C,U,A,P,R,I
@@ -725,13 +725,13 @@ int clipper_device::execute_instruction ()
m_r[R2] = m_info.address;
// TRAPS: I
break;
- case 0x64:
+ case 0x64:
case 0x65:
// loads: load single floating
((u64 *)&m_f)[R2] = m_data->read_dword(m_info.address);
// TRAPS: C,U,A,P,R,I
break;
- case 0x66:
+ case 0x66:
case 0x67:
// loadd: load double floating
((u64 *)&m_f)[R2] = m_data->read_qword(m_info.address);
@@ -743,13 +743,13 @@ int clipper_device::execute_instruction ()
m_r[R2] = (s8)m_data->read_byte(m_info.address);
// TRAPS: C,U,A,P,R,I
break;
- case 0x6a:
+ case 0x6a:
case 0x6b:
// loadbu: load byte unsigned
m_r[R2] = m_data->read_byte(m_info.address);
// TRAPS: C,U,A,P,R,I
break;
- case 0x6c:
+ case 0x6c:
case 0x6d:
// loadh: load halfword
m_r[R2] = (s16)m_data->read_word(m_info.address);
@@ -761,7 +761,7 @@ int clipper_device::execute_instruction ()
m_r[R2] = m_data->read_word(m_info.address);
// TRAPS: C,U,A,P,R,I
break;
- case 0x70:
+ case 0x70:
case 0x71:
// storw: store word
m_data->write_dword(m_info.address, m_r[R2]);
@@ -800,7 +800,7 @@ int clipper_device::execute_instruction ()
// TRAPS: A,P,W,I
break;
- case 0x80:
+ case 0x80:
// addw: add word
FLAGS_CV(C_ADD(m_r[R2], m_r[R1]), V_ADD(m_r[R2], m_r[R1]))
m_r[R2] += m_r[R1];
@@ -864,7 +864,7 @@ int clipper_device::execute_instruction ()
// FLAGS: 00ZN
break;
- case 0x8f:
+ case 0x8f:
// ori: or immediate
m_r[R2] |= m_info.imm;
FLAGS(0, 0, m_r[R2] == 0, m_r[R2] < 0)
@@ -886,7 +886,7 @@ int clipper_device::execute_instruction ()
// FLAGS: CVZN
break;
- case 0x93:
+ case 0x93:
// negw: negate word
FLAGS_CV(m_r[R1] != 0, m_r[R1] == INT32_MIN)
m_r[R2] = -m_r[R1];
@@ -894,7 +894,7 @@ int clipper_device::execute_instruction ()
// FLAGS: CVZN
break;
- case 0x98:
+ case 0x98:
// mulw: multiply word
m_r[R2] = m_r[R2] * m_r[R1];
// FLAGS: 0V00
@@ -904,7 +904,7 @@ int clipper_device::execute_instruction ()
((s64 *)m_r)[R2 >> 1] = (s64)m_r[R2] * (s64)m_r[R1];
// FLAGS: 0V00
break;
- case 0x9a:
+ case 0x9a:
// mulwu: multiply word unsigned
m_r[R2] = (u32)m_r[R2] * (u32)m_r[R1];
// FLAGS: 0V00
@@ -914,7 +914,7 @@ int clipper_device::execute_instruction ()
((u64 *)m_r)[R2 >> 1] = (u64)m_r[R2] * (u64)m_r[R1];
// FLAGS: 0V00
break;
- case 0x9c:
+ case 0x9c:
// divw: divide word
if (m_r[R1] != 0)
{
@@ -926,7 +926,7 @@ int clipper_device::execute_instruction ()
// FLAGS: 0V00
// TRAPS: D
break;
- case 0x9d:
+ case 0x9d:
// modw: modulus word
if (m_r[R1] != 0)
{
@@ -938,7 +938,7 @@ int clipper_device::execute_instruction ()
// FLAGS: 0V00
// TRAPS: D
break;
- case 0x9e:
+ case 0x9e:
// divwu: divide word unsigned
if ((u32)m_r[R1] != 0)
m_r[R2] = (u32)m_r[R2] / (u32)m_r[R1];
@@ -948,7 +948,7 @@ int clipper_device::execute_instruction ()
// FLAGS: 0000
// TRAPS: D
break;
- case 0x9f:
+ case 0x9f:
// modwu: modulus word unsigned
if ((u32)m_r[R1] != 0)
m_r[R2] = (u32)m_r[R2] % (u32)m_r[R1];
@@ -958,7 +958,7 @@ int clipper_device::execute_instruction ()
// FLAGS: 0000
// TRAPS: D
break;
- case 0xa0:
+ case 0xa0:
// subw: subtract word
FLAGS_CV(C_SUB(m_r[R2], m_r[R1]), V_SUB(m_r[R2], m_r[R1]))
m_r[R2] -= m_r[R1];
@@ -987,39 +987,39 @@ int clipper_device::execute_instruction ()
// FLAGS: CVZN
break;
- case 0xa6:
+ case 0xa6:
// cmpq: compare quick
FLAGS(C_SUB(m_r[R2], R1), V_SUB(m_r[R2], R1), m_r[R2] == (s32)R1, m_r[R2] < (s32)R1)
// FLAGS: CVZN
break;
- case 0xa7:
+ case 0xa7:
// cmpi: compare immediate
FLAGS(C_SUB(m_r[R2], m_info.imm), V_SUB(m_r[R2], m_info.imm), m_r[R2] == m_info.imm, m_r[R2] < m_info.imm)
// FLAGS: CVZN
// TRAPS: I
break;
- case 0xa8:
+ case 0xa8:
// xorw: exclusive or word
m_r[R2] ^= m_r[R1];
FLAGS(0, 0, m_r[R2] == 0, m_r[R2] < 0)
// FLAGS: 00ZN
break;
- case 0xab:
+ case 0xab:
// xori: exclusive or immediate
m_r[R2] ^= m_info.imm;
FLAGS(0, 0, m_r[R2] == 0, m_r[R2] < 0)
// FLAGS: 00ZN
// TRAPS: I
break;
- case 0xac:
+ case 0xac:
// notw: not word
m_r[R2] = ~m_r[R1];
FLAGS(0, 0, m_r[R2] == 0, m_r[R2] < 0)
// FLAGS: 00ZN
break;
- case 0xae:
+ case 0xae:
// notq: not quick
m_r[R2] = ~R1;
FLAGS(0, 0, 0, 1)
@@ -1121,7 +1121,7 @@ int clipper_device::execute_instruction ()
// TRAPS: C,U,A,P,R
break;
- case 0x20: case 0x21: case 0x22: case 0x23:
+ case 0x20: case 0x21: case 0x22: case 0x23:
case 0x24: case 0x25: case 0x26: case 0x27:
// saved0..saved7: push registers fN:f7
@@ -1212,14 +1212,14 @@ int clipper_device::execute_instruction ()
{
switch (m_info.subopcode)
{
- case 0x00:
+ case 0x00:
// movus: move user to supervisor
m_rs[m_info.macro & 0xf] = m_ru[(m_info.macro >> 4) & 0xf];
FLAGS(0, 0, m_rs[m_info.macro & 0xf] == 0, m_rs[m_info.macro & 0xf] < 0)
// FLAGS: 00ZN
// TRAPS: S
break;
- case 0x01:
+ case 0x01:
// movsu: move supervisor to user
m_ru[m_info.macro & 0xf] = m_rs[(m_info.macro >> 4) & 0xf];
FLAGS(0, 0, m_ru[m_info.macro & 0xf] == 0, m_ru[m_info.macro & 0xf] < 0)
@@ -1242,7 +1242,7 @@ int clipper_device::execute_instruction ()
m_rs[(m_info.macro >> 4) & 0xf] += 64;
// TRAPS: C,U,A,P,R,S
break;
- case 0x04:
+ case 0x04:
// reti: restore psw, ssw and pc from supervisor stack
LOG_INTERRUPT("reti r%d, ssp = %08x, pc = %08x, next_pc = %08x\n",
(macro >> 4) & 0xf, m_rs[(m_info.macro >> 4) & 0xf], m_pc, m_program->read_dword(m_rs[(m_info.macro >> 4) & 0xf] + 8));
@@ -1316,10 +1316,10 @@ u32 clipper_device::intrap(u32 vector, u32 pc, u32 cts, u32 mts)
// decrement supervisor stack pointer
// NOTE: while not explicitly stated anywhere, it seems the InterPro boot code has been
- // developed with the assumption that the SSP is decremented by 24 bytes during an exception,
+ // developed with the assumption that the SSP is decremented by 24 bytes during an exception,
// rather than the 12 bytes that might otherwise be expected. This means the exception handler
// code must explicitly increment the SSP by 12 prior to executing the RETI instruction,
- // as otherwise the SSP will not be pointing at a valid return frame. It's possible this
+ // as otherwise the SSP will not be pointing at a valid return frame. It's possible this
// behaviour might vary with some other version of the CPU, but this is all we know for now.
m_rs[15] -= 24;