示例#1
0
static void djnz_a( void )
{
	UINT16 t;

	t = RDA - 1;

	WRA( t );

	CLR_NZC;
	SET_N8(t);
	SET_Z8(t);

	if( t != 0 )
	{
		INT8	s;

		SIMMBYTE(s);
		pPC += s;
		tms7000_icount -= 7;
	}
	else
	{
		pPC++;
		tms7000_icount -= 2;
	}
	CHANGE_PC;
}
示例#2
0
static void rr_a( void )
{
	UINT16	t;
	int		old_bit0;

	t = RDA;

	old_bit0 = t & 0x0001;
	t = t >> 1;

	CLR_NZC;

	if( old_bit0 )
	{
		SETC;
		t |= 0x80;
	}

	SET_N8(t);
	SET_Z8(t);

	WRA(t);

	tms7000_icount -= 5;
}
示例#3
0
void do_lds(jit_function_t func) {
	jit_value_t ldw = LOAD(LDWhich, jit_type_uint);
	jit_label_t label = jit_label_undefined;
	jit_insn_branch_if(func, jit_insn_eq(func, ldw, make_ubyte(35)), &label);
	jit_value_t raw = LOAD(_ReadAbsorbWhich, jit_type_ubyte);
	WGPR_VAL(ldw, LOAD(LDValue, jit_type_uint));
	WRA(ldw, CAST(LOAD(LDAbsorb, jit_type_uint), jit_type_ubyte));
	STORE(_ReadFudge, CAST(ldw, jit_type_ubyte));
	STORE(_ReadAbsorbWhich, CAST(jit_insn_or(func, raw, jit_insn_and(func, ldw, make_uint(0x1F))), jit_type_ubyte));
	jit_insn_label(func, &label);
	STORE(LDWhich, make_uint(35));
}
示例#4
0
static void pop_a( void )
{
	UINT16	t;

	PULLBYTE(t);
	WRA(t);

	CLR_NZC;
	SET_N8(t);
	SET_Z8(t);

	tms7000_icount -= 6;
}
示例#5
0
static void mov_i2a( void )
{
	UINT16	t;

	IMMBYTE(t);
	WRA(t);

	CLR_NZC;
	SET_N8(t);
	SET_Z8(t);

	tms7000_icount -= 7;
}
示例#6
0
static void mov_b2a( void )
{
	UINT16	t;

	t = RDB;
	WRA(t);

	CLR_NZC;
	SET_N8(t);
	SET_Z8(t);

	tms7000_icount -= 5;
}
示例#7
0
static void inv_b( void )
{
	UINT16 t;

	t = ~(RDA);
	WRA(t);

	CLR_NZC;
	SET_N8(t);
	SET_Z8(t);

	tms7000_icount -= 5;
}
示例#8
0
static void xor_b2a( void )
{
	UINT8	t;

	t = RDA ^ RDB;
	WRA(t);

	CLR_NZC;
	SET_N8(t);
	SET_Z8(t);

	tms7000_icount -= 5;
}
示例#9
0
static void adc_b2a( void )
{
	UINT16	t;

	t = RDA + RDB + GET_C;
	WRA(t);

	CLR_NZC;
	SET_C8(t);
	SET_N8(t);
	SET_Z8(t);

	tms7000_icount -= 5;
}
示例#10
0
static void sbb_ba( void )
{
	UINT16	t;

	t = RDA - RDB - ((pSR & SR_C) ? 0 : 1);
	WRA(t);

	CLR_NZC;
	SET_C8(~t);
	SET_N8(t);
	SET_Z8(t);

	tms7000_icount -= 5;
}
示例#11
0
static void sub_ba( void )
{
	UINT16	t;

	t = RDA - RDB;
	WRA(t);

	CLR_NZC;
	SET_C8(~t);
	SET_N8(t);
	SET_Z8(t);

	tms7000_icount -= 5;
}
示例#12
0
static void movp_p2a( void )
{
	UINT8	p;
	UINT16	t;

	IMMBYTE(p);
	t=RM(0x0100+p);
	WRA(t);

	CLR_NZC;
	SET_N8(t);
	SET_Z8(t);

	tms7000_icount -= 9;
}
示例#13
0
static void mov_r2a( void )
{
	UINT8	r;
	UINT16	t;

	IMMBYTE(r);
	t = RM(r);
	WRA(t);

	CLR_NZC;
	SET_N8(t);
	SET_Z8(t);

	tms7000_icount -= 8;
}
示例#14
0
static void lda_inx( void )
{
	UINT16	t;
	PAIR	i;

	IMMWORD( i );
	t = RM(i.w.l + RDB);
	WRA(t);

	CLR_NZC;
	SET_N8(t);
	SET_Z8(t);

	tms7000_icount -= 13;
}
示例#15
0
static void lda_dir( void )
{
	UINT16	t;
	PAIR	i;

	IMMWORD( i );
	t = RM(i.w.l);
	WRA(t);

	CLR_NZC;
	SET_N8(t);
	SET_Z8(t);

	tms7000_icount -= 11;
}
示例#16
0
static void inc_a( void )
{
	UINT16	t;

	t = RDA + 1;

	WRA( t );

	CLR_NZC;
	SET_C8(t);
	SET_N8(t);
	SET_Z8(t);

	tms7000_icount -= 5;
}
示例#17
0
static void and_r2a( void )
{
	UINT8	t;
	UINT8	v;

	IMMBYTE(v);

	t = RM(v) & RDA;
	WRA(t);

	CLR_NZC;
	SET_N8(t);
	SET_Z8(t);

	tms7000_icount -= 8;
}
示例#18
0
static void xor_i2a( void )
{
	UINT8	t;
	UINT8	v;

	IMMBYTE(v);

	t = v ^ RDA;
	WRA(t);

	CLR_NZC;
	SET_N8(t);
	SET_Z8(t);

	tms7000_icount -= 7;
}
示例#19
0
static void sub_ia( void )
{
	UINT16	t;
	UINT8	i;

	IMMBYTE(i);
	t = RDA - i;
	WRA(t);

	CLR_NZC;
	SET_C8(~t);
	SET_N8(t);
	SET_Z8(t);

	tms7000_icount -= 7;
}
示例#20
0
static void xchb_a( void )
{
	UINT16	t,u;

	t = RDB;
	u = RDA;

	WRA(t);
	WRB(u);

	CLR_NZC;
	SET_N8(t);
	SET_Z8(t);

	tms7000_icount -= 6;
}
示例#21
0
static void sub_ra( void )
{
	UINT16	t;
	UINT8	r;

	IMMBYTE(r);
	t = RDA - RM(r);
	WRA(t);

	CLR_NZC;
	SET_C8(~t);
	SET_N8(t);
	SET_Z8(t);

	tms7000_icount -= 8;
}
示例#22
0
static void sbb_ia( void )
{
	UINT16	t;
	UINT8	i;

	IMMBYTE(i);
	t = RDA - i - ((pSR & SR_C) ? 0 : 1);
	WRA(t);

	CLR_NZC;
	SET_C8(~t);
	SET_N8(t);
	SET_Z8(t);

	tms7000_icount -= 7;
}
示例#23
0
static void adc_i2a( void )
{
	UINT16	t;
	UINT8	v;

	IMMBYTE(v);

	t = v + RDA + GET_C;
	WRA(t);

	CLR_NZC;
	SET_C8(t);
	SET_N8(t);
	SET_Z8(t);

	tms7000_icount -= 7;
}
示例#24
0
static void lda_ind( void )
{
	UINT16	t;
	PAIR	p;
	INT8	i;

	IMMBYTE(i);
	p.w.l=RRF16(i);
	t = RM(p.w.l);
	WRA(t);

	CLR_NZC;
	SET_N8(t);
	SET_Z8(t);

	tms7000_icount -= 10;
}
示例#25
0
static void dac_b2a( void )
{
	UINT16	t;

	t = bcd_add( RDA, RDB );

	if (pSR & SR_C)
		t = bcd_add( t, 1 );

	WRA(t);

	CLR_NZC;
	SET_C8(t);
	SET_N8(t);
	SET_Z8(t);

	tms7000_icount -= 7;
}
示例#26
0
static void dsb_b2a( void )
{
	UINT16	t;

	t = bcd_sub( RDA, RDB );

	if( !(pSR & SR_C) )
		t = bcd_sub( t, 1 );

	WRA(t);

	CLR_NZC;
	SET_C8(~t);
	SET_N8(t);
	SET_Z8(t);

	tms7000_icount -= 7;
}
示例#27
0
static void rl_a( void )
{
	UINT16	t;

	t = RDA << 1;

	CLR_NZC;
	SET_C8(t);

	if( pSR & SR_C )
		t |= 0x01;

	SET_N8(t);
	SET_Z8(t);
	WRA(t);

	tms7000_icount -= 5;
}
示例#28
0
static void xchb_r( void )
{
	UINT16	t,u;
	UINT8	r;

	IMMBYTE(r);

	t = RDB;
	u = RM(r);

	WRA(t);
	WRB(u);

	CLR_NZC;
	SET_N8(t);
	SET_Z8(t);

	tms7000_icount -= 8;
}
示例#29
0
static void tms7000_reset(void)
{
//  tms7000.architecture = (int)param;

	/*memory_install_read8_handler(cpu, ADDRESS_SPACE_PROGRAM, 0x0000, 0x007f, 0x0000, 0x0000, tms7000_internal_r);
    memory_install_write8_handler(cpu, ADDRESS_SPACE_PROGRAM, 0x0000, 0x007f, 0x0000, 0x0000, tms7000_internal_w);

    memory_install_read8_handler(cpu, ADDRESS_SPACE_PROGRAM, 0x0100, 0x01ff, 0x0000, 0x0000, tms70x0_pf_r);
    memory_install_write8_handler(cpu, ADDRESS_SPACE_PROGRAM, 0x0100, 0x01ff, 0x0000, 0x0000, tms70x0_pf_w);*/

	tms7000.idle_state = 0;
	tms7000.irq_state[ TMS7000_IRQ1_LINE ] = CLEAR_LINE;
	tms7000.irq_state[ TMS7000_IRQ2_LINE ] = CLEAR_LINE;
	tms7000.irq_state[ TMS7000_IRQ3_LINE ] = CLEAR_LINE;

	WM( 0x100 + 9, 0 );		/* Data direction regs are cleared */
	WM( 0x100 + 11, 0 );

//  if( tms7000.architecture == TMS7000_NMOS )
//  {
		WM( 0x100 + 4, 0xff );		/* Output 0xff on port A */
		WM( 0x100 + 8, 0xff );		/* Output 0xff on port C */
		WM( 0x100 + 10, 0xff );		/* Output 0xff on port D */
//  }
//  else
//  {
//      WM( 0x100 + 4, 0xff );      /* Output 0xff on port A */
//  }

	pSP = 0x01;				/* Set stack pointer to r1 */
	pSR = 0x00;				/* Clear status register (disabling interrupts */
	WM( 0x100 + 0, 0 );		/* Write a zero to IOCNT0 */

	/* On TMS70x2 and TMS70Cx2 IOCNT1 is zero */

	WRA( tms7000.pc.b.h );	/* Write previous PC to A:B */
	WRB( tms7000.pc.b.l );
	pPC = RM16(0xfffe);		/* Load reset vector */
	CHANGE_PC;

	tms7000_div_by_16_trigger = -16;
}
示例#30
0
static void swap_a( void )
{
	UINT8	a,b;
	UINT16	t;

	a = b = RDA;

	a <<= 4;
	b >>= 4;
	t = a+b;

	WRA(t);

	CLR_NZC;

	pSR|=((t&0x0001)<<7);
	SET_N8(t);
	SET_Z8(t);

	tms7000_icount -=8;
}