#[derive(Clone, Copy, Debug)]
pub struct Apsr {
bits: u32,
}
impl Apsr {
#[inline]
pub fn bits(self) -> u32 {
self.bits
}
#[inline]
pub fn q(self) -> bool {
self.bits & (1 << 27) == (1 << 27)
}
#[inline]
pub fn v(self) -> bool {
self.bits & (1 << 28) == (1 << 28)
}
#[inline]
pub fn c(self) -> bool {
self.bits & (1 << 29) == (1 << 29)
}
#[inline]
pub fn z(self) -> bool {
self.bits & (1 << 30) == (1 << 30)
}
#[inline]
pub fn n(self) -> bool {
self.bits & (1 << 31) == (1 << 31)
}
}
#[inline]
pub fn read() -> Apsr {
let bits: u32 = call_asm!(__apsr_r() -> u32);
Apsr { bits }
}