pub struct MMixAssembler {
pub labels: HashMap<String, u64>,
pub symbols: HashMap<String, SymbolType>,
pub instructions: Vec<(u64, MMixInstruction)>,
pub greg_inits: Vec<(u8, u64)>,
/* private fields */
}Fields§
§labels: HashMap<String, u64>§symbols: HashMap<String, SymbolType>§instructions: Vec<(u64, MMixInstruction)>§greg_inits: Vec<(u8, u64)>Implementations§
Source§impl MMixAssembler
impl MMixAssembler
pub fn new(source: &str, filename: &str) -> Self
Sourcepub fn add_source(&mut self, source: &str, filename: &str)
pub fn add_source(&mut self, source: &str, filename: &str)
Append another translation unit. Files are processed in the order they
are added; symbols, labels, GREG state, and current_addr carry over,
so the result is identical to assembling the concatenation of inputs.
pub fn parse(&mut self) -> Result<(), String>
Sourcepub fn encode_instruction_bytes(&self, instruction: &MMixInstruction) -> Vec<u8> ⓘ
pub fn encode_instruction_bytes(&self, instruction: &MMixInstruction) -> Vec<u8> ⓘ
Encode a single instruction into bytes using the shared encode module
Sourcepub fn generate_object_code(&self) -> Vec<u8> ⓘ
pub fn generate_object_code(&self) -> Vec<u8> ⓘ
Generate object code in MMO format
Auto Trait Implementations§
impl Freeze for MMixAssembler
impl RefUnwindSafe for MMixAssembler
impl Send for MMixAssembler
impl Sync for MMixAssembler
impl Unpin for MMixAssembler
impl UnsafeUnpin for MMixAssembler
impl UnwindSafe for MMixAssembler
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