/* mimic09 0.001 MC6809 Simulator by Vincente D'Ingianni, II (C)opyright October 1994 Mimic */ #include "register.h" void ten(), eleven(); void undefined() { PC++; } void ABX() { X += B.whole.byte; PC++; } void ANDA_IMMEDIATE() { A.whole.byte &= memoire[++PC]; CC.bit.V = 0; /* V: Cleared */ CC.bit.Z = (A.whole.byte == 0); /* Z: Set IFF all bits of the result are clear. */ CC.bit.N = A.bits.bit7; /* N: Set IFF bit 7 of the result is Set. */ PC++; } void ANDB_IMMEDIATE() { B.whole.byte &= memoire[++PC]; CC.bit.V = 0; /* V: Cleared */ CC.bit.Z = (B.whole.byte == 0); /* Z: Set IFF all bits of the result are clear. */ CC.bit.N = B.bits.bit7; /* N: Set IFF bit 7 of the result is Set. */ PC++; } void ANDCC() { CC.byte &= memoire[++PC]; PC++; } void ASLA() { CC.bit.V = A.bits.bit7 ^ A.bits.bit6; /* V: bit7 Exclusive OR bit6 of original operand. */ CC.bit.C = A.bits.bit7; /* C: bit7 of original operand. */ A.whole.byte <<= 1; /* Shift LEFT one bit. */ CC.bit.Z = (A.whole.byte == 0); /* Z: Set IFF all bits of the result are clear. */ CC.bit.N = A.bits.bit7; /* N: Set IFF bit 7 of the result is Set. */ PC++; } void ASLB() { CC.bit.V = B.bits.bit7 ^ B.bits.bit6; /* V: bit7 Exclusive OR bit6 of original operand. */ CC.bit.C = B.bits.bit7; /* C: bit7 of original operand. */ B.whole.byte <<= 1; /* Shift LEFT one bit. */ CC.bit.Z = (B.whole.byte == 0); /* Z: Set IFF all bits of the result are clear. */ CC.bit.N = B.bits.bit7; /* N: Set IFF bit 7 of the result is Set. */ PC++; } void ASRA() { CC.bit.N = A.bits.bit7; /* N: STORE bit7 of original operand. */ CC.bit.C = A.bits.bit0; /* C: bit0 of original operand. */ A.whole.byte >>= 1; /* Shift RIGHT one bit. */ A.bits.bit7 = CC.bit.N; /* N: RESTORE bit7 from original operand. */ CC.bit.Z = (A.whole.byte == 0); /* Z: Set IFF all bits of the result are clear. */ PC++; } void ASRB() { CC.bit.N = B.bits.bit7; /* N: STORE bit7 of original operand. */ CC.bit.C = B.bits.bit0; /* C: bit0 of original operand. */ B.whole.byte >>= 1; /* Shift RIGHT one bit. */ B.bits.bit7 = CC.bit.N; /* N: RESTORE bit7 from original operand. */ CC.bit.Z = (B.whole.byte == 0); /* Z: Set IFF all bits of the result are clear. */ PC++; } void BITA_IMMEDIATE() { unsigned char tmp = A.whole.byte & memoire[++PC]; CC.bit.V = 0; /* V: Cleared */ CC.bit.Z = (tmp == 0); /* Z: Set IFF all bits of the result are clear. */ CC.bit.N = (tmp & 0x80); /* N: Set IFF bit 7 of the result is Set. */ PC++; } void BITB_IMMEDIATE() { unsigned char tmp = B.whole.byte & memoire[++PC]; CC.bit.V = 0; /* V: Cleared */ CC.bit.Z = (tmp == 0); /* Z: Set IFF all bits of the result are clear. */ CC.bit.N = (tmp & 0x80); /* N: Set IFF bit 7 of the result is Set. */ PC++; } void BCC() { PC += 2; if (CC.bit.C == 0) { PC += (signed char) memoire[PC-1]; } } void BCS() { PC += 2; if (CC.bit.C) { PC += (signed char) memoire[PC-1]; } } void BEQ() { PC += 2; if (CC.bit.Z) { PC += (signed char) memoire[PC-1]; } } void BGE() { PC += 2; if (((CC.bit.N ^ CC.bit.V)) == 0) { PC += (signed char) memoire[PC-1]; } } void BGT() { PC += 2; if ((CC.bit.Z | (CC.bit.N ^ CC.bit.V)) == 0) { PC += (signed char) memoire[PC-1]; } } void BHI() { PC += 2; if ((CC.bit.C | CC.bit.V) == 0) { PC += (signed char) memoire[PC-1]; } } void BLE() { PC += 2; if ((CC.bit.Z | (CC.bit.N ^ CC.bit.V)) == 0) { PC += (signed char) memoire[PC-1]; } } void BLS() { PC += 2; if ((CC.bit.C | CC.bit.Z) == 1) { PC += (signed char) memoire[PC-1]; } } void BLT() { PC += 2; if ((CC.bit.N ^ CC.bit.V) == 1) { PC += (signed char) memoire[PC-1]; } } void BMI() { PC += 2; if (CC.bit.N) { PC += (signed char) memoire[PC-1]; } } void BNE() { PC += 2; if (CC.bit.Z == 0) { PC += (signed char) memoire[PC-1]; } } void BPL() { PC += 2; if (CC.bit.N == 0) { PC += (signed char) memoire[PC-1]; } } void BRA() { PC += 2; PC += (signed char) memoire[PC-1]; } void BRN() { PC += 2; } void BVC() { PC += 2; if (CC.bit.V == 0) { PC += (signed char) memoire[PC-1]; } } void BVS() { PC += 2; if (CC.bit.V) { PC += (signed char) memoire[PC-1]; } } void CLRA() { A.all = 0; CC.byte = (CC.byte & 0xF0) | 0x04; PC++; } void CLRB() { B.all = 0; CC.byte = (CC.byte & 0xF0) | 0x04; PC++; } void COMA() { A.whole.byte = ~A.whole.byte; /* Perform One's Compliment */ CC.bit.C = 1; /* C: Set */ CC.bit.V = 0; /* V: Cleared */ CC.bit.Z = (A.whole.byte == 0); /* Z: Set IFF all bits of the result are clear. */ CC.bit.N = A.bits.bit7; /* N: Set IFF bit 7 of the result is Set. */ PC++; } void COMB() { B.whole.byte = ~B.whole.byte; /* Perform One's Compliment */ CC.bit.C = 1; /* C: Set */ CC.bit.V = 0; /* V: Cleared */ CC.bit.Z = (B.whole.byte == 0); /* Z: Set IFF all bits of the result are clear. */ CC.bit.N = B.bits.bit7; /* N: Set IFF bit 7 of the result is Set. */ PC++; } void EORA_IMMEDIATE() { A.whole.byte ^= memoire[++PC]; CC.bit.V = 0; /* V: Cleared */ CC.bit.Z = (A.whole.byte == 0); /* Z: Set IFF all bits of the result are clear. */ CC.bit.N = A.bits.bit7; /* N: Set IFF bit 7 of the result is Set. */ PC++; } void EORB_IMMEDIATE() { B.whole.byte ^= memoire[++PC]; CC.bit.V = 0; /* V: Cleared */ CC.bit.Z = (B.whole.byte == 0); /* Z: Set IFF all bits of the result are clear. */ CC.bit.N = B.bits.bit7; /* N: Set IFF bit 7 of the result is Set. */ PC++; } void INCA() { CC.bit.V = (A.whole.byte == 0x7F); /* V: Set IFF the original operand was %011111111 */ CC.bit.Z = (++A.whole.byte == 0); /* Z: Set IFF all bits of the result are clear. */ CC.bit.N = A.bits.bit7; /* N: Set IFF bit 7 of the result is Set. */ PC++; } void INCB() { CC.bit.V = (B.whole.byte == 0x7F); /* V: Set IFF the original operand was %011111111 */ CC.bit.Z = (++B.whole.byte == 0); /* Z: Set IFF all bits of the result are clear. */ CC.bit.N = B.bits.bit7; /* N: Set IFF bit 7 of the result is Set. */ PC++; } void JMP() { PC = memoire[PC+1] * 256 + memoire[PC+2]; } void LBCC() { PC += 4; if (CC.bit.C == 0) { PC += memoire[PC-2] * 256 + memoire[PC-1]; } } void LBCS() { PC += 4; if (CC.bit.C) { PC += memoire[PC-2] * 256 + memoire[PC-1]; } } void LBEQ() { PC += 4; if (CC.bit.Z) { PC += memoire[PC-2] * 256 + memoire[PC-1]; } } void LBGE() { PC += 4; if ((CC.bit.N ^ CC.bit.V) == 0) { PC += memoire[PC-2] * 256 + memoire[PC-1]; } } void LBGT() { PC += 4; if ((CC.bit.Z | (CC.bit.N ^ CC.bit.V)) == 0) { PC += memoire[PC-2] * 256 + memoire[PC-1]; } } void LBHI() { PC += 4; if ((CC.bit.C | CC.bit.V) == 0) { PC += memoire[PC-2] * 256 + memoire[PC-1]; } } void LBLE() { PC += 4; if ((CC.bit.Z | (CC.bit.N ^ CC.bit.V)) == 0) { PC += memoire[PC-2] * 256 + memoire[PC-1]; } } void LBLS() { PC += 4; if ((CC.bit.C | CC.bit.Z) == 1) { PC += memoire[PC-2] * 256 + memoire[PC-1]; } } void LBLT() { PC += 4; if ((CC.bit.N ^ CC.bit.V) == 1) { PC += memoire[PC-2] * 256 + memoire[PC-1]; } } void LBMI() { PC += 4; if (CC.bit.N) { PC += memoire[PC-2] * 256 + memoire[PC-1]; } } void LBNE() { PC += 4; if (CC.bit.Z == 0) { PC += memoire[PC-2] * 256 + memoire[PC-1]; } } void LBPL() { PC += 4; if (CC.bit.N == 0) { PC += memoire[PC-2] * 256 + memoire[PC-1]; } } void LBRA() { PC += 4; PC += memoire[PC-2] * 256 + memoire[PC-1]; } void LBRN() { PC += 4; } void LBVC() { PC += 4; if (CC.bit.V == 0) { PC += memoire[PC-2] * 256 + memoire[PC-1]; } } void LBVS() { PC += 4; if (CC.bit.V) { PC += memoire[PC-2] * 256 + memoire[PC-1]; } } void LDA_IMMEDIATE() { A.whole.byte = memoire[++PC]; CC.bit.V = 0; /* V: Cleared */ CC.bit.Z = (A.whole.byte == 0); /* Z: Set IFF all bits of the result are clear. */ CC.bit.N = A.bits.bit7; /* N: Set IFF bit 7 of the result is Set. */ PC++; } void LDB_IMMEDIATE() { B.whole.byte = memoire[++PC]; CC.bit.V = 0; /* V: Cleared */ CC.bit.Z = (B.whole.byte == 0); /* Z: Set IFF all bits of the result are clear. */ CC.bit.N = B.bits.bit7; /* N: Set IFF bit 7 of the result is Set. */ PC++; } void LDD_IMMEDIATE() { A.whole.byte = memoire[++PC]; B.whole.byte = memoire[++PC]; CC.bit.V = 0; /* V: Cleared */ /* Z: Set IFF all bits of the result are clear. */ CC.bit.Z = (A.whole.byte == 0) && (B.whole.byte == 0); CC.bit.N = A.bits.bit7; /* N: Set IFF bit 7 of the result is Set. */ PC++; } void LDS_IMMEDIATE() { S = memoire[++PC] * 256 + memoire[++PC]; CC.bit.V = 0; /* V: Cleared */ CC.bit.Z = (S == 0); /* Z: Set IFF all bits of the result are clear. */ CC.bit.N = (S & 0x8000); /* N: Set IFF bit 7 of the result is Set. */ PC++; } void LDU_IMMEDIATE() { U = memoire[++PC] * 256 + memoire[++PC]; CC.bit.V = 0; /* V: Cleared */ CC.bit.Z = (U == 0); /* Z: Set IFF all bits of the result are clear. */ CC.bit.N = (U & 0x8000); /* N: Set IFF bit 7 of the result is Set. */ PC++; } void LDX_IMMEDIATE() { X = memoire[++PC] * 256 + memoire[++PC]; CC.bit.V = 0; /* V: Cleared */ CC.bit.Z = (X == 0); /* Z: Set IFF all bits of the result are clear. */ CC.bit.N = (X & 0x8000); /* N: Set IFF bit 7 of the result is Set. */ PC++; } void LDY_IMMEDIATE() { Y = memoire[++PC] * 256 + memoire[++PC]; CC.bit.V = 0; /* V: Cleared */ CC.bit.Z = (Y == 0); /* Z: Set IFF all bits of the result are clear. */ CC.bit.N = (Y & 0x8000); /* N: Set IFF bit 7 of the result is Set. */ PC++; } void LSRA() { CC.bit.N = 0; /* N: Cleared. */ CC.bit.C = A.bits.bit0; /* C: bit0 of original operand. */ A.whole.byte >>= 1; /* Shift RIGHT one bit. */ A.bits.bit7 = 0; /* Make sure bit7 is clear. */ CC.bit.Z = (A.whole.byte == 0); /* Z: Set IFF all bits of the result are clear. */ PC++; } void LSRB() { CC.bit.N = 0; /* N: Cleared. */ CC.bit.C = B.bits.bit0; /* C: bit0 of original operand. */ B.whole.byte >>= 1; /* Shift RIGHT one bit. */ B.bits.bit7 = 0; /* Make sure bit7 is clear. */ CC.bit.Z = (B.whole.byte == 0); /* Z: Set IFF all bits of the result are clear. */ PC++; } void MUL() /* D <- A * B */ { B.all = A.whole.byte * B.whole.byte; A.whole.byte = B.whole.padding; CC.bit.C = B.bits.bit7; /* C: Set IFF B bit7 of result is set. */ CC.bit.Z = (B.all == 0); /* Z: Set IFF all bits of the result are clear. */ PC++; } void NEGA() { CC.bit.V = (A.whole.byte == 0x80); /* V: Set IFF original operand was $80 */ CC.bit.C = (A.whole.byte == 0); /* C: Set IFF original operand was 0 */ A.whole.byte = ~A.whole.byte + 1; /* Perform Twos's Compliment */ CC.bit.Z = (A.whole.byte == 0); /* Z: Set IFF all bits of the result are clear. */ CC.bit.N = A.bits.bit7; /* N: Set IFF bit 7 of the result is Set. */ PC++; } void NEGB() { CC.bit.V = (B.whole.byte == 0x80); /* V: Set IFF original operand was $80 */ CC.bit.C = (B.whole.byte == 0); /* C: Set IFF original operand was 0 */ B.whole.byte = ~B.whole.byte + 1; /* Perform Twos's Compliment */ CC.bit.Z = (B.whole.byte == 0); /* Z: Set IFF all bits of the result are clear. */ CC.bit.N = B.bits.bit7; /* N: Set IFF bit 7 of the result is Set. */ PC++; } void NOP() { PC++; } void ORA_IMMEDIATE() { A.whole.byte |= memoire[++PC]; CC.bit.V = 0; /* V: Cleared */ CC.bit.Z = (A.whole.byte == 0); /* Z: Set IFF all bits of the result are clear. */ CC.bit.N = A.bits.bit7; /* N: Set IFF bit 7 of the result is Set. */ PC++; } void ORB_IMMEDIATE() { B.whole.byte |= memoire[++PC]; CC.bit.V = 0; /* V: Cleared */ CC.bit.Z = (B.whole.byte == 0); /* Z: Set IFF all bits of the result are clear. */ CC.bit.N = B.bits.bit7; /* N: Set IFF bit 7 of the result is Set. */ PC++; } void ORCC() { CC.byte |= memoire[++PC]; PC++; } void ROLA() /* Rotate Left */ { CC.bit.V = A.bits.bit7 ^ A.bits.bit6; /* V: bit7 Exclusive OR bit6 of original operand. */ CC.bit.C = A.bits.bit7; /* C: bit7 of original operand. */ A.whole.byte <<= 1; /* Shift RIGHT one bit. */ A.bits.bit0 = CC.bit.C; /* RESTORE bit0 from Carry bit. */ CC.bit.N = A.bits.bit7; /* N: Set IFF bit 7 of the result is Set. */ CC.bit.Z = (A.whole.byte == 0); /* Z: Set IFF all bits of the result are clear. */ PC++; } void ROLB() /* Rotate Left */ { CC.bit.V = B.bits.bit7 ^ B.bits.bit6; /* V: bit7 Exclusive OR bit6 of original operand. */ CC.bit.C = B.bits.bit7; /* C: bit7 of original operand. */ B.whole.byte <<= 1; /* Shift RIGHT one bit. */ B.bits.bit0 = CC.bit.C; /* RESTORE bit0 from Carry bit. */ CC.bit.N = B.bits.bit7; /* N: Set IFF bit 7 of the result is Set. */ CC.bit.Z = (B.whole.byte == 0); /* Z: Set IFF all bits of the result are clear. */ PC++; } void RORA() /* Rotate Right */ { CC.bit.C = A.bits.bit0; /* C: bit0 of original operand. */ A.whole.byte >>= 1; /* Shift RIGHT one bit. */ A.bits.bit7 = CC.bit.C; /* RESTORE bit7 from Carry bit. */ CC.bit.N = A.bits.bit7; /* N: Set IFF bit 7 of the result is Set. */ CC.bit.Z = (A.whole.byte == 0); /* Z: Set IFF all bits of the result are clear. */ PC++; } void RORB() /* Rotate Right */ { CC.bit.C = B.bits.bit0; /* C: bit0 of original operand. */ B.whole.byte >>= 1; /* Shift RIGHT one bit. */ B.bits.bit7 = CC.bit.C; /* RESTORE bit7 from Carry bit. */ CC.bit.N = B.bits.bit7; /* N: Set IFF bit 7 of the result is Set. */ CC.bit.Z = (B.whole.byte == 0); /* Z: Set IFF all bits of the result are clear. */ PC++; } void SEX() /* Sign Extend */ { /* If bit 7 of B is set then A <- $FF else A <- 00 */ if (B.bits.bit7) { A.whole.byte = 0xFF; } else { A.whole.byte = 0; } CC.bit.Z = (A.whole.byte == 0) && (B.whole.byte == 0); /* Z: Set IFF all bits of the result are clear. */ CC.bit.N = A.bits.bit7; /* N: Set IFF bit 7 of the result is Set. */ PC++; } void TSTA() { CC.bit.V = 0; /* V: Cleared */ CC.bit.Z = (A.whole.byte == 0); /* Z: Set IFF all bits of the result are clear. */ CC.bit.N = A.bits.bit7; /* N: Set IFF bit 7 of the result is Set. */ PC++; } void TSTB() { CC.bit.V = 0; /* V: Cleared */ CC.bit.Z = (B.whole.byte == 0); /* Z: Set IFF all bits of the result are clear. */ CC.bit.N = B.bits.bit7; /* N: Set IFF bit 7 of the result is Set. */ PC++; } void (*instruction[256])() = { /* $00 "NEG " */ &undefined, /* $01 "??? " */ &undefined, /* $02 "??? " */ &undefined, /* $03 "COM " */ &undefined, /* $04 "LSR " */ &undefined, /* $05 "??? " */ &undefined, /* $06 "ROR " */ &undefined, /* $07 "ASR " */ &undefined, /* $08 "LSL " */ &undefined, /* $09 "ROL " */ &undefined, /* $0A "DEC " */ &undefined, /* $0B "??? " */ &undefined, /* $0C "INC " */ &undefined, /* $0D "TST " */ &undefined, /* $0E "JMP " */ &undefined, /* $0F "CLR " */ &undefined, /* $10 "10 " */ &ten, /* $11 "11 " */ &eleven, /* $12 "NOP " */ &NOP, /* $13 "SYNC " */ &undefined, /* $14 "??? " */ &undefined, /* $15 "??? " */ &undefined, /* $16 "LBRA " */ &LBRA, /* $17 "LBSR " */ &undefined, /* $18 "??? " */ &undefined, /* $19 "DAA " */ &undefined, /* $1A "ORCC " */ &undefined, /* $1B "??? " */ &undefined, /* $1C "ANDCC" */ &ANDCC, /* $1D "SEX " */ &SEX, /* $1E "EXG " */ &undefined, /* $1F "TFR " */ &undefined, /* $20 "BRA " */ &BRA, /* $21 "BRN " */ &BRN, /* $22 "BHI " */ &BHI, /* $23 "BLS " */ &BLS, /* $24 "BCC " */ &BCC, /* $25 "BCS " */ &BCS, /* $26 "BNE " */ &BNE, /* $27 "BEQ " */ &BEQ, /* $28 "BVC " */ &BVC, /* $29 "BVS " */ &BVS, /* $2A "BPL " */ &BPL, /* $2B "BMI " */ &BMI, /* $2C "BGE " */ &BGE, /* $2D "BLT " */ &BLT, /* $2E "BGT " */ &BGT, /* $2F "BLE " */ &BLE, /* $30 "LEAX " */ &undefined, /* $31 "LEAY " */ &undefined, /* $32 "LEAS " */ &undefined, /* $33 "LEAU " */ &undefined, /* $34 "PSHS " */ &undefined, /* $35 "PULS " */ &undefined, /* $36 "PSHU " */ &undefined, /* $37 "PULU " */ &undefined, /* $38 "??? " */ &undefined, /* $39 "RTS " */ &undefined, /* $3A "ABX " */ &ABX, /* $3B "RTO " */ &undefined, /* $3C "CWAI " */ &undefined, /* $3D "MUL " */ &MUL, /* $3E "??? " */ &undefined, /* $3F "SWI " */ &undefined, /* $40 "NEGA " */ &NEGA, /* $41 "??? " */ &undefined, /* $42 "??? " */ &undefined, /* $43 "COMA " */ &COMA, /* $44 "LSRA " */ &LSRA, /* $45 "??? " */ &undefined, /* $46 "RORA " */ &RORA, /* $47 "ASRA " */ &ASRA, /* $48 "LSLA " */ &ASLA, /* $49 "ROLA " */ &ROLA, /* $4A "DECA " */ &undefined, /* $4B "??? " */ &undefined, /* $4C "INCA " */ &INCA, /* $4D "TSTA " */ &TSTA, /* $4E "??? " */ &undefined, /* $4F "CLRA " */ &CLRA, /* $50 "NEGB " */ &NEGB, /* $51 "??? " */ &undefined, /* $52 "??? " */ &undefined, /* $53 "COMB " */ &COMB, /* $54 "LSRB " */ &LSRB, /* $55 "??? " */ &undefined, /* $56 "RORB " */ &RORB, /* $57 "ASRB " */ &ASRB, /* $58 "LSLB " */ &ASLA, /* $59 "ROLB " */ &ROLB, /* $5A "DECB " */ &undefined, /* $5B "??? " */ &undefined, /* $5C "INCB " */ &INCB, /* $5D "TSTB " */ &TSTB, /* $5E "??? " */ &undefined, /* $5F "CLRB " */ &CLRB, /* $60 "NEG " */ &undefined, /* $61 "??? " */ &undefined, /* $62 "??? " */ &undefined, /* $63 "COM " */ &undefined, /* $64 "LSR " */ &undefined, /* $65 "??? " */ &undefined, /* $66 "ROR " */ &undefined, /* $67 "ASR " */ &undefined, /* $68 "LSL " */ &undefined, /* $69 "ROL " */ &undefined, /* $6A "DEC " */ &undefined, /* $6B "??? " */ &undefined, /* $6C "INC " */ &undefined, /* $6D "TST " */ &undefined, /* $6E "JMP " */ &undefined, /* $6F "CLR " */ &undefined, /* $70 "NEG " */ &undefined, /* $71 "??? " */ &undefined, /* $72 "??? " */ &undefined, /* $73 "COM " */ &undefined, /* $74 "LSR " */ &undefined, /* $75 "??? " */ &undefined, /* $76 "ROR " */ &undefined, /* $77 "ASR " */ &undefined, /* $78 "LSL " */ &undefined, /* $79 "ROL " */ &undefined, /* $7A "DEC " */ &undefined, /* $7B "??? " */ &undefined, /* $7C "INC " */ &undefined, /* $7D "TST " */ &undefined, /* $7E "JMP " */ &undefined, /* $7F "CLR " */ &undefined, /* $80 "SUBA " */ &undefined, /* $81 "CMPA " */ &undefined, /* $82 "SBCA " */ &undefined, /* $83 "SUBD " */ &undefined, /* $84 "ANDA " */ &ANDA_IMMEDIATE, /* $85 "BITA " */ &BITA_IMMEDIATE, /* $86 "LDA " */ &LDA_IMMEDIATE, /* $87 "??? " */ &undefined, /* $88 "EORA " */ &EORA_IMMEDIATE, /* $89 "ADCA " */ &undefined, /* $8A "ORA " */ &ORA_IMMEDIATE, /* $8B "ADDA " */ &undefined, /* $8C "CMPX " */ &undefined, /* $8D "BSR " */ &undefined, /* $8E "LDX " */ &LDX_IMMEDIATE, /* $8F "??? " */ &undefined, /* $90 "SUBA " */ &undefined, /* $91 "CMPA " */ &undefined, /* $92 "SBCA " */ &undefined, /* $93 "SUBD " */ &undefined, /* $94 "ANDA " */ &undefined, /* $95 "BITA " */ &undefined, /* $96 "LDA " */ &undefined, /* $97 "STA " */ &undefined, /* $98 "EORA " */ &undefined, /* $99 "ADCA " */ &undefined, /* $9A "ORA " */ &undefined, /* $9B "ADDA " */ &undefined, /* $9C "CMPX " */ &undefined, /* $9D "JSR " */ &undefined, /* $9E "LDX " */ &undefined, /* $9F "STX " */ &undefined, /* $A0 "SUBA " */ &undefined, /* $A1 "CMPA " */ &undefined, /* $A2 "SBCA " */ &undefined, /* $A3 "SUBD " */ &undefined, /* $A4 "ANDA " */ &undefined, /* $A5 "BITA " */ &undefined, /* $A6 "LDA " */ &undefined, /* $A7 "STA " */ &undefined, /* $A8 "EORA " */ &undefined, /* $A9 "ADCA " */ &undefined, /* $AA "ORA " */ &undefined, /* $AB "ADDA " */ &undefined, /* $AC "CMPX " */ &undefined, /* $AD "JSR " */ &undefined, /* $AE "LDX " */ &undefined, /* $AF "STX " */ &undefined, /* $B0 "SUBA " */ &undefined, /* $B1 "CMPA " */ &undefined, /* $B2 "SBCA " */ &undefined, /* $B3 "SUBD " */ &undefined, /* $B4 "ANDA " */ &undefined, /* $B5 "BITA " */ &undefined, /* $B6 "LDA " */ &undefined, /* $B7 "STA " */ &undefined, /* $B8 "EORA " */ &undefined, /* $B9 "ADCA " */ &undefined, /* $BA "ORA " */ &undefined, /* $BB "ADDA " */ &undefined, /* $BC "CMPX " */ &undefined, /* $BD "JSR " */ &undefined, /* $BE "LDX " */ &undefined, /* $BF "STX " */ &undefined, /* $C0 "SUBB " */ &undefined, /* $C1 "CMPB " */ &undefined, /* $C2 "SBCB " */ &undefined, /* $C3 "ADDD " */ &undefined, /* $C4 "ANDB " */ &ANDB_IMMEDIATE, /* $C5 "BITB " */ &BITB_IMMEDIATE, /* $C6 "LDB " */ &LDB_IMMEDIATE, /* $C7 "??? " */ &undefined, /* $C8 "EORB " */ &EORB_IMMEDIATE, /* $C9 "ADCB " */ &undefined, /* $CA "ORB " */ &ORB_IMMEDIATE, /* $CB "ADDB " */ &undefined, /* $CC "LDD " */ &LDD_IMMEDIATE, /* $CD "??? " */ &undefined, /* $CE "LDU " */ &LDU_IMMEDIATE, /* $CF "??? " */ &undefined, /* $D0 "SUBB " */ &undefined, /* $D1 "CMPB " */ &undefined, /* $D2 "SBCB " */ &undefined, /* $D3 "ADDD " */ &undefined, /* $D4 "ANDB " */ &undefined, /* $D5 "BITB " */ &undefined, /* $D6 "LDB " */ &undefined, /* $D7 "STB " */ &undefined, /* $D8 "EORB " */ &undefined, /* $D9 "ADCB " */ &undefined, /* $DA "ORB " */ &undefined, /* $DB "ADDB " */ &undefined, /* $DC "LDD " */ &undefined, /* $DD "STD " */ &undefined, /* $DE "LDU " */ &undefined, /* $DF "STU " */ &undefined, /* $E0 "SUBB " */ &undefined, /* $E1 "CMPB " */ &undefined, /* $E2 "SBCB " */ &undefined, /* $E3 "ADDD " */ &undefined, /* $E4 "ANDB " */ &undefined, /* $E5 "BITB " */ &undefined, /* $E6 "LDB " */ &undefined, /* $E7 "STB " */ &undefined, /* $E8 "EORB " */ &undefined, /* $E9 "ADCB " */ &undefined, /* $EA "ORB " */ &undefined, /* $EB "ADDB " */ &undefined, /* $EC "LDD " */ &undefined, /* $ED "STD " */ &undefined, /* $EE "LDU " */ &undefined, /* $EF "STU " */ &undefined, /* $F0 "SUBB " */ &undefined, /* $F1 "CMPB " */ &undefined, /* $F2 "SBCB " */ &undefined, /* $F3 "ADDD " */ &undefined, /* $F4 "ANDB " */ &undefined, /* $F5 "BITB " */ &undefined, /* $F6 "LDB " */ &undefined, /* $F7 "STB " */ &undefined, /* $F8 "EORB " */ &undefined, /* $F9 "ADCB " */ &undefined, /* $FA "ORB " */ &undefined, /* $FB "ADDB " */ &undefined, /* $FC "LDD " */ &undefined, /* $FD "STD " */ &undefined, /* $FE "LDU " */ &undefined, /* $FF "STU " */ &undefined }; void (*instruction_10[41])() = { /* $1020 "??? " */ &undefined, /* $1021 "LBRN " */ &LBRN, /* $1022 "LBHI " */ &LBHI, /* $1023 "LBLS " */ &LBLS, /* $1024 "LBCC " */ &LBCC, /* $1025 "LBCS " */ &LBCS, /* $1026 "LBNE " */ &LBNE, /* $1027 "LBEQ " */ &LBEQ, /* $1028 "LBVC " */ &LBVC, /* $1029 "LBVS " */ &LBVS, /* $102A "LBPL " */ &LBPL, /* $102B "LBMI " */ &LBMI, /* $102C "LBGE " */ &LBGE, /* $102D "LBLT " */ &LBLT, /* $102E "LBGT " */ &LBGT, /* $102F "LBLE " */ &LBLE, /* $103F "SWI2 " */ &undefined, /* $1083 "CMPD " */ &undefined, /* $108C "CMPY " */ &undefined, /* $108E "LDY " */ &LDY_IMMEDIATE, /* $1093 "CMPD " */ &undefined, /* $109C "CMPY " */ &undefined, /* $109E "LDY " */ &undefined, /* $109F "STY " */ &undefined, /* $10A3 "CMPD " */ &undefined, /* $10AC "CMPY " */ &undefined, /* $10AE "LDY " */ &undefined, /* $10AF "STY " */ &undefined, /* $10B3 "CMPD " */ &undefined, /* $10BC "CMPY " */ &undefined, /* $10BE "LDY " */ &undefined, /* $10BF "STY " */ &undefined, /* $10CE "LDS " */ &LDS_IMMEDIATE, /* $10DE "LDS " */ &undefined, /* $10DF "STS " */ &undefined, /* $10EE "LDS " */ &undefined, /* $10EF "STS " */ &undefined, /* $10FE "LDS " */ &undefined, /* $10FF "STS " */ &undefined }; void (*instruction_11[8])() = { /* $1183 "CMPU " */ &undefined, /* $118C "CMPS " */ &undefined, /* $1193 "CMPU " */ &undefined, /* $119C "CMPS " */ &undefined, /* $11A3 "CMPU " */ &undefined, /* $11AC "CMPS " */ &undefined, /* $11B3 "CMPU " */ &undefined, /* $11BC "CMPS " */ &undefined }; void ten() { ++PC; } void eleven() { ++PC; }