void execute( const call &, int arg_addr8) { push( program_counter); set_pc( arg_addr8 | ((address_t( ram( sx_ram::STATUS)) & 0x00e0) << 4)); if (stack.size() > sx_stack_size) { throw stack_overflow_exception( stack.back()); } }
address_t MemSegmentManager::locateAddress(uint64_t address) const { memseglist_ci ci = m_mem_segments.begin(), endi = m_mem_segments.end(); for (; ci != endi; ++ci) { MemSegment *m = (*ci); if (m->can_resolve(address)) return m->getBaseAddress() + (address - m->get_start()); } return address_t(); }
Bus::Bus(int id) : Module("Bus", address_t(0), 0) { bid = id; }
address_t operator-(const poffset_t &l, const address_t &r) { return address_t(l - r.m_offset, r.m_size, r.m_memsegment); }
address_t operator-(const address_t &l, const address_t &r) { ASSERT_TRUE(l.m_size == r.m_size); ASSERT_TRUE(l.m_memsegment == r.m_memsegment); return address_t(l.m_offset - r.m_offset, l.m_size, l.m_memsegment); }
address_t operator+(const address_t &l, const poffset_t &r) { return address_t(l.m_offset + r, l.m_size, l.m_memsegment); }
void execute( const jmp &, int addr9_) { set_pc( addr9_ | ((address_t( ram( sx_ram::STATUS)) & 0x00e0) << 4)); set_nop_delay( 2); }