M6800_INLINE void aba(void);
M6800_INLINE void abx(void);
M6800_INLINE void adca_di(void);
M6800_INLINE void adca_ex(void);
M6800_INLINE void adca_im(void);
M6800_INLINE void adca_ix(void);
M6800_INLINE void adcb_di(void);
M6800_INLINE void adcb_ex(void);
M6800_INLINE void adcb_im(void);
M6800_INLINE void adcb_ix(void);
M6800_INLINE void adcx_im(void);
M6800_INLINE void adda_di(void);
M6800_INLINE void adda_ex(void);
M6800_INLINE void adda_im(void);
M6800_INLINE void adda_ix(void);
M6800_INLINE void addb_di(void);
M6800_INLINE void addb_ex(void);
M6800_INLINE void addb_im(void);
M6800_INLINE void addb_ix(void);
M6800_INLINE void addd_di(void);
M6800_INLINE void addd_ex(void);
M6800_INLINE void addx_ex(void);
M6800_INLINE void addd_im(void);
M6800_INLINE void addd_ix(void);
M6800_INLINE void aim_di(void);
M6800_INLINE void aim_ix(void);
M6800_INLINE void anda_di(void);
M6800_INLINE void anda_ex(void);
M6800_INLINE void anda_im(void);
M6800_INLINE void anda_ix(void);
M6800_INLINE void andb_di(void);
M6800_INLINE void andb_ex(void);
M6800_INLINE void andb_im(void);
M6800_INLINE void andb_ix(void);
M6800_INLINE void asl_ex(void);
M6800_INLINE void asl_ix(void);
M6800_INLINE void asla(void);
M6800_INLINE void aslb(void);
M6800_INLINE void asld(void);
M6800_INLINE void asr_ex(void);
M6800_INLINE void asr_ix(void);
M6800_INLINE void asra(void);
M6800_INLINE void asrb(void);
M6800_INLINE void bcc(void);
M6800_INLINE void bcs(void);
M6800_INLINE void beq(void);
M6800_INLINE void bge(void);
M6800_INLINE void bgt(void);
M6800_INLINE void bhi(void);
M6800_INLINE void bita_di(void);
M6800_INLINE void bita_ex(void);
M6800_INLINE void bita_im(void);
M6800_INLINE void bita_ix(void);
M6800_INLINE void bitb_di(void);
M6800_INLINE void bitb_ex(void);
M6800_INLINE void bitb_im(void);
M6800_INLINE void bitb_ix(void);
M6800_INLINE void ble(void);
M6800_INLINE void bls(void);
M6800_INLINE void blt(void);
M6800_INLINE void bmi(void);
M6800_INLINE void bne(void);
M6800_INLINE void bpl(void);
M6800_INLINE void bra(void);
M6800_INLINE void brn(void);
M6800_INLINE void bsr(void);
M6800_INLINE void bvc(void);
M6800_INLINE void bvs(void);
M6800_INLINE void cba(void);
M6800_INLINE void clc(void);
M6800_INLINE void cli(void);
M6800_INLINE void clr_ex(void);
M6800_INLINE void clr_ix(void);
M6800_INLINE void clra(void);
M6800_INLINE void clrb(void);
M6800_INLINE void clv(void);
M6800_INLINE void cmpa_di(void);
M6800_INLINE void cmpa_ex(void);
M6800_INLINE void cmpa_im(void);
M6800_INLINE void cmpa_ix(void);
M6800_INLINE void cmpb_di(void);
M6800_INLINE void cmpb_ex(void);
M6800_INLINE void cmpb_im(void);
M6800_INLINE void cmpb_ix(void);
M6800_INLINE void cmpx_di(void);
M6800_INLINE void cmpx_ex(void);
M6800_INLINE void cmpx_im(void);
M6800_INLINE void cmpx_ix(void);
M6800_INLINE void com_ex(void);
M6800_INLINE void com_ix(void);
M6800_INLINE void coma(void);
M6800_INLINE void comb(void);
M6800_INLINE void daa(void);
M6800_INLINE void dec_ex(void);
M6800_INLINE void dec_ix(void);
M6800_INLINE void deca(void);
M6800_INLINE void decb(void);
M6800_INLINE void des(void);
M6800_INLINE void dex(void);
M6800_INLINE void eim_di(void);
M6800_INLINE void eim_ix(void);
M6800_INLINE void eora_di(void);
M6800_INLINE void eora_ex(void);
M6800_INLINE void eora_im(void);
M6800_INLINE void eora_ix(void);
M6800_INLINE void eorb_di(void);
M6800_INLINE void eorb_ex(void);
M6800_INLINE void eorb_im(void);
M6800_INLINE void eorb_ix(void);
static void illegl1(void);
static void illegl2(void);
static void illegl3(void);
M6800_INLINE void inc_ex(void);
M6800_INLINE void inc_ix(void);
M6800_INLINE void inca(void);
M6800_INLINE void incb(void);
M6800_INLINE void ins(void);
M6800_INLINE void inx(void);
M6800_INLINE void jmp_ex(void);
M6800_INLINE void jmp_ix(void);
M6800_INLINE void jsr_di(void);
M6800_INLINE void jsr_ex(void);
M6800_INLINE void jsr_ix(void);
M6800_INLINE void lda_di(void);
M6800_INLINE void lda_ex(void);
M6800_INLINE void lda_im(void);
M6800_INLINE void lda_ix(void);
M6800_INLINE void ldb_di(void);
M6800_INLINE void ldb_ex(void);
M6800_INLINE void ldb_im(void);
M6800_INLINE void ldb_ix(void);
M6800_INLINE void ldd_di(void);
M6800_INLINE void ldd_ex(void);
M6800_INLINE void ldd_im(void);
M6800_INLINE void ldd_ix(void);
M6800_INLINE void lds_di(void);
M6800_INLINE void lds_ex(void);
M6800_INLINE void lds_im(void);
M6800_INLINE void lds_ix(void);
M6800_INLINE void ldx_di(void);
M6800_INLINE void ldx_ex(void);
M6800_INLINE void ldx_im(void);
M6800_INLINE void ldx_ix(void);
M6800_INLINE void lsr_ex(void);
M6800_INLINE void lsr_ix(void);
M6800_INLINE void lsra(void);
M6800_INLINE void lsrb(void);
M6800_INLINE void lsrd(void);
M6800_INLINE void mul(void);
M6800_INLINE void neg_ex(void);
M6800_INLINE void neg_ix(void);
M6800_INLINE void nega(void);
M6800_INLINE void negb(void);
M6800_INLINE void nop(void);
M6800_INLINE void oim_di(void);
M6800_INLINE void oim_ix(void);
M6800_INLINE void ora_di(void);
M6800_INLINE void ora_ex(void);
M6800_INLINE void ora_im(void);
M6800_INLINE void ora_ix(void);
M6800_INLINE void orb_di(void);
M6800_INLINE void orb_ex(void);
M6800_INLINE void orb_im(void);
M6800_INLINE void orb_ix(void);
M6800_INLINE void psha(void);
M6800_INLINE void pshb(void);
M6800_INLINE void pshx(void);
M6800_INLINE void pula(void);
M6800_INLINE void pulb(void);
M6800_INLINE void pulx(void);
M6800_INLINE void rol_ex(void);
M6800_INLINE void rol_ix(void);
M6800_INLINE void rola(void);
M6800_INLINE void rolb(void);
M6800_INLINE void ror_ex(void);
M6800_INLINE void ror_ix(void);
M6800_INLINE void rora(void);
M6800_INLINE void rorb(void);
M6800_INLINE void rti(void);
M6800_INLINE void rts(void);
M6800_INLINE void sba(void);
M6800_INLINE void sbca_di(void);
M6800_INLINE void sbca_ex(void);
M6800_INLINE void sbca_im(void);
M6800_INLINE void sbca_ix(void);
M6800_INLINE void sbcb_di(void);
M6800_INLINE void sbcb_ex(void);
M6800_INLINE void sbcb_im(void);
M6800_INLINE void sbcb_ix(void);
M6800_INLINE void sec(void);
M6800_INLINE void sei(void);
M6800_INLINE void sev(void);
#if (HAS_HD63701)
M6800_INLINE void slp(void);
#endif
M6800_INLINE void sta_di(void);
M6800_INLINE void sta_ex(void);
M6800_INLINE void sta_im(void);
M6800_INLINE void sta_ix(void);
M6800_INLINE void stb_di(void);
M6800_INLINE void stb_ex(void);
M6800_INLINE void stb_im(void);
M6800_INLINE void stb_ix(void);
M6800_INLINE void std_di(void);
M6800_INLINE void std_ex(void);
M6800_INLINE void std_im(void);
M6800_INLINE void std_ix(void);
M6800_INLINE void sts_di(void);
M6800_INLINE void sts_ex(void);
M6800_INLINE void sts_im(void);
M6800_INLINE void sts_ix(void);
M6800_INLINE void stx_di(void);
M6800_INLINE void stx_ex(void);
M6800_INLINE void stx_im(void);
M6800_INLINE void stx_ix(void);
M6800_INLINE void suba_di(void);
M6800_INLINE void suba_ex(void);
M6800_INLINE void suba_im(void);
M6800_INLINE void suba_ix(void);
M6800_INLINE void subb_di(void);
M6800_INLINE void subb_ex(void);
M6800_INLINE void subb_im(void);
M6800_INLINE void subb_ix(void);
M6800_INLINE void subd_di(void);
M6800_INLINE void subd_ex(void);
M6800_INLINE void subd_im(void);
M6800_INLINE void subd_ix(void);
M6800_INLINE void swi(void);
M6800_INLINE void tab(void);
M6800_INLINE void tap(void);
M6800_INLINE void tba(void);
M6800_INLINE void tim_di(void);
M6800_INLINE void tim_ix(void);
M6800_INLINE void tpa(void);
M6800_INLINE void tst_ex(void);
M6800_INLINE void tst_ix(void);
M6800_INLINE void tsta(void);
M6800_INLINE void tstb(void);
M6800_INLINE void tsx(void);
M6800_INLINE void txs(void);
M6800_INLINE void undoc1(void);
M6800_INLINE void undoc2(void);
M6800_INLINE void wai(void);
M6800_INLINE void xgdx(void);

