diff --git a/src/simulator/machine.rs b/src/simulator/machine.rs index 710b11a..462c775 100644 --- a/src/simulator/machine.rs +++ b/src/simulator/machine.rs @@ -6,6 +6,29 @@ use super::{decode::{Instruction, decode}, interrupt::Interrupt}; use super::global::*; use std::fs::File; + +/* +* Decommenter la variant si il est utilisé quelque part + */ +enum ExceptionType { + NO_EXCEPTION,//Everything ok! + //SYSCALL_EXCEPTION,//A program executed a system call. + PAGEFAULT_EXCEPTION,//Page fault exception + READONLY_EXCEPTION,//Write attempted to a page marked "read-only" */ + //BUSERROR_EXCEPTION, + /* translation resulted + in an invalid physical + address (mis-aligned or + out-of-bounds) */ + ADDRESSERROR_EXCEPTION, /* Reference that was + not mapped in the address + space */ + //OVERFLOW_EXCEPTION, //Integer overflow in add or sub. + //ILLEGALINSTR_EXCEPTION, //Unimplemented or reserved instr. + //NUM_EXCEPTION_TYPES +} + + pub const STACK_REG: usize = 2; pub const NUM_INT_REGS: usize = 32;