28 lines
326 B
Rust
28 lines
326 B
Rust
|
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};
|
||
|
|
||
|
}
|