summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Patrick Mackinlay <pmackinlay@hotmail.com>2020-10-06 08:55:27 +0700
committer Patrick Mackinlay <pmackinlay@hotmail.com>2020-10-06 08:55:27 +0700
commita538585b9892e41a879f1f324c157df75736d162 (patch)
treee33fe0e2cb54d6c46ba736857d2a9c758fd44251
parent9ac23897b93842e78fd98fb2137c10aa918e4eee (diff)
ns32000: undefined operation assumptions
-rw-r--r--src/devices/cpu/ns32000/ns32000.cpp43
1 files changed, 27 insertions, 16 deletions
diff --git a/src/devices/cpu/ns32000/ns32000.cpp b/src/devices/cpu/ns32000/ns32000.cpp
index d4380aaf293..6a95afc0146 100644
--- a/src/devices/cpu/ns32000/ns32000.cpp
+++ b/src/devices/cpu/ns32000/ns32000.cpp
@@ -1001,7 +1001,7 @@ template <int Width> void ns32000_device<Width>::execute_run()
{
u32 const src = gen_read(mode[0]);
- if (size == 0)
+ if (size == SIZE_B)
m_psr = (m_psr & 0xff00) | u8(src);
else
m_psr = src;
@@ -1057,16 +1057,20 @@ template <int Width> void ns32000_device<Width>::execute_run()
mode[0].read_i(size);
decode(mode, bytes);
- if (size == 0 || !(m_psr & PSR_U))
+ if (size < SIZE_D)
{
- // FIXME: read.D?
- u16 const src = gen_read(mode[0]);
+ if (size == SIZE_B || !(m_psr & PSR_U))
+ {
+ u16 const src = gen_read(mode[0]);
- m_psr &= ~src;
- m_pc += bytes;
+ m_psr &= ~src;
+ m_pc += bytes;
+ }
+ else
+ interrupt(ILL, m_pc);
}
else
- interrupt(ILL, m_pc);
+ interrupt(UND, m_pc);
break;
case 0x4:
// JUMP dst
@@ -1085,17 +1089,20 @@ template <int Width> void ns32000_device<Width>::execute_run()
mode[0].read_i(size);
decode(mode, bytes);
- if (size == 0 || !(m_psr & PSR_U))
+ if (size < SIZE_D)
{
- // FIXME: read.D?
-
- u16 const src = gen_read(mode[0]);
+ if (size == SIZE_B || !(m_psr & PSR_U))
+ {
+ u16 const src = gen_read(mode[0]);
- m_psr |= src;
- m_pc += bytes;
+ m_psr |= src;
+ m_pc += bytes;
+ }
+ else
+ interrupt(ILL, m_pc);
}
else
- interrupt(ILL, m_pc);
+ interrupt(UND, m_pc);
break;
case 0xa:
// ADJSPi src
@@ -2558,7 +2565,9 @@ template <int Width> void ns32000_device<Width>::execute_run()
break;
case 0x3:
// Trap(SLAVE)
- // FIXME: operand access classes?
+ // operands from ns32532 datasheet
+ mode[0].read_f(size_f);
+ mode[1].read_f(size_f);
decode(mode, bytes);
if (!slave(mode[0], mode[1]))
@@ -2607,7 +2616,9 @@ template <int Width> void ns32000_device<Width>::execute_run()
break;
case 0x9:
// Trap(SLAVE)
- // FIXME: operand access classes?
+ // operands from ns32532 datasheet
+ mode[0].read_f(size_f);
+ mode[1].write_f(size_f);
decode(mode, bytes);
if (!slave(mode[0], mode[1]))