lminc 2.0.1

An assembler and interpreter for the Little Minion Computer model created by Professor Magnus Bordewich of Durham University, based on the Little Man Computer created by Dr. Stuart Madnick of M.I.T. in 1965
Documentation
#[cfg(feature = "std")]
mod example {
    use lminc::{assembler, runner::stdio::Runner};

    /// Imported assembly
    const ASSEMBLY: &str = include_str!("fib.txt");

    pub fn main() {
        // Assemble the assembly
        let memory = assembler::assemble_from_text(ASSEMBLY)
            .expect("failed to parse")
            .expect("failed to assemble");

        // Create the runner, which also initialises the computer
        let mut runner = Runner::new(memory);

        // Run the computer
        if let Err(error) = runner.run() {
            eprintln!("{error}");
        }
    }
}

#[cfg(not(feature = "std"))]
mod example {
    pub fn main() {
        eprintln!("To run this example, the `std` feature must be enabled!");
    }
}

/// Runs the Fibonacci sequence and stops when it exceeds 100
fn main() {
    example::main();
}