Add next_instruction helper and bump version
This commit is contained in:
1 parent
6ee88325c5
commit
c6f4a23174
3 files changed
+49
-12
No files matched your search
+8
-10
@@ -15,16 +15,14 @@ fn main() {
|
||||
let ijvmfile = &args[1];
|
||||
|
||||
let mut machine = Machine::new_from_file(ijvmfile).unwrap();
|
||||
while machine.has_step() {
|
||||
match machine.step() {
|
||||
Ok(_) => (),
|
||||
Err(str) => {
|
||||
println!("\n\nERROR: pc=0x{:x} fp=0x{:x}: {}\nProgram exit",
|
||||
machine.get_program_counter(),
|
||||
machine.frame.len() - 1,
|
||||
str);
|
||||
return;
|
||||
}
|
||||
match machine.run() {
|
||||
Ok(_) => (),
|
||||
Err(str) => {
|
||||
println!("\n\nERROR: pc=0x{:x} fp=0x{:x}: {}\nProgram exit",
|
||||
machine.get_program_counter(),
|
||||
machine.frame.len() - 1,
|
||||
str);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user