summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/cpu/hmcs40/hmcs40op.inc
diff options
context:
space:
mode:
Diffstat (limited to 'src/emu/cpu/hmcs40/hmcs40op.inc')
-rw-r--r--src/emu/cpu/hmcs40/hmcs40op.inc22
1 files changed, 17 insertions, 5 deletions
diff --git a/src/emu/cpu/hmcs40/hmcs40op.inc b/src/emu/cpu/hmcs40/hmcs40op.inc
index 3c748f1b4a1..19bdaecb7a5 100644
--- a/src/emu/cpu/hmcs40/hmcs40op.inc
+++ b/src/emu/cpu/hmcs40/hmcs40op.inc
@@ -431,31 +431,43 @@ void hmcs40_cpu_device::op_tm()
void hmcs40_cpu_device::op_br()
{
// BR a: Branch on Status 1
- op_illegal();
+ if (m_s)
+ m_pc = (m_pc & ~0x3f) | (m_op & 0x3f);
+ else
+ m_s = 1;
}
void hmcs40_cpu_device::op_cal()
{
// CAL a: Subroutine Jump on Status 1
- op_illegal();
+ if (m_s)
+ {
+ push_stack();
+ m_pc = m_op & 0x3f; // short calls default to page 0
+ }
+ else
+ m_s = 1;
}
void hmcs40_cpu_device::op_lpu()
{
// LPU u: Load Program Counter Upper on Status 1
- op_illegal();
+ if (m_s)
+ m_page = m_op & 0x1f;
+ else
+ m_op = 0;
}
void hmcs40_cpu_device::op_tbr()
{
// TBR p: Table Branch
- op_illegal();
+ m_pc = (m_a | m_b << 4 | m_c << 8 | ((m_op & 7) << 9)) & m_prgmask;
}
void hmcs40_cpu_device::op_rtn()
{
// RTN: Return from Subroutine
- op_illegal();
+ pop_stack();
}