summaryrefslogtreecommitdiff
path: root/src/state.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/state.rs')
-rw-r--r--src/state.rs22
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