#assembly #cpu #batpu #batpu-2

batpu-assembly

A library for doing assembly work for the BatPU-2

4 releases (2 breaking)

Uses new Rust 2024

0.3.1 Jan 22, 2026
0.3.0 Jan 8, 2026
0.2.0 Jan 6, 2026
0.1.0 Jan 4, 2026

#31 in #cpu

MIT license

20KB
439 lines

batpu-assembly

batpu-assembly is a Rust library for assembly work for the BatPU-2 (ISA).

Example

let mut instructions: Vec<Instruction> = Vec::new();
let labels = HashMap::new();

instructions.push(
    // Loads 5 into r1
    Instruction::LoadImmediate(
        Register(u4!(1)),
        Immediate(5)
    )
);

let binary = instructions_to_binary(instructions, &labels).unwrap();

Dependencies

~0.5–1.2MB
~26K SLoC