From a37a07533fa9b8bd8962ca3c1aea082ae2548651 Mon Sep 17 00:00:00 2001 From: Nathan Lee Date: Wed, 10 Jun 2026 22:10:59 -0500 Subject: move memory and cpu state into its own files --- src/state.rs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 src/state.rs (limited to 'src/state.rs') 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 +} + +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 -- cgit v1.2.3