Merge branch 'decode_print' of gitlab.istic.univ-rennes1.fr:simpleos/burritos into decode_print

This commit is contained in:
Quentin Legot 2023-02-08 14:50:01 +01:00
commit eab9d1c749
3 changed files with 36 additions and 1 deletions

View File

@ -2,6 +2,7 @@ use std::ops::{Add, Sub};
use super::{decode::{Instruction, decode}};
use super::global::*;
/// doit disparaitre
const MEM_SIZE : usize = 4096;
@ -11,6 +12,8 @@ impl RegisterNum for i64 {}
impl RegisterNum for f32 {}
pub struct Register<U: RegisterNum> {
register: [U; 32]
}

View File

@ -2,6 +2,8 @@ use std::fs;
use std::io;
use std::io::BufRead;
const MEM_SIZE : usize = 4096;
/* TRUCS MANQUANT
@ -153,6 +155,36 @@ impl Mem_Checker{
}
}
fn Mem_Checker_check(m_c: &Mem_Checker, memory: [u8 ; MEM_SIZE]){
/*
* Check pc, sp
*/
/*
* Check sections
*/
for(i, s) in m_c.sections.iter().enumerate() {
let addr = s.addr;
let len = s.len;
let segment = &s.content;
/*
regarder dans mem[addr]
a cette adresse verifier len octets
*/
for j in 0..(len-1){
if segment[j] != memory[addr + j] {
println!("missmatch");
}
}
}
}
}

View File

@ -1,7 +1,7 @@
pub mod machine;
pub mod decode;
pub mod print;
mod mem_cmp;
pub mod mem_cmp;
pub mod global {