M6800_INLINE void cpx_di(void);
M6800_INLINE void cpx_ex(void);
M6800_INLINE void cpx_im(void);
M6800_INLINE void cpx_ix(void);
#if (HAS_HD63701)
//M6800_INLINE void trap(void);
static void trap(void);
#endif
#if (HAS_NSC8105)
M6800_INLINE void btst_ix(void);
M6800_INLINE void stx_nsc(void);
#endif

static void (*m6800_insn[0x100])(void) = {
illegl1,nop,    illegl1,illegl1,illegl1,illegl1,tap,    tpa,
inx,    dex,    clv,    sev,    clc,    sec,    cli,    sei,
sba,    cba,    illegl1,illegl1,illegl1,illegl1,tab,    tba,
illegl1,daa,    illegl1,aba,    illegl1,illegl1,illegl1,illegl1,
bra,    brn,    bhi,    bls,    bcc,    bcs,    bne,    beq,
bvc,    bvs,    bpl,    bmi,    bge,    blt,    bgt,    ble,
tsx,    ins,    pula,   pulb,   des,    txs,    psha,   pshb,
illegl1,rts,    illegl1,rti,    illegl1,illegl1,wai,    swi,
nega,   illegl1,illegl1,coma,   lsra,   illegl1,rora,   asra,
asla,   rola,   deca,   illegl1,inca,   tsta,   illegl1,clra,
negb,   illegl1,illegl1,comb,   lsrb,   illegl1,rorb,   asrb,
aslb,   rolb,   decb,   illegl1,incb,   tstb,   illegl1,clrb,
neg_ix, illegl2,illegl2,com_ix, lsr_ix, illegl2,ror_ix, asr_ix,
asl_ix, rol_ix, dec_ix, illegl2,inc_ix, tst_ix, jmp_ix, clr_ix,
neg_ex, illegl3,illegl3,com_ex, lsr_ex, illegl3,ror_ex, asr_ex,
asl_ex, rol_ex, dec_ex, illegl3,inc_ex, tst_ex, jmp_ex, clr_ex,
suba_im,cmpa_im,sbca_im,illegl2,anda_im,bita_im,lda_im, sta_im,
eora_im,adca_im,ora_im, adda_im,cmpx_im,bsr,    lds_im, sts_im,
suba_di,cmpa_di,sbca_di,illegl2,anda_di,bita_di,lda_di, sta_di,
eora_di,adca_di,ora_di, adda_di,cmpx_di,jsr_di, lds_di, sts_di,
suba_ix,cmpa_ix,sbca_ix,illegl2,anda_ix,bita_ix,lda_ix, sta_ix,
eora_ix,adca_ix,ora_ix, adda_ix,cmpx_ix,jsr_ix, lds_ix, sts_ix,
suba_ex,cmpa_ex,sbca_ex,illegl3,anda_ex,bita_ex,lda_ex, sta_ex,
eora_ex,adca_ex,ora_ex, adda_ex,cmpx_ex,jsr_ex, lds_ex, sts_ex,
subb_im,cmpb_im,sbcb_im,illegl2,andb_im,bitb_im,ldb_im, stb_im,
eorb_im,adcb_im,orb_im, addb_im,illegl3,illegl3,ldx_im, stx_im,
subb_di,cmpb_di,sbcb_di,illegl2,andb_di,bitb_di,ldb_di, stb_di,
eorb_di,adcb_di,orb_di, addb_di,illegl2,illegl2,ldx_di, stx_di,
subb_ix,cmpb_ix,sbcb_ix,illegl2,andb_ix,bitb_ix,ldb_ix, stb_ix,
eorb_ix,adcb_ix,orb_ix, addb_ix,illegl2,illegl2,ldx_ix, stx_ix,
subb_ex,cmpb_ex,sbcb_ex,illegl3,andb_ex,bitb_ex,ldb_ex, stb_ex,
eorb_ex,adcb_ex,orb_ex, addb_ex,illegl3,illegl3,ldx_ex, stx_ex
};

