Loader seem to work, be seem we have a problem with jalr
This commit is contained in:
@ -59,7 +59,7 @@ pub fn load(path: &str, machine: &mut Machine, start_index: usize) -> Result<(),
|
||||
for i in 0..instructions.len() {
|
||||
machine.write_memory(4, 4 * i + start_index, instructions[i] as u64);
|
||||
}
|
||||
#[cfg(debug_assertions)]
|
||||
println!("{:04x?}", instructions); // only print loaded program in debug build
|
||||
// #[cfg(debug_assertions)]
|
||||
// println!("{:04x?}", instructions); // only print loaded program in debug build
|
||||
Ok(())
|
||||
}
|
@ -240,7 +240,7 @@ impl Machine {
|
||||
let val = u32::from_be_bytes(val) as u64;
|
||||
let inst : Instruction = decode(val);
|
||||
self.print_status();
|
||||
println!("executing instruction : {:016x} at pc {:x}", val, self.pc);
|
||||
println!("executing instruction : {:016x} at pc 0x{:x}", val, self.pc);
|
||||
println!("{}", print::print(decode(val), self.pc as i32));
|
||||
let trace = Self::string_registers(self);
|
||||
self.registers_trace.push_str(format!("{}\n", trace).as_str());
|
||||
|
Reference in New Issue
Block a user