Skip to content
Tech News
← Back to articles

Riscrithm – An intuitive RISC-V assembler and optimizer coded in Go

read original get RISC-V Assembly Language Kit → more articles
Why This Matters

Riscrithm introduces an intuitive high-level macro-assembly language that compiles directly to RISC-V, bridging the gap between readability and hardware control. Its user-friendly CLI and macro system simplify assembly programming, making low-level development more accessible for developers and hardware enthusiasts. This advancement could streamline RISC-V development workflows and foster broader adoption of custom hardware solutions.

Key Takeaways

The Riscrithm Developer Manual

Hey there. If you're looking at this, you are probably getting your hands dirty with Riscrithm, a high-level macro-assembly dialect that compiles straight down to pure RISC-V assembly. Think of it as a bridge between the readability of a high-level language and the raw, deterministic control of bare-metal hardware. Let's dive straight into how the compiler works, the syntax rules, and what's happening under the hood.

1. The CLI

To compile your source code, you'll use the riscrithm CLI tool. The syntax is straightforward:

riscrithm " source_code_file " " assembly_target_file " [-o/--optimize]

Source Code: Your Riscrithm input file.

Your Riscrithm input file. Target File: The generated .s assembly file. If this file doesn't exist, the compiler will create it for you on the fly.

The generated .s assembly file. If this file doesn't exist, the compiler will create it for you on the fly. Optimization: Pass -o or --optimize to enable the optimization sweep (more on the compiler architecture later).

2. File Structure & Globals

Every Riscrithm file must declare its target section and entrypoint at the very top. These, along with macro definitions, are the only lines allowed to exist completely unindented outside of a label block.

... continue reading