Skip to main content

RasAssembler

Struct RasAssembler 

Source
pub struct RasAssembler { /* private fields */ }
Expand description

Assembler: converts assembly text to object files

Implementations§

Source§

impl RasAssembler

Source

pub fn new( target_arch: TargetArchitecture, target_os: TargetOperatingSystem, ) -> Result<Self, RasError>

Create a new assembler for the given target architecture and OS.

Source

pub fn with_object_write_options( target_arch: TargetArchitecture, target_os: TargetOperatingSystem, object_write_options: ObjectWriteOptions, ) -> Result<Self, RasError>

Create a new assembler with custom object-file write options.

Source

pub fn set_object_write_options(&mut self, opts: ObjectWriteOptions)

Replace the object-file write options used by subsequent assembly calls.

Source

pub fn assemble_text_to_object( &mut self, asm_text: &str, output_path: &Path, ) -> Result<(), RasError>

Assemble asm_text and write a relocatable object file to output_path.

Uses two-pass assembly for jmp/call instructions with forward label resolution.

Source

pub fn register_function(&mut self, name: &str) -> Result<(), RasError>

Register a function pointer for runtime calls.

Resolves the named symbol using dlsym (Unix) or GetProcAddress (Windows) and stores its address for use in generated code.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.