Implemente finish (not finished yet), fix ucontext for windows

This commit is contained in:
Quentin Legot
2023-03-08 13:21:08 +01:00
committed by François Autin
parent 3457f67a7c
commit dc49951bab
5 changed files with 55 additions and 12 deletions

View File

@ -3,6 +3,7 @@ use std::{ops::{Add, Sub}, io::Write};
use crate::simulator::print;
use super::{decode::{Instruction, decode}};
use super::{decode::{Instruction, decode}, interrupt::Interrupt};
use super::global::*;
use std::fs::File;
@ -72,9 +73,15 @@ pub struct Machine {
pub sp: usize,
pub int_reg : Register<i64>,
pub fp_reg : Register<f32>,
<<<<<<< HEAD
pub main_memory : Vec<u8>,
pub shiftmask : [u64 ; 64],
pub registers_trace : String // for tests
=======
pub main_memory : [u8 ; MEM_SIZE],
pub shiftmask : [u64 ; 64],
pub interrupt: Interrupt,
>>>>>>> 8c6ef4e (Implemente finish (not finished yet), fix ucontext for windows)
// futur taille à calculer int memSize = g_cfg->NumPhysPages * g_cfg->PageSize;
//creer une struct cfg(configuration) qui s'initialise avec valeur dans un fichier cfg
}
@ -97,6 +104,7 @@ impl Machine {
sp: 0,
int_reg : Register::<i64>::init(),
fp_reg : Register::<f32>::init(),
<<<<<<< HEAD
main_memory : vec![0; MEM_SIZE],
shiftmask,
registers_trace : String::from("")
@ -104,6 +112,13 @@ impl Machine {
ret.int_reg.set_reg(10, -1);
ret
=======
main_memory : [0 ; MEM_SIZE],
shiftmask,
interrupt: Interrupt::new()
}
>>>>>>> 8c6ef4e (Implemente finish (not finished yet), fix ucontext for windows)
}
/// Read from main memory of the machine