Git Product home page Git Product logo

ktc32-asm's Introduction

ktc32-asm

Rust License

ktc32-asm is an assembler written in Rust for KTC32, a hobby 32-bit CPU implemented in SystemVerilog.

Build

git clone https://github.com/kinpoko/ktc32-asm.git
cargo build --release

Usage

ktc32-asm -h
KTC32 assembler

Usage: ktc32-asm [OPTIONS] <FILE_PATH>

Arguments:
  <FILE_PATH>  .asm file path

Options:
  -o <OUTPUT_FILE>      output file name [default: a.mem]
  -b, --baremetal       assemble for bare metal
  -h, --help            Print help information
  -V, --version         Print version information

Features

  • Comments: Single-line comments can be written using // syntax.
// This is a comment
addi r1, r0, 1
  • Label: Labels can be used to mark a location in the code, and the corresponding address can be referenced using the label name.
start:
	jal r0, label

label:
	addi r1, r0, 1
  • Constants: Constants can be defined using a label and referenced in the code by using the label name.
start:
	addi r1, r0, msg
	lw r2, r1, 0

msg:
	0x6c6c6548

ktc32-asm's People

Contributors

kkinos avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.