#assembly #architecture #decoding #codec #6502

asm

A Rust library for decoding and encoding assembly of various architectures

3 releases (breaking)

0.3.0 Jun 11, 2022
0.2.0 Feb 7, 2022
0.1.0 Feb 7, 2022

#1978 in Encoding

Download history 13/week @ 2023-12-25 2/week @ 2024-01-01 13/week @ 2024-01-08 30/week @ 2024-02-19 18/week @ 2024-02-26 14/week @ 2024-03-04 23/week @ 2024-03-11 6/week @ 2024-03-18

62 downloads per month

MIT/Apache

40KB
494 lines

Assembly

A Rust library for decoding and encoding assembly of various architectures.

Supported architectures currently include:

  • 6502

Cargo Features

Every architecture has a feature. This allows you to only enable the architectures you need.

For example 6502 support would be enabled by adding this to your Cargo.toml:

[dependencies.asm]
version = "0.1"
features = ["6502"]

Example

Decoding

use asm::{_6502, Decoder};
let assembly = [0x65, 0x83, 0x31];

let mut decoder = _6502::Decoder::new(&assembly[..]);

println!("{:?}", decoder.decode())

Encoding

use asm::{_6502, Encoder};
let mut assembly = [0u8; 1];

let mut encoder = _6502::Encoder::new(&mut assembly[..]);

encoder.encode(_6502::Instruction::BRK(_6502::Addressing::Implied(())));

License

Licensed under either of Apache License, Version 2.0 or MIT license at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~0.4–1MB
~22K SLoC