print_memory dans Machine

This commit is contained in:
Baptiste
2023-03-01 15:11:35 +01:00
parent f6ff30b63c
commit 73c49414ff
5 changed files with 19 additions and 10 deletions

View File

@ -609,6 +609,17 @@ impl Machine {
machine.pc += 4; // Possible bug avec jump
}
pub fn print_memory(machine : &mut Machine) {
for i in 0..MEM_SIZE {
if i%16 == 0 {
print!("\n@{:04x} ", i);
}
print!("{:02x}", machine.main_memory[i]);
}
println!();
}
}
#[cfg(test)]