#if (HAS_M6801||HAS_M6803)
static void (*m6803_insn[0x100])(void) = {
illegl1,nop,    illegl1,illegl1,lsrd,   asld,   tap,    tpa,
inx,    dex,    clv,    sev,    clc,    sec,    cli,    sei,
sba,    cba,    illegl1,illegl1,illegl1,illegl1,tab,    tba,
illegl1,daa,    illegl1,aba,    illegl1,illegl1,illegl1,illegl1,
bra,    brn,    bhi,    bls,    bcc,    bcs,    bne,    beq,
bvc,    bvs,    bpl,    bmi,    bge,    blt,    bgt,    ble,
tsx,    ins,    pula,   pulb,   des,    txs,    psha,   pshb,
pulx,   rts,    abx,    rti,    pshx,   mul,    wai,    swi,
nega,   illegl1,illegl1,coma,   lsra,   illegl1,rora,   asra,
asla,   rola,   deca,   illegl1,inca,   tsta,   illegl1,clra,
negb,   illegl1,illegl1,comb,   lsrb,   illegl1,rorb,   asrb,
aslb,   rolb,   decb,   illegl1,incb,   tstb,   illegl1,clrb,
neg_ix, illegl1,illegl1,com_ix, lsr_ix, illegl1,ror_ix, asr_ix,
asl_ix, rol_ix, dec_ix, illegl1,inc_ix, tst_ix, jmp_ix, clr_ix,
neg_ex, illegl1,illegl1,com_ex, lsr_ex, illegl1,ror_ex, asr_ex,
asl_ex, rol_ex, dec_ex, illegl1,inc_ex, tst_ex, jmp_ex, clr_ex,
suba_im,cmpa_im,sbca_im,subd_im,anda_im,bita_im,lda_im, sta_im,
eora_im,adca_im,ora_im, adda_im,cpx_im ,bsr,    lds_im, sts_im,
suba_di,cmpa_di,sbca_di,subd_di,anda_di,bita_di,lda_di, sta_di,
eora_di,adca_di,ora_di, adda_di,cpx_di ,jsr_di, lds_di, sts_di,
suba_ix,cmpa_ix,sbca_ix,subd_ix,anda_ix,bita_ix,lda_ix, sta_ix,
eora_ix,adca_ix,ora_ix, adda_ix,cpx_ix ,jsr_ix, lds_ix, sts_ix,
suba_ex,cmpa_ex,sbca_ex,subd_ex,anda_ex,bita_ex,lda_ex, sta_ex,
eora_ex,adca_ex,ora_ex, adda_ex,cpx_ex ,jsr_ex, lds_ex, sts_ex,
subb_im,cmpb_im,sbcb_im,addd_im,andb_im,bitb_im,ldb_im, stb_im,
eorb_im,adcb_im,orb_im, addb_im,ldd_im, std_im, ldx_im, stx_im,
subb_di,cmpb_di,sbcb_di,addd_di,andb_di,bitb_di,ldb_di, stb_di,
eorb_di,adcb_di,orb_di, addb_di,ldd_di, std_di, ldx_di, stx_di,
subb_ix,cmpb_ix,sbcb_ix,addd_ix,andb_ix,bitb_ix,ldb_ix, stb_ix,
eorb_ix,adcb_ix,orb_ix, addb_ix,ldd_ix, std_ix, ldx_ix, stx_ix,
subb_ex,cmpb_ex,sbcb_ex,addd_ex,andb_ex,bitb_ex,ldb_ex, stb_ex,
eorb_ex,adcb_ex,orb_ex, addb_ex,ldd_ex, std_ex, ldx_ex, stx_ex
};
#endif

