All Projects → hlorenzi → Customasm

hlorenzi / Customasm

Licence: apache-2.0
💻 An assembler for custom, user-defined instruction sets! https://hlorenzi.github.io/customasm/web/

Programming Languages

rust
11053 projects
assembly
5116 projects
bytecode
52 projects
assembler
53 projects

Projects that are alternatives of or similar to Customasm

c8c
The chip8 compiler, assembler, and virtual machine
Stars: ✭ 110 (-47.87%)
Mutual labels:  vm, virtual-machine, asm
Lam
🚀 a lightweight, universal actor-model vm for writing scalable and reliable applications that run natively and on WebAssembly
Stars: ✭ 176 (-16.59%)
Mutual labels:  webassembly, virtual-machine, vm
Corewar
A reproduction of the Core War game. Assembly compiler, Virtual Machine and GUI.
Stars: ✭ 173 (-18.01%)
Mutual labels:  compiler, asm, virtual-machine
Ring
Innovative and practical general-purpose multi-paradigm language
Stars: ✭ 716 (+239.34%)
Mutual labels:  compiler, webassembly, virtual-machine
Ark
ArkScript is a small, fast, functional and scripting language for C++ projects
Stars: ✭ 312 (+47.87%)
Mutual labels:  compiler, virtual-machine, vm
RISVM
A low overhead, embeddable bytecode virtual machine in C++
Stars: ✭ 21 (-90.05%)
Mutual labels:  vm, virtual-machine, asm
Quickjs
QuickJS是一个小型并且可嵌入的Javascript引擎,它支持ES2020规范,包括模块,异步生成器和代理器。
Stars: ✭ 2,199 (+942.18%)
Mutual labels:  compiler, virtual-machine, vm
Smlvm
Smallrepo Virtual Machine
Stars: ✭ 265 (+25.59%)
Mutual labels:  compiler, virtual-machine, vm
Awesome Wasm Runtimes
A list of webassemby runtimes
Stars: ✭ 490 (+132.23%)
Mutual labels:  webassembly, virtual-machine, vm
Quickjs
The official repo is at bellard/quickjs.
Stars: ✭ 1,429 (+577.25%)
Mutual labels:  compiler, virtual-machine, vm
Wasmvm
An unofficial standalone WebAssembly process virtual machine
Stars: ✭ 164 (-22.27%)
Mutual labels:  webassembly, virtual-machine
Animatedgraph
Animated Graph which you can include in your application to show information in more attractive way
Stars: ✭ 162 (-23.22%)
Mutual labels:  custom, customizable
Lioness
The Lioness Programming Language
Stars: ✭ 155 (-26.54%)
Mutual labels:  compiler, virtual-machine
Frameless Titlebar
Customizable Electron Titlebar for frameless windows
Stars: ✭ 167 (-20.85%)
Mutual labels:  custom, customizable
Alchemyvm
WebAssembly Virtual Machine Built In Elixir
Stars: ✭ 176 (-16.59%)
Mutual labels:  webassembly, vm
Go.vm
A simple virtual machine - compiler & interpreter - written in golang
Stars: ✭ 178 (-15.64%)
Mutual labels:  compiler, virtual-machine
Wah
a slightly higher-level language superset of webassembly
Stars: ✭ 147 (-30.33%)
Mutual labels:  compiler, webassembly
Wag
WebAssembly compiler implemented in Go
Stars: ✭ 177 (-16.11%)
Mutual labels:  compiler, webassembly
Ppci
A compiler for ARM, X86, MSP430, xtensa and more implemented in pure Python
Stars: ✭ 210 (-0.47%)
Mutual labels:  compiler, webassembly
Tengo
A fast script language for Go
Stars: ✭ 2,528 (+1098.1%)
Mutual labels:  compiler, vm

customasm

This is an assembler that takes custom, user-defined instruction sets and uses them to assemble source files.
This can be useful if you'd like to test out a new virtual machine's bytecode, or even if you're eager to write programs for that new processor architecture you just implemented in FPGA!

crates.io Latest Release Releases

Discord

📱 Try it right now on your browser!

📖 Check out the User Guide for instructions!

🕹 Check out an example project which targets the NES!

💻 Install the VSCode syntax highlight extension!

❤️ Support me!

New v0.11

📖 Check out instructions for migration from older versions to v0.11!

Installation

You can install directly from crates.io by running cargo install customasm. Then the customasm application should automatically become available in your command-line environment.

You can also download pre-built executables from the Releases section.

You can compile from source yourself by first cloning the repository and then simply running cargo build. There's also a battery of tests available at cargo test.

Example

Given the following file:

#ruledef
{
    load r1, {value} => 0x11 @ value`8
    load r2, {value} => 0x12 @ value`8
    load r3, {value} => 0x13 @ value`8
    add  r1, r2      => 0x21
    sub  r3, {value} => 0x33 @ value`8
    jnz  {address}   => 0x40 @ address`16
    ret              => 0x50
}

multiply3x4:
    load r1, 0
    load r2, 3
    load r3, 4
    
    .loop:
        add r1, r2
        sub r3, 1
        jnz .loop
    
    ret

...the assembler will use the #ruledef directive to convert the instructions into binary code:

 outp | addr | data

  0:0 |    0 |          ; multiply3x4:
  0:0 |    0 | 11 00    ; load r1, 0
  2:0 |    2 | 12 03    ; load r2, 3
  4:0 |    4 | 13 04    ; load r3, 4
  6:0 |    6 |          ; .loop:
  6:0 |    6 | 21       ; add r1, r2
  7:0 |    7 | 33 01    ; sub r3, 1
  9:0 |    9 | 40 00 06 ; jnz .loop
  c:0 |    c | 50       ; ret

Command-Line Usage

Usage: customasm [options] <asm-file-1> ... <asm-file-N>

Options:
    -f, --format FORMAT The format of the output file. Possible formats:
                        binary, annotated, annotatedbin, binstr, hexstr,
                        bindump, hexdump, mif, intelhex, deccomma, hexcomma,
                        decc, hexc, logisim8, logisim16
    -o, --output [FILE] The name of the output file.
    -s, --symbol [FILE] The name of the output symbol file.
    -t, --iter [NUM]    The max number of passes the assembler will attempt
                        (default: 10).
    -p, --print         Print output to stdout instead of writing to a file.
    -q, --quiet         Suppress progress reports.
    -v, --version       Display version information.
    -h, --help          Display this information.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].