[−][src]Struct armv4t_emu::Cpu
An emulated CPU which implements the ARMv4T instruction set.
Methods
impl Cpu
[src]
pub fn new() -> Cpu
[src]
Construct a new ARMv4T Cpu
, with registers set to default "cold-boot"
values.
Specifically, PC
is set to 0x00000000
, and CPSR
is set to 0xd3
(ARM state, Supervisor mode, FIQ and IRQ mask bits set). Technically,
the ARM spec states that all other registers can have undefined values
on-boot, but in this emulator, all registers are set to 0 on-boot.
pub fn step(&mut self, mem: &mut impl Memory) -> bool
[src]
Step the CPU a single instruction with the given memory object.
As a testing convenience, this method returns false if a undefined instruction exception is triggered.
pub fn exception(&mut self, exc: Exception)
[src]
Trigger a CPU exception.
pub fn thumb_mode(&self) -> bool
[src]
Check if CPU is currently in Thumb mode.
pub fn reg_set(&mut self, mode: Mode, reg: Reg, val: u32)
[src]
Manually set a register's value.
pub fn reg_get(&self, mode: Mode, reg: Reg) -> u32
[src]
Returns a register's value.
pub fn mode(&self) -> Mode
[src]
Returns the current processor mode.
pub fn irq_enable(&self) -> bool
[src]
Check if IRQs are enabled.
pub fn fiq_enable(&self) -> bool
[src]
Check if FIQs are enabled.
Trait Implementations
impl Clone for Cpu
[src]
impl Copy for Cpu
[src]
impl Debug for Cpu
[src]
impl Default for Cpu
[src]
impl Eq for Cpu
[src]
impl PartialEq<Cpu> for Cpu
[src]
impl StructuralEq for Cpu
[src]
impl StructuralPartialEq for Cpu
[src]
Auto Trait Implementations
impl RefUnwindSafe for Cpu
impl Send for Cpu
impl Sync for Cpu
impl Unpin for Cpu
impl UnwindSafe for Cpu
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,