#if (HAS_HD63701)
static void (*hd63701_insn[0x100])(void) = {
trap,   nop,    trap,   trap,   lsrd,   asld,   tap,    tpa,
inx,    dex,    clv,    sev,    clc,    sec,    cli,    sei,
sba,    cba,    undoc1, undoc2, trap,   trap,   tab,    tba,
xgdx,   daa,    slp,    aba,    trap,   trap,   trap,   trap,
bra,    brn,    bhi,    bls,    bcc,    bcs,    bne,    beq,
bvc,    bvs,    bpl,    bmi,    bge,    blt,    bgt,    ble,
tsx,    ins,    pula,   pulb,   des,    txs,    psha,   pshb,
pulx,   rts,    abx,    rti,    pshx,   mul,    wai,    swi,
nega,   trap,   trap,   coma,   lsra,   trap,   rora,   asra,
asla,   rola,   deca,   trap,   inca,   tsta,   trap,   clra,
negb,   trap,   trap,   comb,   lsrb,   trap,   rorb,   asrb,
aslb,   rolb,   decb,   trap,   incb,   tstb,   trap,   clrb,
neg_ix, aim_ix, oim_ix, com_ix, lsr_ix, eim_ix, ror_ix, asr_ix,
asl_ix, rol_ix, dec_ix, tim_ix, inc_ix, tst_ix, jmp_ix, clr_ix,
neg_ex, aim_di, oim_di, com_ex, lsr_ex, eim_di, ror_ex, asr_ex,
asl_ex, rol_ex, dec_ex, tim_di, inc_ex, tst_ex, jmp_ex, clr_ex,
suba_im,cmpa_im,sbca_im,subd_im,anda_im,bita_im,lda_im, sta_im,
eora_im,adca_im,ora_im, adda_im,cpx_im ,bsr,    lds_im, sts_im,
suba_di,cmpa_di,sbca_di,subd_di,anda_di,bita_di,lda_di, sta_di,
eora_di,adca_di,ora_di, adda_di,cpx_di ,jsr_di, lds_di, sts_di,
suba_ix,cmpa_ix,sbca_ix,subd_ix,anda_ix,bita_ix,lda_ix, sta_ix,
eora_ix,adca_ix,ora_ix, adda_ix,cpx_ix ,jsr_ix, lds_ix, sts_ix,
suba_ex,cmpa_ex,sbca_ex,subd_ex,anda_ex,bita_ex,lda_ex, sta_ex,
eora_ex,adca_ex,ora_ex, adda_ex,cpx_ex ,jsr_ex, lds_ex, sts_ex,
subb_im,cmpb_im,sbcb_im,addd_im,andb_im,bitb_im,ldb_im, stb_im,
eorb_im,adcb_im,orb_im, addb_im,ldd_im, std_im, ldx_im, stx_im,
subb_di,cmpb_di,sbcb_di,addd_di,andb_di,bitb_di,ldb_di, stb_di,
eorb_di,adcb_di,orb_di, addb_di,ldd_di, std_di, ldx_di, stx_di,
subb_ix,cmpb_ix,sbcb_ix,addd_ix,andb_ix,bitb_ix,ldb_ix, stb_ix,
eorb_ix,adcb_ix,orb_ix, addb_ix,ldd_ix, std_ix, ldx_ix, stx_ix,
subb_ex,cmpb_ex,sbcb_ex,addd_ex,andb_ex,bitb_ex,ldb_ex, stb_ex,
eorb_ex,adcb_ex,orb_ex, addb_ex,ldd_ex, std_ex, ldx_ex, stx_ex
};
#endif

