Skip to content
This repository has been archived by the owner on Apr 3, 2024. It is now read-only.

kkinos/ktc32-asm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

KTC32 assembler written in Rust.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages