GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - creatorsim/creator-assembler: CREATOR's generic assembler

BranchesTags
Open more actions menu

Latest commit

 

History

460 Commits
460 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
benches
benches
 
 
img
img
 
 
js_example
js_example
 
 
src
src
 
 
tests
tests
 
 
.codacy.yaml
.codacy.yaml
 
 
.gitignore
.gitignore
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
Cargo.lock
Cargo.lock
 
 
Cargo.toml
Cargo.toml
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
build.sh
build.sh
 
 
clippy.toml
clippy.toml
 
 

Repository files navigation

CREATOR Assembler

CREATOR's generic assembler

Example diagnostics

Features

  • Configurable ISA through an architecture configuration file.
  • Constant expression support, allowing arithmetic (+, -, *, /, %, <<, >>), bitwise (|, &, ^, ~), logical (&&, ||), and comparison (<, <=, ==, !=, >=, >) operators.
  • Labels as values in expressions.
  • Custom expression modifier support (%<name>(<expression>)).
  • User-friendly error messages.
  • Wasm support with JavaScript bindings.

Building

Requirements

The only requirement is the rust toolchain, which can be installed through rustup.

Running locally (CLI)

The assembler can be built from source using cargo build --release, which will place the binary in ./target/release/creator-assembler. The --release flag can be omitted to generate debug binaries. Additionally, cargo run --release -- [<ARGS>] can be used as a shortcut to build and run the binary. Running the application without arguments provides a short description of the application and subcommands, and using creator-assembler help <command> provides a description and usage instructions for each command.

The assembler currently supports 3 modes of execution:

  • Print architecture specification schema to stdout: creator-assembler schema
  • Validate architecture specification file: creator-assembler validate <architecture.json>
  • Compile assembly input and print the result to stdout: creator-assembler compile <architecture.json> <assembly.s>
    • The -v/--verbose flag can be used to also print the parsed AST

JS Bindings

JS bindings are supported through wasm. In order to build them, the code must first be compiled into a wasm package with wasm-pack. This can be done using wasm-pack build --target [web|nodejs], where the target depends on if the code is being compiled for NodeJS or a browser. The flag --dev can be added to generate a debug module with a shorter compile time by omitting optimizations. Alternatively, the provided build script (./build.sh) can be used to build both targets.

After the package has been built, it can be loaded by requiring the generated .js file as a module. The js_example/ directory contains a working example of how to use the generated package, both for the web and Node.js:

  • index.html: entry point for the web example. Can't be directly opened in a browser due to CORS limitations. Python can be used to start a development server with python3 -m http.server 8080 which allows loading the page at localhost:8080/js_example.
  • web.js: main module for the web example, shows how to load the package in the web
  • node.js: main module for the Node.js example, shows how to load the package in Node.js
  • assembler.mjs: module responsible for interaction with the package, shows how to use the provided API

About

CREATOR's generic assembler

creatorsim.github.io/

Resources

Readme
LGPL-3.0 license

Contributing

Contributing
Activity
Custom properties

Stars

7 stars

Watchers

1 watching

Forks

1 fork
Report repository

Releases

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.