don't clear stack on pop

This commit is contained in:
hap 2015-02-12 21:33:56 +01:00
parent ac999d097b
commit c120b3df50
4 changed files with 4 additions and 10 deletions

View File

@ -77,7 +77,7 @@ protected:
UINT8 m_callstack_bits; // number of program counter bits held in callstack
UINT16 m_callstack_mask;
UINT8 m_callstack_depth; // callstack levels: 3 on 2000/2150, 5 on 2200/2400
UINT16 m_callstack[5+1]; // max 5
UINT16 m_callstack[5]; // max 5
int m_icount;
UINT16 m_pc; // 13-bit program counter
UINT8 m_ppr; // prepared page register (PP 1)

View File

@ -17,11 +17,8 @@ inline void amis2000_device::ram_w(UINT8 data)
void amis2000_device::pop_callstack()
{
m_pc = (m_pc & ~m_callstack_mask) | (m_callstack[0] & m_callstack_mask);
for (int i = 0; i < m_callstack_depth; i++)
{
for (int i = 0; i < m_callstack_depth-1; i++)
m_callstack[i] = m_callstack[i+1];
m_callstack[i+1] = 0;
}
}
void amis2000_device::push_callstack()

View File

@ -133,7 +133,7 @@ protected:
int m_datamask;
int m_family; // MCU family (43/44/45)
int m_stack_levels; // number of callstack levels
UINT16 m_stack[3+1]; // max 3
UINT16 m_stack[3]; // max 3
UINT8 m_port_out[0x10]; // last value written to output port
UINT8 m_op;
UINT8 m_prev_op; // previous opcode

View File

@ -17,11 +17,8 @@ inline void ucom4_cpu_device::ram_w(UINT8 data)
void ucom4_cpu_device::pop_stack()
{
m_pc = m_stack[0] & m_prgmask;
for (int i = 0; i < m_stack_levels; i++)
{
for (int i = 0; i < m_stack_levels-1; i++)
m_stack[i] = m_stack[i+1];
m_stack[i+1] = 0;
}
}
void ucom4_cpu_device::push_stack()