Merge branch 'decode_print' of https://gitlab.istic.univ-rennes1.fr/simpleos/burritos into decode_print
This commit is contained in:
commit
a9a86b674b
@ -1,7 +1,8 @@
|
||||
use std::ops::{Add, Sub};
|
||||
use std::{ops::{Add, Sub}, io::Write};
|
||||
|
||||
use super::{decode::{Instruction, decode}};
|
||||
use super::global::*;
|
||||
use std::fs::File;
|
||||
|
||||
/// doit disparaitre
|
||||
const MEM_SIZE : usize = 4096;
|
||||
@ -136,6 +137,17 @@ impl Machine {
|
||||
}
|
||||
}
|
||||
|
||||
/// Write the contains of the main memory of the machine
|
||||
/// in a file called burritos_memory.txt
|
||||
///
|
||||
/// ### Parameters
|
||||
///
|
||||
/// - **machine** contains the memory
|
||||
pub fn extract_memory(machine: &mut Machine){
|
||||
let mut file = File::create("burritos_memory.txt").unwrap();
|
||||
file.write(&machine.main_memory);
|
||||
}
|
||||
|
||||
/// Execute the instructions table of a machine putted in param
|
||||
///
|
||||
/// ### Parameters
|
||||
|
Loading…
Reference in New Issue
Block a user