summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Patrick Mackinlay <pmackinlay@hotmail.com>2021-07-16 15:00:34 +0700
committer Patrick Mackinlay <pmackinlay@hotmail.com>2021-07-16 15:00:34 +0700
commit9e036c84b21219f1333b32aadc18960e628a699e (patch)
treee60d5ac7443f63be6e89045a1f70111fea1530ee
parent8a01776853c8f2f32dd025a9fcd46bcc0d439de4 (diff)
ns32000: fix check instruction undefined behavior
-rw-r--r--src/devices/cpu/ns32000/ns32000.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/devices/cpu/ns32000/ns32000.cpp b/src/devices/cpu/ns32000/ns32000.cpp
index 673c410a356..188a0acc900 100644
--- a/src/devices/cpu/ns32000/ns32000.cpp
+++ b/src/devices/cpu/ns32000/ns32000.cpp
@@ -2820,6 +2820,10 @@ template <int Width> void ns32000_device<Width>::execute_run()
{
m_psr |= PSR_F;
+ // updating the destination when out of bounds
+ // is undefined, but required by DB32016
+ m_r[reg] = src - lower;
+
tex = mode[0].tea + mode[1].tea + top(size, bounds) * 2 + ((src >= lower) ? 7 : 10);
}
}