• Stars
    star
    703
  • Rank 64,412 (Top 2 %)
  • Language
    Rust
  • License
    Apache License 2.0
  • Created over 8 years ago
  • Updated 5 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

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

customasm

customasm is an assembler that allows you to provide your own custom instruction sets to assemble your source files! It can be useful, for example, if you're trying to test the bytecode of a new virtual machine, or if you're eager to write programs for that new microprocessor architecture you just implemented in an FPGA chip!

crates.io Latest Release Releases

Discord

🖥️ Try it right now on your web browser!

🕹️ Check out an example project which targets the NES!

⌨️ Install the VSCode syntax highlight extension!

❤️ Support the author!

Documentation

📚 Check out the wiki for a changelog, documentation, and a how-to-start guide!

💲 Check out the command-line help!

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: i8} => 0x11 @ value
    load r2, {value: i8} => 0x12 @ value
    load r3, {value: i8} => 0x13 @ value
    add  r1, r2          => 0x21
    sub  r3, {value: i8} => 0x33 @ value
    jnz  {address: u16}  => 0x40 @ address
    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 (base 16)

  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

More Repositories

1

theorytracker

🎼 HTML5/WebAudio multi-track songwriting app with chord analysis support! -- https://hlorenzi.github.io/theorytracker/
TypeScript
114
star
2

musicode

🎶 Markup language for music creation and analysis! -- https://hlorenzi.github.io/musicode/
JavaScript
65
star
3

galaxy

🌎 A 3D Super Mario Galaxy-esque orbital-gravity platformer prototype in WebGL! https://hlorenzi.github.io/galaxy/
JavaScript
41
star
4

circuitsim

⚡ Analog circuit simulator! -- https://hlorenzi.github.io/circuitsim/
JavaScript
23
star
5

jisho-open

㊗️ Web frontend for the JMdict Japanese-English dictionary project, with study list support! -- https://jisho.hlorenzi.com
TypeScript
21
star
6

react-dockable

An easy-to-use dockable window manager for React, fully embracing hooks! -- https://hlorenzi.github.io/react-dockable/
TypeScript
21
star
7

font-js

🔠 Visually inspect .otf/.ttf/.otc/.ttc glyphs online, and extract glyph images and metadata through the command line! -- https://hlorenzi.github.io/font-js/
JavaScript
21
star
8

mapvania

🗺🧱🕹 Project-oriented, tileset- and object-based level editor for games! -- https://hlorenzi.github.io/mapvania/
TypeScript
21
star
9

kmp-editor

Intuitive Mario Kart Wii course data editor!
JavaScript
20
star
10

mahnesjs

🕹 A pure JavaScript + another Rust/WebAsm NES emulator! -- https://hlorenzi.github.io/mahnesjs/
Rust
15
star
11

mk8d_ocr

🏁 Mario Kart 8 Deluxe table maker with OCR functionality! -- https://gb.hlorenzi.com/table
JavaScript
14
star
12

customasm-vscode

VSCode syntax highlighting support for customasm
5
star
13

mahnes

🕹 C++ NES emulator with 6502 sub-instruction timing!
C++
5
star
14

mariokartbot

A Discord bot that lets users hit each other with Mario Kart items!
Python
2
star
15

composer

C# Intuitive Music Tracker with Functional Harmony Support
C#
2
star
16

graphdb

JavaScript
2
star
17

trapl

Trapl Programming Language
C#
2
star
18

layout

Concept for a better HTML layout engine
JavaScript
2
star
19

smbview

Super Mario Bros. level decoder/viewer (incomplete) -- https://hlorenzi.github.io/smbview/
JavaScript
2
star
20

buffer-js

Utilities for working with buffer arrays
JavaScript
1
star
21

jislozt

👾 A little arcade game that blends Tetris and Space Invaders! https://hlorenzi.github.io/jislozt/
JavaScript
1
star
22

dockable-windows

Fully-managed C# Windows.Forms Visual Studio-style window docking
C#
1
star
23

platformer

https://hlorenzi.github.io/platformer/
TypeScript
1
star
24

mkgl

JavaScript
1
star
25

json

A small, quick-and-dirty C# JSON parser
C#
1
star
26

cameraview

Simple webcam display & capture -- https://hlorenzi.github.io/cameraview/
HTML
1
star
27

circuitsim-ml

Creator of samples and training for Machine Learning to my other repo `circuitsim`
JavaScript
1
star
28

vowel-analysis

Vowel formant frequency synthesis and analysis on the browser -- https://hlorenzi.github.io/vowel-analysis/
TypeScript
1
star
29

collision2d

JavaScript
1
star