static void btjo_i2b( void ) { UINT8 t,i; IMMBYTE(i); t = i & RDB; CLR_NZC; SET_N8(t); SET_Z8(t); if(t != 0) { INT8 j; SIMMBYTE(j); pPC += j; tms7000_icount -= 11; } else { pPC++; tms7000_icount -= 9; } CHANGE_PC; }
static void btjop_ip( void ) { UINT8 t,p,i; IMMBYTE(i); IMMBYTE(p); t = RM(0x100+p) & i; CLR_NZC; SET_N8(t); SET_Z8(t); if(t != 0) { INT8 j; SIMMBYTE(j); pPC += j; tms7000_icount -= 14; } else { pPC++; tms7000_icount -= 12; } CHANGE_PC; }
static void btjop_ap( void ) { UINT8 t,p; IMMBYTE(p); t = RM(0x100+p) & RDA; CLR_NZC; SET_N8(t); SET_Z8(t); if(t != 0) { INT8 j; SIMMBYTE(j); pPC += j; tms7000_icount -= 13; } else { pPC++; tms7000_icount -= 11; } CHANGE_PC; }
static void rr_r( void ) { UINT16 t; UINT8 r; int old_bit0; IMMBYTE(r); t = RM(r); old_bit0 = t & 0x0001; t = t >> 1; CLR_NZC; if( old_bit0 ) { SETC; t |= 0x80; } SET_N8(t); SET_Z8(t); WM(r,t); tms7000_icount -= 7; }
static void rrc_r( void ) { UINT16 t; UINT8 r; int old_bit0; IMMBYTE(r); t = RM(r); old_bit0 = t & 0x0001; /* Place carry bit in 9th position */ t |= ((pSR & SR_C) << 1); t = t >> 1; CLR_NZC; if( old_bit0 ) SETC; SET_N8(t); SET_Z8(t); WM(r,t); tms7000_icount -= 7; }
static void btjz_b2a( void ) { UINT8 t; t = RDB & ~RDA; CLR_NZC; SET_N8(t); SET_Z8(t); if(t != 0) { INT8 j; SIMMBYTE( j ); pPC += j; tms7000_icount -= 9; } else { pPC++; tms7000_icount -= 7; } CHANGE_PC; }
static void rr_b( void ) { UINT16 t; int old_bit0; t = RDB; old_bit0 = t & 0x0001; t = t >> 1; CLR_NZC; if( old_bit0 ) { SETC; t |= 0x80; } SET_N8(t); SET_Z8(t); WRB(t); tms7000_icount -= 5; }
static void btjz_i2a( void ) { UINT8 t,r; IMMBYTE(r); t = r & ~RDA; CLR_NZC; SET_N8(t); SET_Z8(t); if(t != 0) { INT8 j; SIMMBYTE(j); pPC += j; tms7000_icount -= 11; } else { pPC++; tms7000_icount -= 9; } CHANGE_PC; }
static void btjz_r2r( void ) { UINT8 t,r,s; IMMBYTE(r); IMMBYTE(s); t = RM(r) & ~RM(s); CLR_NZC; SET_N8(t); SET_Z8(t); if(t != 0) { INT8 j; SIMMBYTE(j); pPC += j; tms7000_icount -= 14; } else { pPC++; tms7000_icount -= 12; } CHANGE_PC; }
static void btjzp_bp( void ) { UINT8 t,p; IMMBYTE(p); t = RDB & ~RM(0x100+p); CLR_NZC; SET_N8(t); SET_Z8(t); if(t != 0) { INT8 j; SIMMBYTE(j); pPC += j; tms7000_icount -= 12; } else { pPC++; tms7000_icount -= 10; } CHANGE_PC; }
static void btjz_i2r( void ) { UINT8 t,i,r; IMMBYTE(i); IMMBYTE(r); t = i & ~RM(r); CLR_NZC; SET_N8(t); SET_Z8(t); if(t != 0) { INT8 j; SIMMBYTE(j); pPC += j; tms7000_icount -= 13; } else { pPC++; tms7000_icount -= 11; } CHANGE_PC; }
static void djnz_r( void ) { UINT16 t; UINT8 r; IMMBYTE(r); t = RM(r) - 1; WM(r,t); CLR_NZC; SET_N8(t); SET_Z8(t); if( t != 0 ) { INT8 s; SIMMBYTE(s); pPC += s; tms7000_icount -= 9; } else { pPC++; tms7000_icount -= 3; } CHANGE_PC; }
static void djnz_b( void ) { UINT16 t; t = RDB - 1; WRB( 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; }
static void btjo_r2b( void ) { UINT8 t,r; IMMBYTE(r); t = RM(r) & RDB; CLR_NZC; SET_N8(t); SET_Z8(t); if(t != 0) { INT8 j; SIMMBYTE(j); pPC += j; tms7000_icount -= 12; } else { pPC++; tms7000_icount -= 10; } CHANGE_PC; }
/* $64 LSR indexed -0*-* */ INLINE void lsr_ix( void ) { UINT8 t; IDXBYTE(t); CLR_NZC; CC|=(t&0x01); t>>=1; SET_Z8(t); WM(EAD,t); }
/* $64 LSR indexed -0*-* */ INLINE void lsr_ix( void ) { UINT8 t; IDXBYTE(t); CLR_NZVC; CC|=(t&0x01); t>>=1; SET_Z8(t); if (NXORC) SEV; WM(EAD,t); }
/* $74 LSR extended -0*-* */ M6800_INLINE void lsr_ex( void ) { UINT8 t; EXTBYTE(t); CLR_NZC; CC|=(t&0x01); t>>=1; SET_Z8(t); WM(EAD,t); }
static void clrc( void ) { UINT8 a; a = RDA; CLR_NZC; SET_N8(a); SET_Z8(a); tms7000_icount -= 6; }
static void tstb( void ) { UINT16 t; t=RDB; CLR_NZC; SET_N8(t); SET_Z8(t); tms7000_icount -= 6; }
static void swap_r_exl( void ) { UINT8 a,b,r; UINT16 t; IMMBYTE(r); if (r == 0) { /* opcode D7 00 (LVDP) mostly equivalent to MOVP P46,A??? (timings must be different, possibly the microcode polls the state of the VDP RDY line prior to doing the transfer) */ t=RM(0x012e); WRA(t); CLR_NZC; SET_N8(t); SET_Z8(t); tms7000_icount -= 9; /* ?????? */ } else { /* stright swap Rn instruction */ a = b = RM(r); a <<= 4; b >>= 4; t = a+b; WM(r,t); CLR_NZC; pSR|=((t&0x0001)<<7); SET_N8(t); SET_Z8(t); tms7000_icount -=8; } }
static void inv_b( void ) { UINT16 t; t = ~(RDA); WRA(t); CLR_NZC; SET_N8(t); SET_Z8(t); tms7000_icount -= 5; }
static void mov_a2b( void ) { UINT16 t; t = RDA; WRB(t); CLR_NZC; SET_N8(t); SET_Z8(t); tms7000_icount -= 6; }
static void mov_b2a( void ) { UINT16 t; t = RDB; WRA(t); CLR_NZC; SET_N8(t); SET_Z8(t); tms7000_icount -= 5; }
static void mov_i2b( void ) { UINT16 t; IMMBYTE(t); WRB(t); CLR_NZC; SET_N8(t); SET_Z8(t); tms7000_icount -= 7; }
static void pop_b( void ) { UINT16 t; PULLBYTE(t); WRB(t); CLR_NZC; SET_N8(t); SET_Z8(t); tms7000_icount -= 6; }
static void push_b( void ) { UINT16 t; t = RDB; PUSHBYTE(t); CLR_NZC; SET_N8(t); SET_Z8(t); tms7000_icount -= 6; }
static void xor_b2a( void ) { UINT8 t; t = RDA ^ RDB; WRA(t); CLR_NZC; SET_N8(t); SET_Z8(t); tms7000_icount -= 5; }
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; }
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; }
static void movp_i2p( void ) { UINT8 i,v; IMMBYTE(i); IMMBYTE(v); WM( 0x0100+v, i); CLR_NZC; SET_N8(i); SET_Z8(i); tms7000_icount -= 11; }