Created
May 8, 2017 18:09
-
-
Save VictorKoenders/4b5998c985581ea2b8abd3eec5841377 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include "Operation.hpp" | |
| #include <iostream> | |
| Operation::Operation() | |
| { | |
| } | |
| Operation::~Operation() | |
| { | |
| } | |
| void NoOperation::execute(const CpuState& state) | |
| { | |
| std::cout << "NOP" << std::endl; | |
| } | |
| static Operation* operations[256] = { | |
| new NoOperation(), | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #pragma once | |
| class CpuState | |
| { | |
| }; | |
| class Operation | |
| { | |
| public: | |
| Operation(); | |
| ~Operation(); | |
| virtual void execute(const CpuState& state) = 0; | |
| }; | |
| class NoOperation : public Operation | |
| { | |
| public: | |
| void execute(const CpuState& state); | |
| }; | |
| static Operation* operations[256]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment