Commit f10b0bc0 authored by Benoit Perrot's avatar Benoit Perrot
Browse files

::step() Return a boolean that indicates the end of the execution.

parent efbca12b
2003-07-17 Benot Perrot <benoit@lrde.epita.fr>
* src/vm/virtual_machine.hh: (step) Return a boolean that
indicates the end of the execution.
2003-07-17 Benot Perrot <benoit@lrde.epita.fr>
* src/vm/memory.hh: Add accessors for heap and stack sizes.
......
......@@ -61,7 +61,7 @@ namespace vm
}
public:
void step(bool trace = false)
bool step(bool trace = false)
{
const inst::Inst& ri = (*text_section)[cpu.get_pc() / 4];
cpu.set_pc(cpu.get_pc() + 4);
......@@ -69,14 +69,15 @@ namespace vm
if (trace)
std::cout << ri << std::endl;
ri.accept(*this);
return halt;
}
void execute(bool trace = false)
{
precondition(program);
halt = false;
while (!halt)
step(trace);
while (!step(trace));
}
protected:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment