lamina-ras 0.1.0

ras - as/GAS alternative. Cross-platform assembler: assembly source (.s) to relocatable object files (.o). Used by Lamina, usable standalone.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//! Instruction encoder trait

use crate::error::RasError;

#[derive(Debug, Clone)]
pub struct ParsedInstruction {
    pub opcode: String,
    pub operands: Vec<String>,
}

pub trait InstructionEncoder {
    fn encode_instruction(&mut self, inst: &ParsedInstruction) -> Result<Vec<u8>, RasError>;

    fn current_position(&self) -> usize;
}