/* $8c CPX immediate -**** (6803) */ INLINE void cpx_im( void ) { UINT32 r,d; PAIR b; IMMWORD(b); d = X; r = d - b.d; CLR_NZVC; SET_FLAGS16(d,b.d,r); }
static void br_inx( void ) { PAIR p; IMMWORD( p ); pPC = p.w.l + RDB; CHANGE_PC; tms7000_icount -= 12; }
static void br_dir( void ) { PAIR p; IMMWORD( p ); pPC = p.d; CHANGE_PC; tms7000_icount -= 10; }
/* $8c CMPX immediate -***- */ INLINE void cmpx_im( void ) { UINT32 r,d; PAIR b; IMMWORD(b); d = X; r = d - b.d; CLR_NZV; SET_NZ16(r); SET_V16(d,b.d,r); }
static void call_inx( void ) { PAIR tPC; IMMWORD( tPC ); PUSHWORD( PC ); pPC = tPC.w.l + RDB; CHANGE_PC; tms7000_icount -= 16; }
/* $83 SUBD immediate -**** */ M6800_INLINE void subd_im( void ) { UINT32 r,d; PAIR b; IMMWORD(b); d = D; r = d - b.d; CLR_NZVC; SET_FLAGS16(d,b.d,r); D = r; }
static void call_dir( void ) { PAIR tPC; IMMWORD( tPC ); PUSHWORD( PC ); pPC = tPC.d; CHANGE_PC; tms7000_icount -= 14; }
/* $c3 ADDD immediate -**** */ INLINE void addd_im( void ) { UINT32 r,d; PAIR b; IMMWORD(b); d = D; r = d + b.d; CLR_NZVC; SET_FLAGS16(d,b.d,r); D = r; }
/* $8c CMPX immediate -***- */ INLINE void cmpx_im( void ) { #if 0 UINT32 r,d; PAIR b; IMMWORD(b); d = X; r = d - b.d; CLR_NZV; SET_NZ16(r); SET_V16(d,b.d,r); #else PAIR r,d,b; IMMWORD(b); d.d = X; r.w.l = d.b.h - b.b.h; CLR_NZV; SET_N8(r.b.l); SET_V8(d.b.h, b.b.h, r.w.l); r.d = d.d - b.d; SET_Z16(r.d); #endif }
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; }
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; }
static void sta_inx( void ) { UINT16 t; PAIR i; IMMWORD( i ); t = RDA; WM(i.w.l+RDB,t); CLR_NZC; SET_N8(t); SET_Z8(t); tms7000_icount -= 13; }
static void sta_dir( void ) { UINT16 t; PAIR i; t = RDA; IMMWORD( i ); WM(i.w.l,t); CLR_NZC; SET_N8(t); SET_Z8(t); tms7000_icount -= 11; }
static void movd_inx( void ) { PAIR t; UINT8 r; IMMWORD(t); t.w.l += RDB; IMMBYTE(r); WRF16(r,t); CLR_NZC; SET_N8(t.b.h); SET_Z8(t.b.h); tms7000_icount -= 17; }
static void movd_imm( void ) { PAIR t; UINT8 r; IMMWORD(t); IMMBYTE(r); WRF16(r,t); CLR_NZC; SET_N8(t.b.h); SET_Z8(t.b.h); tms7000_icount -= 15; }
static void cmpa_inx( void ) { UINT16 t; PAIR i; IMMWORD( i ); t = RDA - RM(i.w.l + RDB); CLR_NZC; SET_N8(t); SET_Z8(t); if( t==0 ) SETC; else SET_C8( ~t ); tms7000_icount -= 14; }
INLINE void fetch_effective_address( void ) { UINT8 postbyte = ROP_ARG(PCD); PC++; switch(postbyte) { case 0x00: EA=X; break; case 0x01: EA=X+1; break; case 0x02: EA=X+2; break; case 0x03: EA=X+3; break; case 0x04: EA=X+4; break; case 0x05: EA=X+5; break; case 0x06: EA=X+6; break; case 0x07: EA=X+7; break; case 0x08: EA=X+8; break; case 0x09: EA=X+9; break; case 0x0a: EA=X+10; break; case 0x0b: EA=X+11; break; case 0x0c: EA=X+12; break; case 0x0d: EA=X+13; break; case 0x0e: EA=X+14; break; case 0x0f: EA=X+15; break; case 0x10: EA=X-16; break; case 0x11: EA=X-15; break; case 0x12: EA=X-14; break; case 0x13: EA=X-13; break; case 0x14: EA=X-12; break; case 0x15: EA=X-11; break; case 0x16: EA=X-10; break; case 0x17: EA=X-9; break; case 0x18: EA=X-8; break; case 0x19: EA=X-7; break; case 0x1a: EA=X-6; break; case 0x1b: EA=X-5; break; case 0x1c: EA=X-4; break; case 0x1d: EA=X-3; break; case 0x1e: EA=X-2; break; case 0x1f: EA=X-1; break; case 0x20: EA=Y; break; case 0x21: EA=Y+1; break; case 0x22: EA=Y+2; break; case 0x23: EA=Y+3; break; case 0x24: EA=Y+4; break; case 0x25: EA=Y+5; break; case 0x26: EA=Y+6; break; case 0x27: EA=Y+7; break; case 0x28: EA=Y+8; break; case 0x29: EA=Y+9; break; case 0x2a: EA=Y+10; break; case 0x2b: EA=Y+11; break; case 0x2c: EA=Y+12; break; case 0x2d: EA=Y+13; break; case 0x2e: EA=Y+14; break; case 0x2f: EA=Y+15; break; case 0x30: EA=Y-16; break; case 0x31: EA=Y-15; break; case 0x32: EA=Y-14; break; case 0x33: EA=Y-13; break; case 0x34: EA=Y-12; break; case 0x35: EA=Y-11; break; case 0x36: EA=Y-10; break; case 0x37: EA=Y-9; break; case 0x38: EA=Y-8; break; case 0x39: EA=Y-7; break; case 0x3a: EA=Y-6; break; case 0x3b: EA=Y-5; break; case 0x3c: EA=Y-4; break; case 0x3d: EA=Y-3; break; case 0x3e: EA=Y-2; break; case 0x3f: EA=Y-1; break; case 0x40: EA=U; break; case 0x41: EA=U+1; break; case 0x42: EA=U+2; break; case 0x43: EA=U+3; break; case 0x44: EA=U+4; break; case 0x45: EA=U+5; break; case 0x46: EA=U+6; break; case 0x47: EA=U+7; break; case 0x48: EA=U+8; break; case 0x49: EA=U+9; break; case 0x4a: EA=U+10; break; case 0x4b: EA=U+11; break; case 0x4c: EA=U+12; break; case 0x4d: EA=U+13; break; case 0x4e: EA=U+14; break; case 0x4f: EA=U+15; break; case 0x50: EA=U-16; break; case 0x51: EA=U-15; break; case 0x52: EA=U-14; break; case 0x53: EA=U-13; break; case 0x54: EA=U-12; break; case 0x55: EA=U-11; break; case 0x56: EA=U-10; break; case 0x57: EA=U-9; break; case 0x58: EA=U-8; break; case 0x59: EA=U-7; break; case 0x5a: EA=U-6; break; case 0x5b: EA=U-5; break; case 0x5c: EA=U-4; break; case 0x5d: EA=U-3; break; case 0x5e: EA=U-2; break; case 0x5f: EA=U-1; break; case 0x60: EA=S; break; case 0x61: EA=S+1; break; case 0x62: EA=S+2; break; case 0x63: EA=S+3; break; case 0x64: EA=S+4; break; case 0x65: EA=S+5; break; case 0x66: EA=S+6; break; case 0x67: EA=S+7; break; case 0x68: EA=S+8; break; case 0x69: EA=S+9; break; case 0x6a: EA=S+10; break; case 0x6b: EA=S+11; break; case 0x6c: EA=S+12; break; case 0x6d: EA=S+13; break; case 0x6e: EA=S+14; break; case 0x6f: EA=S+15; break; case 0x70: EA=S-16; break; case 0x71: EA=S-15; break; case 0x72: EA=S-14; break; case 0x73: EA=S-13; break; case 0x74: EA=S-12; break; case 0x75: EA=S-11; break; case 0x76: EA=S-10; break; case 0x77: EA=S-9; break; case 0x78: EA=S-8; break; case 0x79: EA=S-7; break; case 0x7a: EA=S-6; break; case 0x7b: EA=S-5; break; case 0x7c: EA=S-4; break; case 0x7d: EA=S-3; break; case 0x7e: EA=S-2; break; case 0x7f: EA=S-1; break; case 0x80: EA=X; X++; break; case 0x81: EA=X; X+=2; break; case 0x82: X--; EA=X; break; case 0x83: X-=2; EA=X; break; case 0x84: EA=X; break; case 0x85: EA=X+SIGNED(B); break; case 0x86: EA=X+SIGNED(A); break; case 0x87: EA=X+SIGNED(E); break; case 0x88: IMMBYTE(EA); EA=X+SIGNED(EA); break; case 0x89: IMMWORD(ea); EA+=X; break; case 0x8a: EA=X+SIGNED(F); break; case 0x8b: EA=X+D; break; case 0x8c: IMMBYTE(EA); EA=PC+SIGNED(EA); break; case 0x8d: IMMWORD(ea); EA+=PC; break; case 0x8e: EA=X+W; break; case 0x8f: EA=W; break; case 0x90: EA=W; EAD=RM16(EAD); break; case 0x91: EA=X; X+=2; EAD=RM16(EAD); break; case 0x92: IIError(); break; case 0x93: X-=2; EA=X; EAD=RM16(EAD); break; case 0x94: EA=X; EAD=RM16(EAD); break; case 0x95: EA=X+SIGNED(B); EAD=RM16(EAD); break; case 0x96: EA=X+SIGNED(A); EAD=RM16(EAD); break; case 0x97: EA=X+SIGNED(E); EAD=RM16(EAD); break; case 0x98: IMMBYTE(EA); EA=X+SIGNED(EA); EAD=RM16(EAD); break; case 0x99: IMMWORD(ea); EA+=X; EAD=RM16(EAD); break; case 0x9a: EA=X+SIGNED(F); EAD=RM16(EAD); break; case 0x9b: EA=X+D; EAD=RM16(EAD); break; case 0x9c: IMMBYTE(EA); EA=PC+SIGNED(EA); EAD=RM16(EAD); break; case 0x9d: IMMWORD(ea); EA+=PC; EAD=RM16(EAD); break; case 0x9e: EA=X+W; EAD=RM16(EAD); break; case 0x9f: IMMWORD(ea); EAD=RM16(EAD); break; case 0xa0: EA=Y; Y++; break; case 0xa1: EA=Y; Y+=2; break; case 0xa2: Y--; EA=Y; break; case 0xa3: Y-=2; EA=Y; break; case 0xa4: EA=Y; break; case 0xa5: EA=Y+SIGNED(B); break; case 0xa6: EA=Y+SIGNED(A); break; case 0xa7: EA=Y+SIGNED(E); break; case 0xa8: IMMBYTE(EA); EA=Y+SIGNED(EA); break; case 0xa9: IMMWORD(ea); EA+=Y; break; case 0xaa: EA=Y+SIGNED(F); break; case 0xab: EA=Y+D; break; case 0xac: IMMBYTE(EA); EA=PC+SIGNED(EA); break; case 0xad: IMMWORD(ea); EA+=PC; break; case 0xae: EA=Y+W; break; case 0xaf: IMMWORD(ea); EA+=W; break; case 0xb0: IMMWORD(ea); EA+=W; EAD=RM16(EAD); break; case 0xb1: EA=Y; Y+=2; EAD=RM16(EAD); break; case 0xb2: IIError(); break; case 0xb3: Y-=2; EA=Y; EAD=RM16(EAD); break; case 0xb4: EA=Y; EAD=RM16(EAD); break; case 0xb5: EA=Y+SIGNED(B); EAD=RM16(EAD); break; case 0xb6: EA=Y+SIGNED(A); EAD=RM16(EAD); break; case 0xb7: EA=Y+SIGNED(E); EAD=RM16(EAD); break; case 0xb8: IMMBYTE(EA); EA=Y+SIGNED(EA); EAD=RM16(EAD); break; case 0xb9: IMMWORD(ea); EA+=Y; EAD=RM16(EAD); break; case 0xba: EA=Y+SIGNED(F); EAD=RM16(EAD); break; case 0xbb: EA=Y+D; EAD=RM16(EAD); break; case 0xbc: IMMBYTE(EA); EA=PC+SIGNED(EA); EAD=RM16(EAD); break; case 0xbd: IMMWORD(ea); EA+=PC; EAD=RM16(EAD); break; case 0xbe: EA=Y+W; EAD=RM16(EAD); break; case 0xbf: IIError(); break; case 0xc0: EA=U; U++; break; case 0xc1: EA=U; U+=2; break; case 0xc2: U--; EA=U; break; case 0xc3: U-=2; EA=U; break; case 0xc4: EA=U; break; case 0xc5: EA=U+SIGNED(B); break; case 0xc6: EA=U+SIGNED(A); break; case 0xc7: EA=U+SIGNED(E); break; case 0xc8: IMMBYTE(EA); EA=U+SIGNED(EA); break; case 0xc9: IMMWORD(ea); EA+=U; break; case 0xca: EA=U+SIGNED(F); break; case 0xcb: EA=U+D; break; case 0xcc: IMMBYTE(EA); EA=PC+SIGNED(EA); break; case 0xcd: IMMWORD(ea); EA+=PC; break; case 0xce: EA=U+W; break; case 0xcf: EA=W; W+=2; break; case 0xd0: EA=W; W+=2; EAD=RM16(EAD); break; case 0xd1: EA=U; U+=2; EAD=RM16(EAD); break; case 0xd2: IIError(); break; case 0xd3: U-=2; EA=U; EAD=RM16(EAD); break; case 0xd4: EA=U; EAD=RM16(EAD); break; case 0xd5: EA=U+SIGNED(B); EAD=RM16(EAD); break; case 0xd6: EA=U+SIGNED(A); EAD=RM16(EAD); break; case 0xd7: EA=U+SIGNED(E); EAD=RM16(EAD); break; case 0xd8: IMMBYTE(EA); EA=U+SIGNED(EA); EAD=RM16(EAD); break; case 0xd9: IMMWORD(ea); EA+=U; EAD=RM16(EAD); break; case 0xda: EA=U+SIGNED(F); EAD=RM16(EAD); break; case 0xdb: EA=U+D; EAD=RM16(EAD); break; case 0xdc: IMMBYTE(EA); EA=PC+SIGNED(EA); EAD=RM16(EAD); break; case 0xdd: IMMWORD(ea); EA+=PC; EAD=RM16(EAD); break; case 0xde: EA=U+W; EAD=RM16(EAD); break; case 0xdf: IIError(); break; case 0xe0: EA=S; S++; break; case 0xe1: EA=S; S+=2; break; case 0xe2: S--; EA=S; break; case 0xe3: S-=2; EA=S; break; case 0xe4: EA=S; break; case 0xe5: EA=S+SIGNED(B); break; case 0xe6: EA=S+SIGNED(A); break; case 0xe7: EA=S+SIGNED(E); break; case 0xe8: IMMBYTE(EA); EA=S+SIGNED(EA); break; case 0xe9: IMMWORD(ea); EA+=S; break; case 0xea: EA=S+SIGNED(F); break; case 0xeb: EA=S+D; break; case 0xec: IMMBYTE(EA); EA=PC+SIGNED(EA); break; case 0xed: IMMWORD(ea); EA+=PC; break; case 0xee: EA=S+W; break; case 0xef: W-=2; EA=W; break; case 0xf0: W-=2; EA=W; EAD=RM16(EAD); break; case 0xf1: EA=S; S+=2; EAD=RM16(EAD); break; case 0xf2: IIError(); break; case 0xf3: S-=2; EA=S; EAD=RM16(EAD); break; case 0xf4: EA=S; EAD=RM16(EAD); break; case 0xf5: EA=S+SIGNED(B); EAD=RM16(EAD); break; case 0xf6: EA=S+SIGNED(A); EAD=RM16(EAD); break; case 0xf7: EA=S+SIGNED(E); EAD=RM16(EAD); break; case 0xf8: IMMBYTE(EA); EA=S+SIGNED(EA); EAD=RM16(EAD); break; case 0xf9: IMMWORD(ea); EA+=S; EAD=RM16(EAD); break; case 0xfa: EA=S+SIGNED(F); EAD=RM16(EAD); break; case 0xfb: EA=S+D; EAD=RM16(EAD); break; case 0xfc: IMMBYTE(EA); EA=PC+SIGNED(EA); EAD=RM16(EAD); break; case 0xfd: IMMWORD(ea); EA+=PC; EAD=RM16(EAD); break; case 0xfe: EA=S+W; EAD=RM16(EAD); break; case 0xff: IIError(); break; } hd6309_ICount -= index_cycle[postbyte]; }
/* $ce LDX immediate -**0- */ INLINE void ldx_im( void ) { IMMWORD(m6808.x); CLR_NZV; SET_NZ16(X); }
/* $CC LDD immediate -**0- */ INLINE void ldd_im( void ) { IMMWORD(m6808.d); CLR_NZV; SET_NZ16(D); }
/* $8e LDS immediate -**0- */ INLINE void lds_im( void ) { IMMWORD(m6808.s); CLR_NZV; SET_NZ16(S); }