pub struct Mipsasm<'a> { /* private fields */ }Expand description
An instance of the assembler/disassembler
Implementations§
Source§impl<'a> Mipsasm<'a>
impl<'a> Mipsasm<'a>
Sourcepub fn new() -> Mipsasm<'a>
pub fn new() -> Mipsasm<'a>
Create a new Mipsasm instance.
Sets the base address to 0 and the debug flag to false.
Sourcepub fn base(&mut self, addr: u32) -> &mut Mipsasm<'a>
pub fn base(&mut self, addr: u32) -> &mut Mipsasm<'a>
Set the base address for the assembler.
§Examples
use mipsasm::Mipsasm;
let mut mipsasm = Mipsasm::new();
mipsasm.base(0x8000_0000);Sourcepub fn symbols(&mut self, syms: HashMap<&'a str, u32>) -> &mut Mipsasm<'a>
pub fn symbols(&mut self, syms: HashMap<&'a str, u32>) -> &mut Mipsasm<'a>
Provides the assembler with a set of symbols.
§Examples
use mipsasm::Mipsasm;
use std::collections::HashMap;
let mut mipsasm = Mipsasm::new();
mipsasm.symbols(HashMap::from_iter(vec![("foo", 0x8000_0000)]));Sourcepub fn debug(&mut self) -> &mut Mipsasm<'a>
pub fn debug(&mut self) -> &mut Mipsasm<'a>
Set the debug flag for the assembler.
When debug is set to true, the disassembler will print instructions with all extra whitespace stripped. This is used for testing and will most likely not be useful for other purposes.
§Examples
use mipsasm::Mipsasm;
let mut mipsasm = Mipsasm::new();
mipsasm.debug();Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Mipsasm<'a>
impl<'a> RefUnwindSafe for Mipsasm<'a>
impl<'a> Send for Mipsasm<'a>
impl<'a> Sync for Mipsasm<'a>
impl<'a> Unpin for Mipsasm<'a>
impl<'a> UnwindSafe for Mipsasm<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more