6502-emulator/src/opcode/handler/ldx-opcode-handler.h

29 lines
970 B
C
Raw Normal View History

2019-03-27 00:14:44 +00:00
#ifndef INC_6502_EMULATOR_LDX_OPCODE_HANDLER_H
#define INC_6502_EMULATOR_LDX_OPCODE_HANDLER_H
#include "../../program.h"
#include "../opcode-handler.h"
class LdxOpcodeHandler : public OpcodeHandler {
public:
2019-03-27 20:04:01 +00:00
static const uint8_t IMMEDIATE = 0xA2;
static const uint8_t ZERO_PAGE = 0xA6;
static const uint8_t ZERO_PAGE_Y = 0xB6;
static const uint8_t ABSOLUTE = 0xAE;
static const uint8_t ABSOLUTE_Y = 0xBE;
2019-03-27 00:14:44 +00:00
2019-03-27 20:04:01 +00:00
explicit LdxOpcodeHandler(shared_ptr<Program> program, shared_ptr<RegisterManager> reg_man,
shared_ptr<Memory> memory) :
OpcodeHandler(program, reg_man, memory) {
2019-03-27 00:14:44 +00:00
handled_opcodes->push_back(IMMEDIATE);
handled_opcodes->push_back(ZERO_PAGE);
2019-03-27 20:04:01 +00:00
handled_opcodes->push_back(ZERO_PAGE_Y);
2019-03-27 00:14:44 +00:00
handled_opcodes->push_back(ABSOLUTE);
handled_opcodes->push_back(ABSOLUTE_Y);
}
virtual void execute() override;
};
#endif //INC_6502_EMULATOR_LDX_OPCODE_HANDLER_H