199 lines
3.2 KiB
Plaintext
199 lines
3.2 KiB
Plaintext
LDA LDX LDY BIT ADC SBC AND ORA EOR CMP CPX CPY
|
|
=====================================
|
|
|
|
LDA #imm
|
|
FetchOperandLo
|
|
FetchOpcode
|
|
|
|
LDA ZeroPage
|
|
FetchOperandLo
|
|
ReadAddress
|
|
FetchOpcode
|
|
|
|
LDA ZeroPage,X
|
|
FetchOperandLo
|
|
IndexX
|
|
ReadAddress;
|
|
FetchOpcode
|
|
|
|
LDA Absolute
|
|
FetchOperandLo
|
|
FetchOperandHi
|
|
ReadAddress
|
|
FetchOpcode
|
|
|
|
LDA Absolute, X/Y
|
|
FetchOperandLo
|
|
FetchOperandHiAndIndex;
|
|
ReadAddressAndSkip;
|
|
ReadAddress
|
|
FetchOpcode
|
|
|
|
LDA (Indirect, X)
|
|
FetchOperandLo
|
|
IndexX
|
|
FetchAddressLo;
|
|
FetchAddressHi;
|
|
ReadAddress
|
|
FetchOpcode
|
|
|
|
LDA (Indirect), Y
|
|
FetchOperandLo
|
|
FetchAddressLo
|
|
FetchAddressHiAndIndex
|
|
ReadAddressAndSkip
|
|
ReadAddress
|
|
FetchOpcode
|
|
|
|
|
|
STA STX STY
|
|
=====================================
|
|
|
|
STA ZeroPage
|
|
FetchOperandLo
|
|
WriteRegister
|
|
FetchOpcode
|
|
|
|
STA ZeroPage, X
|
|
FetchOperandLo
|
|
IndexX
|
|
WriteRegister
|
|
FetchOpcode
|
|
|
|
STA Absolute
|
|
FetchOperandLo
|
|
FetchOperandHi
|
|
WriteRegister
|
|
FetchOpcode
|
|
|
|
STA Absolute, X/Y
|
|
FetchOperandLo
|
|
FetchOperandHiAndIndex
|
|
ReadAddress
|
|
WriteRegister
|
|
FetchOpcode
|
|
|
|
STA (Indirect, X)
|
|
FetchOperandLo
|
|
IndexX
|
|
FetchAddressLo
|
|
FetchAddressHi
|
|
WriteRegister
|
|
FetchOpcode
|
|
|
|
STA (Indirect), Y
|
|
FetchOperandLo
|
|
FetchAddressLo
|
|
FetchAddressHiAndIndex
|
|
ReadAddress
|
|
WriteRegister
|
|
FetchOpcode
|
|
|
|
ASL LSR ROL ROR INC DEC
|
|
========================
|
|
ASL A
|
|
FakeFetchOperand
|
|
FetchOpcode
|
|
|
|
ASL ZeroPage
|
|
FetchOperandLo
|
|
ReadAddress
|
|
WriteAddress
|
|
WriteAddress
|
|
FetchOpcode
|
|
|
|
ASL ZeroPage, X
|
|
FetchOperandLo
|
|
IndexX
|
|
ReadAddress
|
|
WriteAddress
|
|
WriteAddress
|
|
FetchOpcode
|
|
|
|
ASL Absolute
|
|
FetchOperandLo
|
|
FetchOperandHi
|
|
ReadAddress
|
|
WriteAddress
|
|
WriteAddress
|
|
FetchOpcode
|
|
|
|
ASL Absolute, X
|
|
FetchOperandLo
|
|
FetchOperandHiAndIndex
|
|
ReadAddress
|
|
ReadAddress
|
|
WriteAddress
|
|
WriteAddress
|
|
FetchOpcode
|
|
|
|
BCC BCS BNE BEQ BPL BMI BVC BVS
|
|
========================
|
|
BCC
|
|
FetchOperandLo
|
|
CheckIfTaken;
|
|
CheckIfPageCrossed;
|
|
FetchOpcode
|
|
|
|
|
|
|
|
MICROINSTRUCTIONS
|
|
===========================================
|
|
|
|
FetchOpcode
|
|
DoOpcodeWork();
|
|
IR = Mem::Read(PC++);
|
|
Decode();
|
|
ResetState();
|
|
|
|
FakeFetchOperand
|
|
Address.Lo = Mem::Read(PC);
|
|
|
|
FetchOperandLo
|
|
Address.Lo = B = Mem::Read(PC++);
|
|
|
|
FetchOperandHi
|
|
Address.Hi = Mem::Read(PC++);
|
|
|
|
FetchOperandHiAndIndex
|
|
Address.Hi = Mem::Read(PC++);
|
|
if (Address.Lo+X/Y > 255) pageCrossed = true;
|
|
Address.Lo += X/Y;
|
|
|
|
ReadAddress
|
|
B = Mem::Read(Address);
|
|
if (pageCrossed) Address += 0x0100;
|
|
|
|
ReadAddressAndSkip
|
|
B = Mem::Read(Address);
|
|
if (pageCrossed)
|
|
Address += 0x0100;
|
|
else
|
|
InsertFetchOpcode();
|
|
|
|
IndexX
|
|
B = Mem::Read(Address);
|
|
Address.Lo += X;
|
|
|
|
FetchAddressLo
|
|
Add2.Lo = Mem::Read(Address++);
|
|
|
|
FetchAddressHi
|
|
Add2.Hi = Mem::Read(Address);
|
|
Address = Add2;
|
|
|
|
FetchAddressHiAndIndex
|
|
Add2.Hi = Mem::Read(Address);
|
|
if (Add2.lo+Y > 255) pageCrossed = true;
|
|
Address = Add2;
|
|
|
|
WriteRegister
|
|
if ((IR&3)==1) Mem::Write(Address, rA);
|
|
else if ((IR&3)==2) Mem::Write(Address, rX);
|
|
else if ((IR&3)==0) Mem::Write(Address, rY);
|
|
|
|
WriteAddress
|
|
Mem::Write(Address, B);
|
|
DoOpcodeWork();
|
|
|