Merge branch 'decode_print' of https://gitlab.istic.univ-rennes1.fr/simpleos/burritos into decode_print
This commit is contained in:
commit
a5dce2013e
27
src/machine.rs
Normal file
27
src/machine.rs
Normal file
@ -0,0 +1,27 @@
|
||||
use crate::decode::*;
|
||||
|
||||
|
||||
pub struct Machine {
|
||||
pub _pc : u32,
|
||||
pub _int_reg : [u32 ; 32],
|
||||
pub _instructions : [u32 ; 100]
|
||||
}
|
||||
|
||||
|
||||
impl Machine {
|
||||
|
||||
fn _init_machine() -> Machine {
|
||||
|
||||
Machine {
|
||||
_pc : 0,
|
||||
_instructions : [0 ; 100],
|
||||
_int_reg : [0 ; 32]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod test {
|
||||
use crate::{_init_machine};
|
||||
|
||||
}
|
@ -1,5 +1,6 @@
|
||||
mod decode;
|
||||
mod print;
|
||||
mod machine;
|
||||
|
||||
fn main() {
|
||||
let instr = decode::decode(98);
|
||||
|
Loading…
Reference in New Issue
Block a user