@Override
    public int get_pc() {
        return (I.base[CS] + (I.ip & 0xFFFF));//return (I.base[CS] + (WORD)I.ip);
    }
    /*TODO*///void nec_set_pc(unsigned val)
    /*TODO*///{
    /*TODO*///	if( val - I.base[CS] < 0x10000 )
    /*TODO*///	{
    /*TODO*///		I.ip = val - I.base[CS];
    /*TODO*///	}
    /*TODO*///	else
    /*TODO*///	{
    /*TODO*///		I.base[CS] = val & 0xffff0;
    /*TODO*///		I.sregs[CS] = I.base[CS] >> 4;
    /*TODO*///		I.ip = val & 0x0000f;
    /*TODO*///	}
    /*TODO*///}
    /*TODO*///
    /*TODO*///unsigned nec_get_sp(void)
    /*TODO*///{
    /*TODO*///	return I.base[SS] + I.regs.w[SP];
    /*TODO*///}
    /*TODO*///
    /*TODO*///void nec_set_sp(unsigned val)
    /*TODO*///{
    /*TODO*///	if( val - I.base[SS] < 0x10000 )
    /*TODO*///	{
    /*TODO*///		I.regs.w[SP] = val - I.base[SS];
    /*TODO*///	}
    /*TODO*///	else
    /*TODO*///	{
    /*TODO*///		I.base[SS] = val & 0xffff0;
    /*TODO*///		I.sregs[SS] = I.base[SS] >> 4;
    /*TODO*///		I.regs.w[SP] = val & 0x0000f;
    /*TODO*///	}
    /*TODO*///}
    /*TODO*///
    /*TODO*///unsigned nec_get_reg(int regnum)
    /*TODO*///{
    /*TODO*///	switch( regnum )
    /*TODO*///	{
    /*TODO*///		case NEC_IP: return I.ip;
    /*TODO*///		case NEC_SP: return I.regs.w[SP];
    /*TODO*///		case NEC_FLAGS: CompressFlags(); return I.flags;
    /*TODO*///        case NEC_AW: return I.regs.w[AW];
    /*TODO*///		case NEC_CW: return I.regs.w[CW];
    /*TODO*///		case NEC_DW: return I.regs.w[DW];
    /*TODO*///		case NEC_BW: return I.regs.w[BW];
    /*TODO*///		case NEC_BP: return I.regs.w[BP];
    /*TODO*///		case NEC_IX: return I.regs.w[IX];
    /*TODO*///		case NEC_IY: return I.regs.w[IY];
    /*TODO*///		case NEC_ES: return I.sregs[ES];
    /*TODO*///		case NEC_CS: return I.sregs[CS];
    /*TODO*///		case NEC_SS: return I.sregs[SS];
    /*TODO*///		case NEC_DS: return I.sregs[DS];
    /*TODO*///		case NEC_VECTOR: return I.int_vector;
    /*TODO*///		case NEC_PENDING: return I.pending_irq;
    /*TODO*///		case NEC_NMI_STATE: return I.nmi_state;
    /*TODO*///		case NEC_IRQ_STATE: return I.irq_state;
    /*TODO*///		case REG_PREVIOUSPC: return 0;	/* not supported */
    /*TODO*///		default:
    /*TODO*///			if( regnum <= REG_SP_CONTENTS )
    /*TODO*///			{
    /*TODO*///				unsigned offset = ((I.base[SS] + I.regs.w[SP])) + 2 * (REG_SP_CONTENTS - regnum);
    /*TODO*///				return cpu_readmem20( offset ) | ( cpu_readmem20( offset + 1) << 8 );
    /*TODO*///			}
    /*TODO*///	}
    /*TODO*///	return 0;
    /*TODO*///}
    /*TODO*///
    /*TODO*///void nec_set_nmi_line(int state);
    /*TODO*///void nec_set_irq_line(int irqline, int state);
    /*TODO*///
    /*TODO*///void nec_set_reg(int regnum, unsigned val)
    /*TODO*///{
    /*TODO*///	switch( regnum )
    /*TODO*///	{
    /*TODO*///		case NEC_IP: I.ip = val; break;
    /*TODO*///		case NEC_SP: I.regs.w[SP] = val; break;
    /*TODO*///		case NEC_FLAGS: I.flags = val; ExpandFlags(val); break;
    /*TODO*///        case NEC_AW: I.regs.w[AW] = val; break;
    /*TODO*///		case NEC_CW: I.regs.w[CW] = val; break;
    /*TODO*///		case NEC_DW: I.regs.w[DW] = val; break;
    /*TODO*///		case NEC_BW: I.regs.w[BW] = val; break;
    /*TODO*///		case NEC_BP: I.regs.w[BP] = val; break;
    /*TODO*///		case NEC_IX: I.regs.w[IX] = val; break;
    /*TODO*///		case NEC_IY: I.regs.w[IY] = val; break;
    /*TODO*///		case NEC_ES: I.sregs[ES] = val; break;
    /*TODO*///		case NEC_CS: I.sregs[CS] = val; break;
    /*TODO*///		case NEC_SS: I.sregs[SS] = val; break;
    /*TODO*///		case NEC_DS: I.sregs[DS] = val; break;
    /*TODO*///		case NEC_VECTOR: I.int_vector = val; break;
    /*TODO*///		case NEC_PENDING: I.pending_irq = val; break;
    /*TODO*///		case NEC_NMI_STATE: nec_set_nmi_line(val); break;
    /*TODO*///		case NEC_IRQ_STATE: nec_set_irq_line(0,val); break;
    /*TODO*///		default:
    /*TODO*///			if( regnum <= REG_SP_CONTENTS )
    /*TODO*///			{
    /*TODO*///				unsigned offset = ((I.base[SS] + I.regs.w[SP])) + 2 * (REG_SP_CONTENTS - regnum);
    /*TODO*///				cpu_writemem20( offset, val & 0xff );
    /*TODO*///				cpu_writemem20( offset+1, (val >> 8) & 0xff );
    /*TODO*///			}
    /*TODO*///    }
    /*TODO*///}