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

CPU_common.h

Go to the documentation of this file.
00001 /*
00002  *  CPU_common.h - Definitions common to 6502/6510 SC emulation
00003  *
00004  *  Frodo (C) 1994-1997 Christian Bauer
00005  */
00006 
00007 #ifndef _CPU_COMMON_H_
00008 #define _CPU_COMMON_H_
00009 
00010 
00011 // States for addressing modes/operations (Frodo SC)
00012 enum {
00013         // Read effective address, no extra cycles
00014         A_ZERO=0x18,
00015         A_ZEROX, A_ZEROX1,
00016         A_ZEROY, A_ZEROY1,
00017         A_ABS, A_ABS1,
00018         A_ABSX, A_ABSX1, A_ABSX2, A_ABSX3,
00019         A_ABSY, A_ABSY1, A_ABSY2, A_ABSY3,
00020         A_INDX, A_INDX1, A_INDX2, A_INDX3,
00021         A_INDY, A_INDY1, A_INDY2, A_INDY3, A_INDY4,
00022 
00023         // Read effective address, extra cycle on page crossing
00024         AE_ABSX, AE_ABSX1, AE_ABSX2,
00025         AE_ABSY, AE_ABSY1, AE_ABSY2,
00026         AE_INDY, AE_INDY1, AE_INDY2, AE_INDY3,
00027 
00028         // Read operand and write it back (for RMW instructions), no extra cycles
00029         M_ZERO,
00030         M_ZEROX, M_ZEROX1,
00031         M_ZEROY, M_ZEROY1,
00032         M_ABS, M_ABS1,
00033         M_ABSX, M_ABSX1, M_ABSX2, M_ABSX3,
00034         M_ABSY, M_ABSY1, M_ABSY2, M_ABSY3,
00035         M_INDX, M_INDX1, M_INDX2, M_INDX3,
00036         M_INDY, M_INDY1, M_INDY2, M_INDY3, M_INDY4,
00037         RMW_DO_IT, RMW_DO_IT1,
00038 
00039         // Operations (_I = Immediate/Indirect, _A = Accumulator)
00040         O_LDA, O_LDA_I, O_LDX, O_LDX_I, O_LDY, O_LDY_I,
00041         O_STA, O_STX, O_STY,
00042         O_TAX, O_TXA, O_TAY, O_TYA, O_TSX, O_TXS,
00043         O_ADC, O_ADC_I, O_SBC, O_SBC_I,
00044         O_INX, O_DEX, O_INY, O_DEY, O_INC, O_DEC,
00045         O_AND, O_AND_I, O_ORA, O_ORA_I, O_EOR, O_EOR_I,
00046         O_CMP, O_CMP_I, O_CPX, O_CPX_I, O_CPY, O_CPY_I,
00047         O_BIT,
00048         O_ASL, O_ASL_A, O_LSR, O_LSR_A, O_ROL, O_ROL_A, O_ROR, O_ROR_A,
00049         O_PHA, O_PHA1, O_PLA, O_PLA1, O_PLA2,
00050         O_PHP, O_PHP1, O_PLP, O_PLP1, O_PLP2,
00051         O_JMP, O_JMP1, O_JMP_I, O_JMP_I1,
00052         O_JSR, O_JSR1, O_JSR2, O_JSR3, O_JSR4,
00053         O_RTS, O_RTS1, O_RTS2, O_RTS3, O_RTS4,
00054         O_RTI, O_RTI1, O_RTI2, O_RTI3, O_RTI4,
00055         O_BRK, O_BRK1, O_BRK2, O_BRK3, O_BRK4, O_BRK5, O_BRK5NMI,
00056         O_BCS, O_BCC, O_BEQ, O_BNE, O_BVS, O_BVC, O_BMI, O_BPL,
00057         O_BRANCH_NP, O_BRANCH_BP, O_BRANCH_BP1, O_BRANCH_FP, O_BRANCH_FP1,
00058         O_SEC, O_CLC, O_SED, O_CLD, O_SEI, O_CLI, O_CLV,
00059         O_NOP,
00060 
00061         O_NOP_I, O_NOP_A,
00062         O_LAX, O_SAX,
00063         O_SLO, O_RLA, O_SRE, O_RRA, O_DCP, O_ISB,
00064         O_ANC_I, O_ASR_I, O_ARR_I, O_ANE_I, O_LXA_I, O_SBX_I,
00065         O_LAS, O_SHS, O_SHY, O_SHX, O_SHA,
00066         O_EXT
00067 };
00068 
00069 
00070 // Addressing mode for each opcode (first part of execution) (Frodo SC)
00071 extern const uint8 ModeTab[256];
00072 
00073 // Operation for each opcode (second part of execution) (Frodo SC)
00074 extern const uint8 OpTab[256];
00075 
00076 #endif

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