/* R65C02 Header file
for SoftAtom version 0.9
*
* Date : May 12, 1994 (c) Dick Bronsdijk
*
* This file contains de 6502 Registers and Flags
* and a disassembly table for debugging.
*/
unsigned char A, X, Y, SP, Op;
unsigned int PC, PCd, PCe;
struct pf
{
unsigned int C : 1; /* Carry
*/
unsigned int Z : 1; /* Zero
*/
unsigned int I : 1; /* Interrupt
disable */
unsigned int D : 1; /* Decimal
mode */
unsigned int B : 1; /* Break
*/
unsigned int X : 1; /* reserved
*/
unsigned int V : 1; /* oVerflow
*/
unsigned int S : 1; /* Sign
or negative */
unsigned int Q : 8;
};
union
{
struct pf F;
unsigned int P;
} P;
#ifdef DEBUG
struct Instructions
{
unsigned char object;
char
length;
char
flag;
char
*asmx;
} Code[] =
{
0x00, 0, 0, "BRK",
0x01, 1, 0, "ORA (#%02X,X)",
0x02, 0, 0, "???",
0x03, 0, 0, "???",
0x04, 1, 0, "TSB #%02X",
0x05, 1, 0, "ORA #%02X",
0x06, 1, 0, "ASL #%02X",
0x07, 1, 0, "RMB0 #%02X",
0x08, 0, 0, "PHP",
0x09, 1, 0, "ORA @#%02X",
0x0A, 0, 0, "ASL A",
0x0B, 0, 0, "???",
0x0C, 2, 0, "TSB #%04X",
0x0D, 2, 0, "ORA #%04X",
0x0E, 2, 0, "ASL #%04X",
0x0F, 2, 0, "BBR0 #%04X",
0x10, 1, 1, "BPL #%02X",
0x11, 1, 0, "ORA (#%02X),Y",
0x12, 1, 0, "ORA (#%02X)",
0x13, 0, 0, "???",
0x14, 1, 0, "TRB #%02X",
0x15, 1, 0, "ORA #%02X,X",
0x16, 1, 0, "ASL #%02X,X",
0x17, 1, 0, "RMB1 #%02X",
0x18, 0, 0, "CLC",
0x19, 2, 0, "ORA #%04X,Y",
0x1A, 0, 0, "INC A",
0x1B, 0, 0, "???",
0x1C, 2, 0, "TRB #%04X",
0x1D, 2, 0, "ORA #%04X,X",
0x1E, 2, 0, "ASL #%04X,X",
0x1F, 2, 0, "BBR1 #%04X",
0x20, 2, 0, "JSR #%04X",
0x21, 1, 0, "AND (#%02X,X)",
0x22, 0, 0, "???",
0x23, 0, 0, "???",
0x24, 1, 0, "BIT #%02X",
0x25, 1, 0, "AND #%02X",
0x26, 1, 0, "ROL #%02X",
0x27, 1, 0, "RMB2 #%02X",
0x28, 0, 0, "PLP",
0x29, 1, 0, "AND @#%02X",
0x2A, 0, 0, "ROL A",
0x2B, 0, 0, "???",
0x2C, 2, 0, "BIT #%04X",
0x2D, 2, 0, "AND #%04X",
0x2E, 2, 0, "ROL #%04X",
0x2F, 2, 0, "BBR2 #%04X",
0x30, 1, 1, "BMI #%02X",
0x31, 1, 0, "AND (#%02X),Y",
0x32, 1, 0, "AND (#%02X)",
0x33, 0, 0, "???",
0x34, 1, 0, "BIT #%02X,X",
0x35, 1, 0, "AND #%02X,X",
0x36, 1, 0, "ROL #%02X,X",
0x37, 1, 0, "RMB3 #%02X",
0x38, 0, 0, "SEC",
0x39, 2, 0, "AND #%04X,Y",
0x3A, 0, 0, "DEC A",
0x3B, 0, 0, "???",
0x3C, 2, 0, "BIT #%04X,X",
0x3D, 2, 0, "AND #%04X,X",
0x3E, 2, 0, "ROL #%04X,X",
0x3F, 2, 0, "BBR3 #%04X",
0x40, 0, 0, "RTI",
0x41, 1, 0, "EOR (#%02X,X)",
0x42, 0, 0, "???",
0x43, 0, 0, "???",
0x44, 0, 0, "???",
0x45, 1, 0, "EOR #%02X",
0x46, 1, 0, "LSR #%02X",
0x47, 1, 0, "RMB4 #%02X",
0x48, 0, 0, "PHA",
0x49, 1, 0, "EOR @#%02X",
0x4A, 0, 0, "LSR A",
0x4B, 0, 0, "???",
0x4C, 2, 0, "JMP #%04X",
0x4D, 2, 0, "EOR #%04X",
0x4E, 2, 0, "LSR #%04X",
0x4F, 2, 0, "BBR4 #%04X",
0x50, 1, 1, "BVC #%02X",
0x51, 1, 0, "EOR (#%02X),Y",
0x52, 1, 0, "EOR (#%02X)",
0x53, 0, 0, "???",
0x54, 0, 0, "???",
0x55, 1, 0, "EOR #%02X,X",
0x56, 1, 0, "LSR #%02X,X",
0x57, 1, 0, "RMB5 #%02X",
0x58, 0, 0, "CLI",
0x59, 2, 0, "EOR #%04X,Y",
0x5A, 0, 0, "PHY",
0x5B, 0, 0, "???",
0x5C, 0, 0, "???",
0x5D, 2, 0, "EOR #%04X,X",
0x5E, 2, 0, "LSR #%04X,X",
0x5F, 2, 0, "BBR5 #%04X",
0x60, 0, 0, "RTS",
0x61, 1, 0, "ADC (#%02X,X)",
0x62, 0, 0, "???",
0x63, 0, 0, "???",
0x64, 1, 0, "STZ #%02X",
0x65, 1, 0, "ADC #%02X",
0x66, 1, 0, "ROR #%02X",
0x67, 1, 0, "RMB6 #%02X",
0x68, 0, 0, "PLA",
0x69, 1, 0, "ADC @#%02X",
0x6A, 0, 0, "ROR A",
0x6B, 0, 0, "???",
0x6C, 2, 0, "JMP (#%04X)",
0x6D, 2, 0, "ADC #%04X",
0x6E, 2, 0, "ROR #%04X",
0x6F, 2, 0, "BBR6 #%04X",
0x70, 1, 1, "BVS #%02X",
0x71, 1, 0, "ADC (#%02X),Y",
0x72, 1, 0, "ADC (#%02X)",
0x73, 0, 0, "???",
0x74, 1, 0, "STZ #%02X,X",
0x75, 1, 0, "ADC #%02X,X",
0x76, 1, 0, "ROR #%02X,X",
0x77, 1, 0, "RMB7 #%02X",
0x78, 0, 0, "SEI",
0x79, 2, 0, "ADC #%04X,Y",
0x7A, 0, 0, "PLY",
0x7B, 0, 0, "???",
0x7C, 2, 0, "JMP (#%04X,X)",
0x7D, 2, 0, "ADC #%04X,X",
0x7E, 2, 0, "ROR #%04X,X",
0x7F, 2, 0, "BBR7 #%04X",
0x80, 1, 1, "BRA #%02X",
0x81, 1, 0, "STA (#%02X,X)",
0x82, 0, 0, "???",
0x83, 0, 0, "???",
0x84, 1, 0, "STY #%02X",
0x85, 1, 0, "STA #%02X",
0x86, 1, 0, "STX #%02X",
0x87, 1, 0, "SMB0 #%02X",
0x88, 0, 0, "DEY",
0x89, 1, 0, "BIT @#%02X",
0x8A, 0, 0, "TXA",
0x8B, 0, 0, "???",
0x8C, 2, 0, "STY #%04X",
0x8D, 2, 0, "STA #%04X",
0x8E, 2, 0, "STX #%04X",
0x8F, 2, 0, "BBS0 #%04X",
0x90, 1, 1, "BCC #%02X",
0x91, 1, 0, "STA (#%02X),Y",
0x92, 1, 0, "STA (#%02X)",
0x93, 0, 0, "???",
0x94, 1, 0, "STY #%02X,X",
0x95, 1, 0, "STA #%02X,X",
0x96, 1, 0, "STX #%02X,Y",
0x97, 1, 0, "SMB1 #%02X",
0x98, 0, 0, "TYA",
0x99, 2, 0, "STA #%04X,Y",
0x9A, 0, 0, "TXS",
0x9B, 0, 0, "???",
0x9C, 2, 0, "STZ #%04X",
0x9D, 2, 0, "STA #%04X,X",
0x9E, 2, 0, "STZ #%04X,X",
0x9F, 2, 0, "BBS1 #%04X",
0xA0, 1, 0, "LDY @#%02X",
0xA1, 1, 0, "LDA (#%02X,X)",
0xA2, 1, 0, "LDX @#%02X",
0xA3, 0, 0, "???",
0xA4, 1, 0, "LDY #%02X",
0xA5, 1, 0, "LDA #%02X",
0xA6, 1, 0, "LDX #%02X",
0xA7, 1, 0, "SMB2 #%02X",
0xA8, 0, 0, "TAY",
0xA9, 1, 0, "LDA @#%02X",
0xAA, 0, 0, "TAX",
0xAB, 0, 0, "???",
0xAC, 2, 0, "LDY #%04X",
0xAD, 2, 0, "LDA #%04X",
0xAE, 2, 0, "LDX #%04X",
0xAF, 2, 0, "BBS2 #%04X",
0xB0, 1, 1, "BCS #%02X",
0xB1, 1, 0, "LDA (#%02X),Y",
0xB2, 1, 0, "LDA (#%02X)",
0xB3, 0, 0, "???",
0xB4, 1, 0, "LDY #%02X,X",
0xB5, 1, 0, "LDA #%02X,X",
0xB6, 1, 0, "LDX #%02X,Y",
0xB7, 1, 0, "SMB3 #%02X",
0xB8, 0, 0, "CLV",
0xB9, 2, 0, "LDA #%04X,Y",
0xBA, 0, 0, "TSX",
0xBB, 0, 0, "???",
0xBC, 2, 0, "LDY #%04X,X",
0xBD, 2, 0, "LDA #%04X,X",
0xBE, 2, 0, "LDX #%04X,Y",
0xBF, 2, 0, "BBS3 #%04X",
0xC0, 1, 0, "CPY @#%02X",
0xC1, 1, 0, "CMP (#%02X,X)",
0xC2, 0, 0, "???",
0xC3, 0, 0, "???",
0xC4, 1, 0, "CPY #%02X",
0xC5, 1, 0, "CMP #%02X",
0xC6, 1, 0, "DEC #%02X",
0xC7, 1, 0, "SMB4 #%02X",
0xC8, 0, 0, "INY",
0xC9, 1, 0, "CMP @#%02X",
0xCA, 0, 0, "DEX",
0xCB, 0, 0, "???",
0xCC, 2, 0, "CPY #%04X",
0xCD, 2, 0, "CMP #%04X",
0xCE, 2, 0, "DEC #%04X",
0xCF, 2, 0, "BBS4 #%04X",
0xD0, 1, 1, "BNE #%02X",
0xD1, 1, 0, "CMP (#%02X),Y",
0xD2, 1, 0, "CMP (#%02X)",
0xD3, 0, 0, "???",
0xD4, 0, 0, "???",
0xD5, 1, 0, "CMP #%02X,X",
0xD6, 1, 0, "DEC #%02X,X",
0xD7, 1, 0, "SMB5 #%02X",
0xD8, 0, 0, "CLD",
0xD9, 2, 0, "CMP #%04X,Y",
0xDA, 0, 0, "PHX",
0xDB, 0, 0, "???",
0xDC, 0, 0, "???",
0xDD, 2, 0, "CMP #%04X,X",
0xDE, 2, 0, "DEC #%04X,X",
0xDF, 2, 0, "BBS5 #%04X",
0xE0, 1, 0, "CPX @#%02X",
0xE1, 1, 0, "SBC (#%02X,X)",
0xE2, 0, 0, "???",
0xE3, 0, 0, "???",
0xE4, 1, 0, "CPX #%02X",
0xE5, 1, 0, "SBC #%02X",
0xE6, 1, 0, "INC #%02X",
0xE7, 1, 0, "SMB6 #%02X",
0xE8, 0, 0, "INX",
0xE9, 1, 0, "SBC @#%02X",
0xEA, 0, 0, "NOP",
0xEB, 0, 0, "???",
0xEC, 2, 0, "CPX #%04X",
0xED, 2, 0, "SBC #%04X",
0xEE, 2, 0, "INC #%04X",
0xEF, 2, 0, "BBS6 #%04X",
0xF0, 1, 1, "BEQ #%02X",
0xF1, 1, 0, "SBC (#%02X),Y",
0xF2, 1, 0, "SBC (#%02X)",
0xF3, 0, 0, "???",
0xF4, 0, 0, "???",
0xF5, 1, 0, "SBC #%02X,X",
0xF6, 1, 0, "INC #%02X,X",
0xF7, 1, 0, "SMB7 #%02X",
0xF8, 0, 0, "SED",
0xF9, 2, 0, "SBC #%04X,Y",
0xFA, 0, 0, "PLX",
0xFB, 0, 0, "???",
0xFC, 0, 0, "???",
0xFD, 2, 0, "SBC #%04X,X",
0xFE, 2, 0, "INC #%04X,X",
0xFF, 2, 0, "BBS7 #%04X"
};
#endif