summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author fulivi <fulivi@users.noreply.github.com>2016-10-05 18:02:19 +0200
committer fulivi <fulivi@users.noreply.github.com>2016-10-05 18:02:19 +0200
commitd030ab2755f5ef7757d11f1cd41abd19fe2a7bb4 (patch)
treea533b79fa28da9cdb9795f49de0c0ece312f6849
parent76570356629046b6823750a620449c6818543ebf (diff)
hphybrid: fixed indirect EXE instruction
-rw-r--r--src/devices/cpu/hphybrid/hphybrid.cpp24
1 files changed, 16 insertions, 8 deletions
diff --git a/src/devices/cpu/hphybrid/hphybrid.cpp b/src/devices/cpu/hphybrid/hphybrid.cpp
index d61222621c7..f8262fd260e 100644
--- a/src/devices/cpu/hphybrid/hphybrid.cpp
+++ b/src/devices/cpu/hphybrid/hphybrid.cpp
@@ -262,14 +262,22 @@ void hp_hybrid_cpu_device::execute_set_input(int inputnum, int state)
*/
UINT16 hp_hybrid_cpu_device::execute_one(UINT16 opcode)
{
- if ((opcode & 0x7fe0) == 0x7000) {
- // EXE
- m_icount -= 8;
- return RM(opcode & 0x1f);
- } else {
- m_reg_P = execute_one_sub(opcode);
- return fetch();
- }
+ if ((opcode & 0x7fe0) == 0x7000) {
+ // EXE
+ m_icount -= 8;
+ // Indirect addressing in EXE instruction seems to use AEC case A instead of case C
+ // (because it's an opcode fetch)
+ UINT16 reg = RM(opcode & 0x1f);
+ if (BIT(opcode , 15)) {
+ m_icount -= 6;
+ return RM(add_mae(AEC_CASE_A , reg));
+ } else {
+ return reg;
+ }
+ } else {
+ m_reg_P = execute_one_sub(opcode);
+ return fetch();
+ }
}
/**