Refactor main.cpp functions into separate class
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
#include <configuration.hpp>
|
||||
#include <execute/flags.hpp>
|
||||
#include <execute/registers.hpp>
|
||||
#include <execute/state.hpp>
|
||||
#include <interpret/code.hpp>
|
||||
#include <memory>
|
||||
|
||||
namespace Execute
|
||||
{
|
||||
@@ -11,17 +13,16 @@ namespace Execute
|
||||
Flags flags;
|
||||
Registers registers;
|
||||
State state;
|
||||
bool terminated;
|
||||
|
||||
Interpret::Code const & code;
|
||||
std::unique_ptr<Interpret::Code const> codePtr;
|
||||
|
||||
void Step();
|
||||
|
||||
VirtualMachine(Interpret::Code const & code, unsigned const memorySize);
|
||||
|
||||
public:
|
||||
void Run();
|
||||
void SingleStep();
|
||||
void LoadConfiguration(Configuration const & c);
|
||||
void LoadCode(std::unique_ptr<Interpret::Code> code);
|
||||
|
||||
Flags const & GetFlags() const;
|
||||
Registers const & GetRegisters() const;
|
||||
@@ -30,6 +31,6 @@ namespace Execute
|
||||
|
||||
bool IsTerminated() const;
|
||||
|
||||
static VirtualMachine CreateFromCode(Interpret::Code const & code);
|
||||
VirtualMachine();
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user