36 lines
729 B
C++
36 lines
729 B
C++
#include <configuration.hpp>
|
|
#include <execute/flags.hpp>
|
|
#include <execute/registers.hpp>
|
|
#include <execute/state.hpp>
|
|
#include <interpret/code.hpp>
|
|
#include <memory>
|
|
|
|
namespace Execute
|
|
{
|
|
class VirtualMachine
|
|
{
|
|
private:
|
|
Flags flags;
|
|
Registers registers;
|
|
State state;
|
|
|
|
std::unique_ptr<Interpret::Code const> codePtr;
|
|
|
|
void Step();
|
|
|
|
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;
|
|
State const & GetState() const;
|
|
Interpret::Statement const * const GetCurrentStatement() const;
|
|
|
|
bool IsTerminated() const;
|
|
|
|
VirtualMachine();
|
|
};
|
|
} |