diff --git a/src/bit_utilities.rs b/src/bit_utilities.rs index 3776a5b..aee3881 100644 --- a/src/bit_utilities.rs +++ b/src/bit_utilities.rs @@ -68,6 +68,18 @@ impl fmt::Display for BasicRegister { } } +impl fmt::Binary for BasicRegister { + fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { + write!(f, "Memory: ")?; + + for v in self.memory.iter() { + write!(f, "{}", *v as u8)?; + } + + write!(f, "") + } +} + fn read_vec(variable_name: &str) -> Vec { loop { print!("Enter {variable_name}: ");