[][src]Struct armv4t_emu::Cpu

pub struct Cpu { /* fields omitted */ }

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]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.