cbvm/engine/regs.rs
1#[derive(Debug, Clone, Copy)]
2pub struct Registers {
3 pub data: [u64; 60],
4}
5
6impl core::ops::Index<usize> for Registers {
7 type Output = u64;
8
9 fn index(&self, index: usize) -> &Self::Output {
10 &self.data[index]
11 }
12}
13impl core::ops::IndexMut<usize> for Registers {
14 fn index_mut(&mut self, index: usize) -> &mut Self::Output {
15 &mut self.data[index]
16 }
17}
18impl Default for Registers {
19 fn default() -> Self {
20 Self { data: [0; 60] }
21 }
22}