forked from Rativel/BurritOS
Creating machine.rs file
This commit is contained in:
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};
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user