diff options
| author | Nathan Lee <me@nwlee.tech> | 2026-06-10 22:10:59 -0500 |
|---|---|---|
| committer | Nathan Lee <me@nwlee.tech> | 2026-06-10 22:10:59 -0500 |
| commit | a37a07533fa9b8bd8962ca3c1aea082ae2548651 (patch) | |
| tree | c2ee061f6047eeda966ef9a4f3a7c26cf7da2061 /src/state.rs | |
| parent | 615e98a616c851fb6230184029aa4297417cdf6e (diff) | |
move memory and cpu state into its own files
Diffstat (limited to 'src/state.rs')
| -rw-r--r-- | src/state.rs | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/state.rs b/src/state.rs new file mode 100644 index 0000000..dcb1959 --- /dev/null +++ b/src/state.rs @@ -0,0 +1,22 @@ +use std::collections::HashSet; +use crate::mem::Memory; + +pub struct CpuState { + pub memory: Memory, + pub registers: [u32; 32], + pub f_registers: [f32; 32], + pub pc: u32, + pub reservations: HashSet<usize> +} + +impl CpuState { + pub fn new(memory: Memory) -> CpuState { + CpuState { + memory, + registers: [0u32; 32], + f_registers: [0f32; 32], + pc: 0, + reservations: HashSet::new() + } + } +}
\ No newline at end of file |
