Main Page | Class Hierarchy | Compound List | File List | Compound Members | File Members | Related Pages

CPU_common.cpp

Go to the documentation of this file.
00001 /*
00002  *  CPU_common.cpp - Definitions common to 6502/6510 SC emulation
00003  *
00004  *  Frodo (C) 1994-1997 Christian Bauer
00005  */
00006 
00007 #include "sysdeps.h"
00008 
00009 #include "CPU_common.h"
00010 
00011 
00012 // Addressing mode for each opcode (first part of execution) (Frodo SC)
00013 const uint8 ModeTab[256] = {
00014         O_BRK,  A_INDX, 1,              M_INDX, A_ZERO, A_ZERO, M_ZERO, M_ZERO, // 00
00015         O_PHP,  O_ORA_I,O_ASL_A,O_ANC_I,A_ABS,  A_ABS,  M_ABS,  M_ABS,
00016         O_BPL,  AE_INDY,1,              M_INDY, A_ZEROX,A_ZEROX,M_ZEROX,M_ZEROX,// 10
00017         O_CLC,  AE_ABSY,O_NOP,  M_ABSY, AE_ABSX,AE_ABSX,M_ABSX, M_ABSX,
00018         O_JSR,  A_INDX, 1,              M_INDX, A_ZERO, A_ZERO, M_ZERO, M_ZERO, // 20
00019         O_PLP,  O_AND_I,O_ROL_A,O_ANC_I,A_ABS,  A_ABS,  M_ABS,  M_ABS,
00020         O_BMI,  AE_INDY,1,              M_INDY, A_ZEROX,A_ZEROX,M_ZEROX,M_ZEROX,// 30
00021         O_SEC,  AE_ABSY,O_NOP,  M_ABSY, AE_ABSX,AE_ABSX,M_ABSX, M_ABSX,
00022         O_RTI,  A_INDX, 1,              M_INDX, A_ZERO, A_ZERO, M_ZERO, M_ZERO, // 40
00023         O_PHA,  O_EOR_I,O_LSR_A,O_ASR_I,O_JMP,  A_ABS,  M_ABS,  M_ABS,
00024         O_BVC,  AE_INDY,1,              M_INDY, A_ZEROX,A_ZEROX,M_ZEROX,M_ZEROX,// 50
00025         O_CLI,  AE_ABSY,O_NOP,  M_ABSY, AE_ABSX,AE_ABSX,M_ABSX, M_ABSX,
00026         O_RTS,  A_INDX, 1,              M_INDX, A_ZERO, A_ZERO, M_ZERO, M_ZERO, // 60
00027         O_PLA,  O_ADC_I,O_ROR_A,O_ARR_I,A_ABS,  A_ABS,  M_ABS,  M_ABS,
00028         O_BVS,  AE_INDY,1,              M_INDY, A_ZEROX,A_ZEROX,M_ZEROX,M_ZEROX,// 70
00029         O_SEI,  AE_ABSY,O_NOP,  M_ABSY, AE_ABSX,AE_ABSX,M_ABSX, M_ABSX,
00030         O_NOP_I,A_INDX, O_NOP_I,A_INDX, A_ZERO, A_ZERO, A_ZERO, A_ZERO, // 80
00031         O_DEY,  O_NOP_I,O_TXA,  O_ANE_I,A_ABS,  A_ABS,  A_ABS,  A_ABS,
00032         O_BCC,  A_INDY, 1,              A_INDY, A_ZEROX,A_ZEROX,A_ZEROY,A_ZEROY,// 90
00033         O_TYA,  A_ABSY, O_TXS,  A_ABSY, A_ABSX, A_ABSX, A_ABSY, A_ABSY,
00034         O_LDY_I,A_INDX, O_LDX_I,A_INDX, A_ZERO, A_ZERO, A_ZERO, A_ZERO, // a0
00035         O_TAY,  O_LDA_I,O_TAX,  O_LXA_I,A_ABS,  A_ABS,  A_ABS,  A_ABS,
00036         O_BCS,  AE_INDY,1,              AE_INDY,A_ZEROX,A_ZEROX,A_ZEROY,A_ZEROY,// b0
00037         O_CLV,  AE_ABSY,O_TSX,  AE_ABSY,AE_ABSX,AE_ABSX,AE_ABSY,AE_ABSY,
00038         O_CPY_I,A_INDX, O_NOP_I,M_INDX, A_ZERO, A_ZERO, M_ZERO, M_ZERO, // c0
00039         O_INY,  O_CMP_I,O_DEX,  O_SBX_I,A_ABS,  A_ABS,  M_ABS,  M_ABS,
00040         O_BNE,  AE_INDY,1,              M_INDY, A_ZEROX,A_ZEROX,M_ZEROX,M_ZEROX,// d0
00041         O_CLD,  AE_ABSY,O_NOP,  M_ABSY, AE_ABSX,AE_ABSX,M_ABSX, M_ABSX,
00042         O_CPX_I,A_INDX, O_NOP_I,M_INDX, A_ZERO, A_ZERO, M_ZERO, M_ZERO, // e0
00043         O_INX,  O_SBC_I,O_NOP,  O_SBC_I,A_ABS,  A_ABS,  M_ABS,  M_ABS,
00044         O_BEQ,  AE_INDY,O_EXT,  M_INDY, A_ZEROX,A_ZEROX,M_ZEROX,M_ZEROX,// f0
00045         O_SED,  AE_ABSY,O_NOP,  M_ABSY, AE_ABSX,AE_ABSX,M_ABSX, M_ABSX
00046 };
00047 
00048 
00049 // Operation for each opcode (second part of execution) (Frodo SC)
00050 const uint8 OpTab[256] = {
00051         1,              O_ORA,  1,              O_SLO,  O_NOP_A,O_ORA,  O_ASL,  O_SLO,  // 00
00052         1,              1,              1,              1,              O_NOP_A,O_ORA,  O_ASL,  O_SLO,
00053         1,              O_ORA,  1,              O_SLO,  O_NOP_A,O_ORA,  O_ASL,  O_SLO,  // 10
00054         1,              O_ORA,  1,              O_SLO,  O_NOP_A,O_ORA,  O_ASL,  O_SLO,
00055         1,              O_AND,  1,              O_RLA,  O_BIT,  O_AND,  O_ROL,  O_RLA,  // 20
00056         1,              1,              1,              1,              O_BIT,  O_AND,  O_ROL,  O_RLA,
00057         1,              O_AND,  1,              O_RLA,  O_NOP_A,O_AND,  O_ROL,  O_RLA,  // 30
00058         1,              O_AND,  1,              O_RLA,  O_NOP_A,O_AND,  O_ROL,  O_RLA,
00059         1,              O_EOR,  1,              O_SRE,  O_NOP_A,O_EOR,  O_LSR,  O_SRE,  // 40
00060         1,              1,              1,              1,              1,              O_EOR,  O_LSR,  O_SRE,
00061         1,              O_EOR,  1,              O_SRE,  O_NOP_A,O_EOR,  O_LSR,  O_SRE,  // 50
00062         1,              O_EOR,  1,              O_SRE,  O_NOP_A,O_EOR,  O_LSR,  O_SRE,
00063         1,              O_ADC,  1,              O_RRA,  O_NOP_A,O_ADC,  O_ROR,  O_RRA,  // 60
00064         1,              1,              1,              1,              O_JMP_I,O_ADC,  O_ROR,  O_RRA,
00065         1,              O_ADC,  1,              O_RRA,  O_NOP_A,O_ADC,  O_ROR,  O_RRA,  // 70
00066         1,              O_ADC,  1,              O_RRA,  O_NOP_A,O_ADC,  O_ROR,  O_RRA,
00067         1,              O_STA,  1,              O_SAX,  O_STY,  O_STA,  O_STX,  O_SAX,  // 80
00068         1,              1,              1,              1,              O_STY,  O_STA,  O_STX,  O_SAX,
00069         1,              O_STA,  1,              O_SHA,  O_STY,  O_STA,  O_STX,  O_SAX,  // 90
00070         1,              O_STA,  1,              O_SHS,  O_SHY,  O_STA,  O_SHX,  O_SHA,
00071         1,              O_LDA,  1,              O_LAX,  O_LDY,  O_LDA,  O_LDX,  O_LAX,  // a0
00072         1,              1,              1,              1,              O_LDY,  O_LDA,  O_LDX,  O_LAX,
00073         1,              O_LDA,  1,              O_LAX,  O_LDY,  O_LDA,  O_LDX,  O_LAX,  // b0
00074         1,              O_LDA,  1,              O_LAS,  O_LDY,  O_LDA,  O_LDX,  O_LAX,
00075         1,              O_CMP,  1,              O_DCP,  O_CPY,  O_CMP,  O_DEC,  O_DCP,  // c0
00076         1,              1,              1,              1,              O_CPY,  O_CMP,  O_DEC,  O_DCP,
00077         1,              O_CMP,  1,              O_DCP,  O_NOP_A,O_CMP,  O_DEC,  O_DCP,  // d0
00078         1,              O_CMP,  1,              O_DCP,  O_NOP_A,O_CMP,  O_DEC,  O_DCP,
00079         1,              O_SBC,  1,              O_ISB,  O_CPX,  O_SBC,  O_INC,  O_ISB,  // e0
00080         1,              1,              1,              1,              O_CPX,  O_SBC,  O_INC,  O_ISB,
00081         1,              O_SBC,  1,              O_ISB,  O_NOP_A,O_SBC,  O_INC,  O_ISB,  // f0
00082         1,              O_SBC,  1,              O_ISB,  O_NOP_A,O_SBC,  O_INC,  O_ISB
00083 };

Generated on Tue Feb 8 04:07:34 2005 for E32frodo by doxygen 1.3.3