Add exit operand

This commit is contained in:
2020-05-16 12:17:10 +02:00
parent 1ce75c3772
commit f8eaabfc55
9 changed files with 24 additions and 6 deletions

View File

@@ -13,6 +13,7 @@ namespace Execute
std::vector<InterruptFn> const interrupts;
std::vector<std::uint8_t> memory;
unsigned stackPointer;
bool terminated;
State(std::unordered_map<std::string, unsigned> const & labelStatementIndice, unsigned const memorySize);
};

View File

@@ -71,6 +71,11 @@ namespace Interpret
void Execute(Execute::Flags & flags, Execute::State & state, Execute::Registers & registers) override;
};
struct ExitProgramStatement : Statement
{
void Execute(Execute::Flags & flags, Execute::State & state, Execute::Registers & registers) override;
};
struct SetStatement : Statement
{
Value firstArgument;

View File

@@ -15,6 +15,7 @@ namespace Token
Jump,
CallFunction,
ReturnFromFunction,
ExitProgram,
LessThanInteger,
GreaterThanInteger,
EqualInteger,