void hmcs40_cpu_device::op_am() { // AM: Add A to Memory m_a += ram_r(); m_s = m_a >> 4 & 1; m_a &= 0xf; }
void hmcs40_cpu_device::op_amc() { // AMC: Add A to Memory with Carry m_a += ram_r() + m_c; m_c = m_a >> 4 & 1; m_s = m_c; m_a &= 0xf; }
void hmcs40_cpu_device::op_smc() { // SMC: Subtract A from Memory with Carry m_a = ram_r() - m_a - (m_c ^ 1); m_c = ~m_a >> 4 & 1; m_s = m_c; m_a &= 0xf; }
void hmcs40_cpu_device::op_xmb() { // XMB (XY): Exchange Memory and B UINT8 old_b = m_b; m_b = ram_r(); ram_w(old_b); op_xsp(); }
void hmcs40_cpu_device::op_xma() { // XMA (XY): Exchange Memory and A UINT8 old_a = m_a; m_a = ram_r(); ram_w(old_a); op_xsp(); }
void ucom4_cpu_device::op_lm() { // LM X: Load ACC with RAM, xor DPh with X m_acc = ram_r(); m_dph ^= (m_op & 0x03); }
void hmcs40_cpu_device::op_rem() { // REM n: Reset Memory Bit ram_w(ram_r() & ~(1 << (m_op & 3))); }
void hmcs40_cpu_device::op_sem() { // SEM n: Set Memory Bit ram_w(ram_r() | (1 << (m_op & 3))); }
void hmcs40_cpu_device::op_blem() { // BLEM: B Less or Equal to Memory m_s = (m_b <= ram_r()); }
void hmcs40_cpu_device::op_alem() { // ALEM: A Less or Equal to Memory m_s = (m_a <= ram_r()); }
void hmcs40_cpu_device::op_bnem() { // BNEM: B Not Equal to Memory m_s = (m_b != ram_r()); }
void hmcs40_cpu_device::op_anem() { // ANEM: A Not Equal to Memory m_s = (m_a != ram_r()); }
void hmcs40_cpu_device::op_mnei() { // MNEI i: Memory Not Equal to Immediate m_s = (ram_r() != (m_i)); }
void hmcs40_cpu_device::op_lbm() { // LBM (XY): Load B from Memory m_b = ram_r(); op_xsp(); }
void hmcs40_cpu_device::op_lam() { // LAM (XY): Load A from Memory m_a = ram_r(); op_xsp(); }
void hmcs40_cpu_device::op_sem() { // SEM n: Set Memory Bit ram_w(ram_r() | (1 << (m_op & 3))); } void hmcs40_cpu_device::op_rem() { // REM n: Reset Memory Bit ram_w(ram_r() & ~(1 << (m_op & 3))); } void hmcs40_cpu_device::op_tm() { // TM n: Test Memory Bit m_s = ram_r() >> (m_op & 3) & 1; } // ROM Address Instruction void hmcs40_cpu_device::op_br() { // BR a: Branch on Status 1 if (m_s) m_pc = (m_pc & ~0x3f) | (m_op & 0x3f); else m_s = 1; } void hmcs40_cpu_device::op_cal()