diff options
author | Tom Stellard <tstellar@gmail.com> | 2010-12-16 15:13:00 -0800 |
---|---|---|
committer | Tom Stellard <tstellar@gmail.com> | 2010-12-16 15:13:00 -0800 |
commit | 7aed76a98e718b3487787cec996025a14a93c96a (patch) | |
tree | e6d44ef57e9ca94338de2d9016a76959c90c789d | |
parent | b8d6cde69092ef0762a769a51da01891a8ba6dc3 (diff) |
emulator: return bool value from run()
-rw-r--r-- | emulator.cpp | 5 | ||||
-rw-r--r-- | emulator.h | 2 |
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 @@ -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( |