Yes but the 2 bytes are stored in consecutive memory positions, so there are 2 read operations.but addrI08() gets a 8 bit address, 2 addrI08() just get the lowest 8bit.
arcachofo wrote:Yes but the 2 bytes are stored in consecutive memory positions, so there are 2 read operations.but addrI08() gets a 8 bit address, 2 addrI08() just get the lowest 8bit.
void I51Core::readOperand()
{
uint8_t addrMode = m_dataEvent.takeFirst();
if( addrMode & aIMME ){
if ( m_cycle == 1 ) m_op0 = m_opAddr = m_pgmData;
else if( m_cycle == 2 ){ /// 16 bit addrs
m_opAddr <<= 8;
m_opAddr |= m_pgmData;
}
}
...
void I51Core::operI08() { m_dataEvent.append( aIMME | aPGM ); } // m_op0 = data
void I51Core::addrI08() { m_dataEvent.append( aIMME ); } // m_opAddr = data;
arcachofo wrote:But maybe we could simplify it.
What about this?
Simpler and faster and we don't need a new enum.
- Code:
void I51Core::readOperand()
{
uint8_t addrMode = m_dataEvent.takeFirst();
if( addrMode & aIMME ){
if ( m_cycle == 1 ) m_op0 = m_opAddr = m_pgmData;
else if( m_cycle == 2 ){ /// 16 bit addrs
m_opAddr <<= 8;
m_opAddr |= m_pgmData;
}
}
...
void I51Core::operI08() { m_dataEvent.append( aIMME | aPGM ); } // m_op0 = data
void I51Core::addrI08() { m_dataEvent.append( aIMME ); } // m_opAddr = data;
Similar topics
Permissions in this forum:
You cannot reply to topics in this forum