Implement LOAD Instructions
This commit is contained in:
42
src/cpu.h
42
src/cpu.h
@@ -32,6 +32,8 @@ private:
|
||||
FLAG_M = 0x20, // Memory/Accumulator size (0=16-bit, 1=8-bit)
|
||||
FLAG_V = 0x40, // Overflow
|
||||
FLAG_N = 0x80 // Negative
|
||||
// FLAG_E = ??? // 6502 Emulation Mode
|
||||
// FLAG_B = 0x10 //Break
|
||||
};
|
||||
|
||||
public:
|
||||
@@ -42,14 +44,46 @@ public:
|
||||
void Reset();
|
||||
void Step();
|
||||
void ExecuteInstruction();
|
||||
uint64_t GetCycles() const { return cycles; }
|
||||
[[nodiscard]] uint64_t GetCycles() const { return cycles; }
|
||||
|
||||
// Addressing mode helpers
|
||||
uint32_t GetEffectiveAddress(uint8_t mode);
|
||||
uint8_t ReadByte(uint32_t address);
|
||||
uint16_t ReadWord(uint32_t address);
|
||||
void UpdateNZ8(uint8_t value);
|
||||
void UpdateNZ16(uint16_t value);
|
||||
|
||||
// Instruction implementations
|
||||
// TODO: Implement remaining instructions
|
||||
void NOP();
|
||||
void LDA();
|
||||
void STA();
|
||||
void JMP();
|
||||
|
||||
static void NOP();
|
||||
|
||||
void LDA_Immediate();
|
||||
void LDA_Absolute();
|
||||
void LDA_AbsoluteX();
|
||||
void LDA_AbsoluteY();
|
||||
void LDA_DirectPage();
|
||||
void LDA_DirectPageX();
|
||||
void LDA_IndirectDirectPage();
|
||||
void LDA_IndirectDirectPageY();
|
||||
void LDA_DirectPageIndirectX();
|
||||
void LDA_Long();
|
||||
void LDA_LongX();
|
||||
|
||||
void LDX_Immediate();
|
||||
void LDX_Absolute();
|
||||
void LDX_AbsoluteY();
|
||||
void LDX_DirectPage();
|
||||
void LDX_DirectPageY();
|
||||
|
||||
void LDY_Immediate();
|
||||
void LDY_Absolute();
|
||||
void LDY_AbsoluteX();
|
||||
void LDY_DirectPage();
|
||||
void LDY_DirectPageX();
|
||||
|
||||
void STA();
|
||||
};
|
||||
|
||||
#endif //CPU_H
|
||||
|
||||
Reference in New Issue
Block a user