push and pop

This commit is contained in:
2026-06-06 23:47:38 -04:00
parent 66710370bf
commit a086fa6590
6 changed files with 67 additions and 20 deletions
+17 -4
View File
@@ -16,16 +16,29 @@ pub enum BitWidth {
B8,
}
impl RegMode {
impl Reg {
pub fn base(&self) -> u8 {
self.reg.0 & 0b111
self.0 & 0b111
}
/// checks if register is not one of the first 8 (0-7)
pub fn gt8(&self) -> bool {
self.reg.0 >= 0b1000
self.0 >= 0b1000
}
pub fn gt4(&self) -> bool {
self.reg.0 >= 0b0100
self.0 >= 0b0100
}
}
impl RegMode {
pub fn base(&self) -> u8 {
self.reg.base()
}
/// checks if register is not one of the first 8 (0-7)
pub fn gt8(&self) -> bool {
self.reg.gt8()
}
pub fn gt4(&self) -> bool {
self.reg.gt4()
}
}