#if (HAS_NSC8105)
static void (*nsc8105_insn[0x100])(void) = {
// 0
illegl1,illegl1,nop,    illegl1,illegl1,tap,    illegl1,tpa,
// 8
inx,    clv,    dex,    sev,    clc,    cli,    sec,    sei,
// 10
sba,    illegl1,cba,    illegl1,illegl1,tab,    illegl1,tba,
// 18
illegl1,illegl1,daa,    aba,    illegl1,illegl1,illegl1,illegl1,
// 20
bra,    bhi,    brn,    bls,    bcc,    bne,    bcs,    beq,
// 28
bvc,    bpl,    bvs,    bmi,    bge,    bgt,    blt,    ble,
// 30
tsx,    pula,   ins,    pulb,   des,    psha,   txs,    pshb,
// 38
illegl1,illegl1,rts,    rti,    illegl1,wai,    illegl1,swi,
// 40
suba_im,sbca_im,cmpa_im,illegl1,anda_im,lda_im, bita_im,sta_im,
// 48
eora_im,ora_im, adca_im,adda_im,cmpx_im,lds_im, bsr,    sts_im,
// 50
suba_di,sbca_di,cmpa_di,illegl1,anda_di,lda_di, bita_di,sta_di,
// 58
eora_di,ora_di, adca_di,adda_di,cmpx_di,lds_di, jsr_di, sts_di,
// 60
suba_ix,sbca_ix,cmpa_ix,illegl1,anda_ix,lda_ix, bita_ix,sta_ix,
// 68
eora_ix,ora_ix, adca_ix,adda_ix,cmpx_ix,lds_ix, jsr_ix, sts_ix,
// 70
suba_ex,sbca_ex,cmpa_ex,illegl1,anda_ex,lda_ex, bita_ex,sta_ex,
// 78
eora_ex,ora_ex, adca_ex,adda_ex,cmpx_ex,lds_ex, jsr_ex, sts_ex,
// 80
nega,   illegl1,illegl1,coma,   lsra,   rora,   illegl1,asra,
// 88
asla,   deca,   rola,   illegl1,inca,   illegl1,tsta,   clra,
// 90
negb,   illegl1,illegl1,comb,   lsrb,   rorb,   illegl1,asrb,
// 98
aslb,   decb,   rolb,   illegl1,incb,   illegl1,tstb,   clrb,
// a0
neg_ix, illegl1,illegl1,com_ix, lsr_ix, ror_ix, illegl1,asr_ix,
// a8
asl_ix, dec_ix, rol_ix, illegl1,inc_ix, jmp_ix, tst_ix, clr_ix,
// b0
neg_ex, illegl1,stx_nsc,com_ex, lsr_ex, ror_ex, illegl1,asr_ex,
// b8
asl_ex, dec_ex, rol_ex, btst_ix,inc_ex, jmp_ex, tst_ex, clr_ex,
subb_im,sbcb_im,cmpb_im,illegl1,andb_im,ldb_im, bitb_im,stb_im,
eorb_im,orb_im, adcb_im,addb_im,illegl1,ldx_im, illegl1,stx_im,
subb_di,sbcb_di,cmpb_di,illegl1,andb_di,ldb_di, bitb_di,stb_di,
eorb_di,orb_di, adcb_di,addb_di,illegl1,ldx_di, illegl1,stx_di,
subb_ix,sbcb_ix,cmpb_ix,illegl1,andb_ix,ldb_ix, bitb_ix,stb_ix,
eorb_ix,orb_ix, adcb_ix,addb_ix,adcx_im,ldx_ix, illegl1,stx_ix,
subb_ex,sbcb_ex,cmpb_ex,illegl1,andb_ex,ldb_ex, bitb_ex,stb_ex,
eorb_ex,orb_ex, adcb_ex,addb_ex,addx_ex,ldx_ex, illegl1,stx_ex
};
#endif
