rustvm-assembler 0.2.0

Custom assembler for rustVM
rustvm-assembler-0.2.0 is not a library.

Crates.io License

English | 한국어

Rust Vm Assembler

RustVm-Assembler is a two-pass assembler for the 16-bit rustVM instruction set.

It uses a NASM-inspired syntax while providing an encoder and opcode table specifically designed for rustVM.


Features

  • Two-pass assembly (symbol resolution + binary generation)
  • NASM-inspired syntax
  • db / dw directives
  • Easy-to-extend lexer, encoder, and opcode table
  • Command-line interface

Installation

Install from crates.io

cargo install rustvm-assembler

Install from source

git clone https://github.com/Jjoon0513/rustVM-Assembler.git
cd rustVM-Assembler
cargo install --path .

Verify the installation:

rva --version

Usage

Assemble an assembly source file:

rva input.asm

This generates:

input.bin

Specify a custom output file:

rva input.asm -o output.bin

Display all available options:

rva --help

Example

hello.asm

start:
    movi r0, 123
    hlt

Assemble it:

rva hello.asm -o hello.bin

The generated binary can then be loaded into rustVM.


Supported Directives

Directive Description
db Insert one or more bytes
dw Insert one or more 16-bit words

Example:

db 0x41, 0x42, 0x43
dw 0x1234

Project Structure

rva/
├── src/
│   ├── lexer.rs
│   ├── encoder.rs
│   ├── opcode_table.rs
│   └── main.rs
├── tests/
│   ├── (IS ANYBODY HERE??)
└── README.md

Related Projects


Roadmap

  • Better diagnostics with line/column information
  • Multi-file assembly
  • Symbol visibility
  • Object file generation

License

MIT OR Apache-2.0