summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Stellard <tstellar@gmail.com>2010-12-16 15:13:00 -0800
committerTom Stellard <tstellar@gmail.com>2010-12-16 15:13:00 -0800
commit7aed76a98e718b3487787cec996025a14a93c96a (patch)
treee6d44ef57e9ca94338de2d9016a76959c90c789d
parentb8d6cde69092ef0762a769a51da01891a8ba6dc3 (diff)
emulator: return bool value from run()
-rw-r--r--emulator.cpp5
-rw-r--r--emulator.h2
2 files changed, 4 insertions, 3 deletions
diff --git a/emulator.cpp b/emulator.cpp
index 46abe5f..4028550 100644
--- a/emulator.cpp
+++ b/emulator.cpp
@@ -21,13 +21,13 @@ emulator::emulator(
m_out_regs(num_out_regs)
{ }
-void
+bool
emulator::run()
{
program * p = m_loader->load();
if (!p) {
std::cerr << "Could not load program\n";
- return;
+ return false;
}
m_immediate_regs = p->m_immediate_regs;
std::vector<instruction *>::iterator it;
@@ -35,6 +35,7 @@ emulator::run()
it < p->m_instructions.end(); ++it) {
(*it)->execute(*this);
}
+ return true;
}
void
diff --git a/emulator.h b/emulator.h
index f1a3437..b8f6986 100644
--- a/emulator.h
+++ b/emulator.h
@@ -17,7 +17,7 @@ public:
int num_out_regs);
- void run();
+ bool run();
void set_constants(float value);
value * get_value(register_address addr);
void set_value(