[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-81774":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":13,"contributorsCount":13,"subscribersCount":13,"size":13,"stars1d":14,"stars7d":14,"stars30d":15,"stars90d":13,"forks30d":13,"starsTrendScore":16,"compositeScore":17,"rankGlobal":10,"rankLanguage":10,"license":18,"archived":19,"fork":19,"defaultBranch":20,"hasWiki":21,"hasPages":19,"topics":22,"createdAt":10,"pushedAt":10,"updatedAt":23,"readmeContent":24,"aiSummary":25,"trendingCount":13,"starSnapshotCount":13,"syncStatus":15,"lastSyncTime":26,"discoverSource":27},81774,"riscrithm","ghetea-patrick\u002Friscrithm","ghetea-patrick","Riscrithm is a lightweight, low-boilerplate macro-assembly dialect that compiles straight down to pure, human-readable RISC-V assembly. It bridges the gap between the expressive syntax of high-level languages and the raw, deterministic hardware execution of bare-metal computing.","",null,"Go",24,0,1,2,3,42.7,"MIT License",false,"main",true,[],"2026-06-12 04:01:35","# The Riscrithm Developer Manual (v1.1)\nHey 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.\nWith the release of **v1.1**, the language has evolved significantly beyond its original release. I have expanded the feature set to introduce file modularity, cleaner control flow, much tighter compile-time error checks, and an enhanced optimization pass. This iteration provides all the core capabilities needed for an expressive developer experience without hiding what the underlying hardware is executing.\nLet's dive straight into how the compiler works, the syntax rules, and what's happening under the hood.\n## 1. The CLI\nTo compile source code, use the CLI tool. The syntax is straightforward:\n```bash\nriscrithm \"source_code_file\" \"assembly_target_file\" [-o\u002F--optimize]\n\n```\n * **Source Code:** The Riscrithm input file.\n * **Target File:** The generated .s assembly file. If this file doesn't exist, the compiler creates it on the fly.\n * **Optimization:** Pass -o or --optimize to enable the comprehensive optimization sweep.\n## 2. File Structure, Globals & Module Imports\nEvery Riscrithm file must declare its target section and entrypoint at the very top. These directives, alongside macro definitions and import statements, are the *only* lines allowed to exist completely unindented outside of a label block.\n### Header and Entrypoint\n * header \u003Cvalue>: Sets the target assembly section. For instance, header default translates directly to .section .text.\n * entrypoint \u003Csymbol>: Defines where the program starts execution. Passing entrypoint main translates to .globl main.\n```text\nheader default\nentrypoint main\n\n```\n### Imports & Modular Files (New in v1.1)\nRiscrithm supports modular source files, making it simple to break projects down into reusable packages and utility libraries.\n> **Important Rule:** Imported modules and other secondary sub-files should not include a header or entrypoint directive, as they function strictly as modular components.\n> \n * **Global Import:** Use import to lazily drop an entire file's contents into the current compilation unit.\n   ```text\n   import \"packages\u002Fdisplay_utilities.txt\"\n   \n   ```\n * **Selective Import:** Use from ... import to pull only specific label symbols from another source file, avoiding global namespace pollution.\n   ```text\n   from \"libraries\u002Fmath_helpers.txt\" import qux, quux\n   from \"libraries\u002Fmath_helpers.txt\" import corge\n   \n   ```\n### Definitions (Macros)\nText-replacement macros are declared using the define keyword. This is ideal for aliasing registers, creating constants, or establishing single-line inline code fragments.\n```text\ndefine foo = x1\ndefine bar = x2\ndefine baz = x3\ndefine qux = x4\ndefine quux = 10\ndefine corge = 20\ndefine clearFoo = foo ^^\n\n```\nWhenever the parser encounters foo, it swaps it with x1 *before* processing any actual logical expressions.\n### Comments\nComments are written using the # symbol. The compiler strips out anything following a # on any line, allowing safe inline documentation anywhere.\n## 3. Compiler Validation Passes & Error Checking (New in v1.1)\nWriting bare-metal assembly can be error-prone and tedious to debug. To catch structural bugs early, v1.1 introduces a strict compile-time validation sweep before generating code. The compiler checks for the following anomalies and halts compilation with descriptive errors if found:\n * **Missing Header:** The main file must include a header directive at the top, or the assembly target cannot be initialized.\n * **Invalid Entrypoint:** The symbol passed to the entrypoint directive must resolve to a valid, defined label within the codebase.\n * **Global Duplicate Labels:** The compiler scans all unified modules and compilation units to guarantee no label is declared more than once.\n * **Undefined Jumps and Branches:** Any jump or branch targeting a label that doesn't exist anywhere in the source or imported tree triggers an instant compilation failure.\n * **Unreachable Code:** The compiler performs basic control-flow analysis to check for dead code, such as placing instructions directly after a return statement within the same block before a new label breaks scope.\n * **Duplicate File Imports:** Importing the exact same file path multiple times across your project is intercepted and flagged.\n * **Duplicate Label Imports:** Attempting to import the same specific label token multiple times via from ... import statements causes a syntax validation failure.\n## 4. Labels, Indentation, and Raw Blocks\nRiscrithm enforces strict layout scoping via indentation.\n### Standard Labels\nLabels define execution blocks, must end with a colon, and **must not** have any indentation. Conversely, every instruction inside a label block **must** be indented with spaces or tabs. Leaving an instruction unindented triggers a SyntaxError.\n```text\nmain:\n    load foo = quux\n    move bar = foo\n\n```\n### Raw Assembly Labels (!!)\nTo completely bypass the preprocessor and write raw RISC-V assembly, prefix your block label with !!. The compiler strips the exclamation marks but passes everything inside that block completely untouched. Macros and shorthands will *not* expand here.\n```text\n!!raw_block:\n    li x1, 10\n    variable ^^ # This stays exactly as written!\n\n```\n### Inline Raw Assembly (New in v1.1)\nIf you need a single specialized hardware instruction without changing your entire block style, use the !! prefix inline inside an indented execution block:\n```text\nprocess_data:\n    load foo = 5\n    !!addi x1, x1, 10 # This line bypasses processing and prints raw\n    foo ++\n\n```\n## 5. Core Features & Instructions\nRiscrithm maps expressive statements directly down to hardware-level instructions.\n### System & Interrupt Controls\nInstead of memorizing low-level privilege opcodes, use explicit system keywords:\n| Riscrithm | RISC-V Assembly | Description |\n|---|---|---|\n| interrupt.u | uret | User-mode trap return |\n| interrupt.s | sret | Supervisor-mode trap return |\n| interrupt.m | mret | Machine-mode trap return |\n| wait | wfi | Wait for interrupt (low-power state) |\n| trap | ebreak | Debugger trap |\n| halt | ecall | System environment call \u002F halt |\n| ... | nop | No-operation (ellipsis) |\n```text\nhandle_system_events:\n    wait\n    interrupt.u\n\n```\n### Branching and Conditionals\nTo unconditionally jump to a label, use the @ prefix:\n```text\nexecute_jump:\n    @some_label # Compiles to: j some_label\n\n```\nFor conditional branching, Riscrithm uses an inline ternary-like layout. The parser automatically maps your operators to beq, bne, blt, or bge, and swaps registers dynamically to handle asymmetric operations like > and \u003C=.\n * **Standard If\u002FElse Conditionals:**\n   ```text\n   compare_registers:\n       if foo == bar @true_block else @false_block\n       if foo > baz @greater_block else @lesser_block\n   \n   ```\n * **Else-less If Statements (New in v1.1):** Guard clauses and lightweight conditional jumps can skip the else branch entirely:\n   ```text\n   guard_check:\n       if foo == bar @true_block\n   \n   ```\n### Loops (Infinite and Conditional)\nRiscrithm avoids high-level loops like while or for to preserve bare-metal transparency. Instead, you build loops using labels, jumps, and inline conditionals.\n**An Infinite Loop:**\n```text\ninfinite_loop:\n    foo ++\n    @infinite_loop\n\n```\n**A Conditional Loop:**\n```text\nloop_setup:\n    load foo = 0\n    load bar = 10\n\nloop_start:\n    if foo == bar @loop_end else @loop_body\n\nloop_body:\n    foo ++\n    @loop_start\n\nloop_end:\n    halt\n\n```\n### Subroutine Return Statements (New in v1.1)\nLabels can act as structured, reusable functions using the native return statement, which compiles straight to a hardware ret instruction.\n```text\nmultiply_logic:\n    foo *= bar\n    return\n\n```\n### Operations and Mutators\nRiscrithm supports immediate assignments and compound mathematical expressions. The engine automatically appends the i suffix (e.g., addi, xori) when it detects you are working with an integer literal instead of an aliased register.\n * **Load\u002FMove:**\n   ```text\n   assign_values:\n       load foo = 100\n       move bar = foo\n   \n   ```\n * **Compound Math:**\n   ```text\n   apply_math:\n       foo += 5\n       bar *= baz\n       foo \u003C\u003C= 2\n   \n   ```\n * **Increments and Decrements:**\n   ```text\n   adjust_counters:\n       foo ++ # Compiles to: addi foo, foo, 1\n       bar -- # Compiles to: addi bar, bar, -1\n   \n   ```\n> **The ^^ Shorthand:** To quickly and efficiently clear a register, use the XOR-self operator ^^.\n> foo ^^ translates directly to xor foo, foo, foo, zeroing out the register in a single cycle.\n> \n```text\nreset_state:\n    foo ^^\n\n```\n### Swapping Variables\nTo swap the values of two registers without consuming a temporary third register, use the built-in swap command, which expands into a non-destructive triple-XOR sequence:\n```text\nperform_swap:\n    foo swap bar\n\n```\nTranslates directly into:\n```text\nxor foo, foo, bar\nxor bar, foo, bar\nxor foo, foo, bar\n\n```\n## 6. Memory Operations (Stack & Heap)\nInteracting with system memory requires strict data width indicators: .b (byte\u002F8-bit), .w (word\u002F32-bit), or .d (double-word\u002F64-bit).\n### Stack Operations\nStack expressions automatically handle the hardware stack pointer (sp) by shifting its offset before or after data access.\n * **Push (->):** Decrements sp by the relative width, then stores the register data.\n   ```text\n   save_context:\n       foo -> stack.w # Decrements sp by 4, stores word\n   \n   ```\n * **Pop (\u003C-):** Loads data from the stack pointer, then increments sp by the relative width.\n   ```text\n   restore_context:\n       bar \u003C- stack.d # Loads double-word, increments sp by 8\n   \n   ```\n * **Peek (=):** Standard memory load from the current stack address without adjusting sp.\n   ```text\n   check_top:\n       baz = stack.b # Loads byte from stack top without moving sp\n   \n   ```\n### Heap Operations\nHeap expressions require an explicit base address register indicated via & pointer notation.\n * **Store (->):** Writes data from a register out to the target memory pointer.\n   ```text\n   write_memory:\n       foo -> heap.w from &bar # Stores word from foo into address at bar\n   \n   ```\n * **Load (\u003C-):** Reads data into a destination register from the target memory pointer.\n   ```text\n   read_memory:\n       baz \u003C- heap.b from &foo # Loads byte into baz from address at foo\n   \n   ```\n## 7. The Compiler Architecture & Optimizer (-o \u002F --optimize)\nThe compiler uses a fast, lightweight **two-pass system**:\n 1. **Pass 1 (Sanitization & Validation):** The parser reads files, strips comments, resolves layout whitespace, evaluates module imports, and executes the compile-time safety and structure checks.\n 2. **Pass 2 (Parse & Optimize):** The engine iterates through statements, replaces text macros, handles code shorthands, and applies code optimizations before generating the output text.\nWhen compiling with -o or --optimize, three transformations are applied to make your final binary leaner:\n### Dead Assignment Elimination\nConsecutive redundant assignments or useless load\u002Fmove operations targeted at the same register are stripped out.\n```text\n# Source Input\nload foo = 128\nload foo = 128\n\n# Optimized Output\nli x1, 128\n\n```\n### Identity Math Elimination & Transformation (Upgraded in v1.1)\nMathematical expressions that result in no structural change are optimized based on destination contexts:\n * **Self-Identity Elimination:** If a register undergoes identity operations where it is assigned to itself, the instruction is dropped completely.\n   ```text\n   # Source Input\n   foo = foo + 0\n   bar = bar * 1\n   \n   # Optimized Output\n   # (Instructions deleted entirely)\n   \n   ```\n * **Cross-Register Identity Transformation:** If you perform an identity operation where the target destination is a *different* register, the compiler converts the operation into a cheap, fast register copy (mv). This rule spans addition, subtraction, multiplication, and division.\n   ```text\n   # Source Input\n   foo = bar + 0\n   foo = bar * 1\n   \n   # Optimized Output\n   mv x1, x2\n   mv x1, x2\n   \n   ```\n### Strength Reduction (Bitwise Folding)\nMultiplication and division are performance-intensive on hardware. If the optimizer identifies multiplication or division by a constant power of two, it rewrites the command as a highly efficient logical bit-shift.\n```text\n# Source Input\nfoo = bar * 2\nbaz = foo \u002F 8\n\n# Optimized Output\nslli x1, x2, 1 # Shift Left Logical by 1\nsrli x3, x1, 3 # Shift Right Logical by 3\n\n```\n## 8. Clean, Ready-to-Use Output\nThe assembly file output by Riscrithm is cleanly formatted. The produced .s text is automatically pretty-printed: instructions inside execution blocks are neatly aligned, label targets sit perfectly flush against the left margin, and instructions are highly human-readable.\nYou can take the resulting output and drop it straight into hardware simulators, binary toolchains, linkers, or desktop debuggers without manual formatting adjustments.\n## 9. Naming Conventions\nTo guarantee projects stay scannable, the compiler encourages a clean visual divide across identifier types:\n * **Variables & Registers (camelCase):** Aliases for registers or dynamic variables must start with a lowercase letter, with each subsequent word capitalized.\n   * *Examples:* firstNum, addressRegister, stackOffset\n * **Labels & Code Blocks (snake_case):** Jump locations, block scopes, loop entry boundaries, and subroutines use lowercase words divided by underscores.\n   * *Examples:* loop_start, on_true, error_handler\n * **Constants & Literals (SCREAMING_SNAKE_CASE):** Static configurations, macro constants, or invariant boundaries use uppercase letters separated by underscores.\n   * *Examples:* DEFAULT_HEADER, MAX_BUFFER_SIZE, IMM_VALUE\n## 10. Complete Operator & Expression Reference\n### Core Expressions and Memory Operators\n| Riscrithm Syntax | Category | Internal Expansion \u002F Behavior | Target RISC-V Assembly |\n|---|---|---|---|\n| load \u003Creg> = \u003Cimm> | Assignment | Direct immediate assignment | li reg, imm |\n| move \u003Creg1> = \u003Creg2> | Assignment | Register-to-register copy | mv reg1, reg2 |\n| \u003Creg1> swap \u003Creg2> | Value Exchange | Triple-XOR non-destructive swap | xor reg1, reg1, reg2\nxor reg2, reg1, reg2\nxor reg1, reg1, reg2 |\n| \u003Creg> -> stack.[b\u002Fw\u002Fd] | Stack Memory | Dec pointer, store byte\u002Fword\u002Fdouble | addi sp, sp, -offset\ns[b\u002Fw\u002Fd] reg, 0(sp) |\n| \u003Creg> \u003C- stack.[b\u002Fw\u002Fd] | Stack Memory | Load byte\u002Fword\u002Fdouble, inc pointer | l[b\u002Fw\u002Fd] reg, 0(sp)\naddi sp, sp, offset |\n| \u003Creg> = stack.[b\u002Fw\u002Fd] | Stack Memory | Peek value from top of stack | l[b\u002Fw\u002Fd] reg, 0(sp) |\n| \u003Creg1> \u003C- heap.[b\u002Fw\u002Fd] from &\u003Creg2> | Heap Memory | Base-register memory read (load) | l[b\u002Fw\u002Fd] reg1, 0(reg2) |\n| \u003Creg1> -> heap.[b\u002Fw\u002Fd] from &\u003Creg2> | Heap Memory | Base-register memory write (store) | s[b\u002Fw\u002Fd] reg1, 0(reg2) |\n### Math & Bitwise Operators\n| Riscrithm Syntax | Operator Type | Evaluated Expression |\n|---|---|---|\n| \u003Creg> ++ | Self Operator | \u003Creg> = \u003Creg> + 1 |\n| \u003Creg> -- | Self Operator | \u003Creg> = \u003Creg> - 1 |\n| \u003Creg> ^^ | Self Operator | \u003Creg> = \u003Creg> ^ \u003Creg> *(Fast Register Clear)* |\n| \u003Creg> += \u003Cval> | Compound Tag | \u003Creg> = \u003Creg> + \u003Cval> |\n| \u003Creg> -= \u003Cval> | Compound Tag | \u003Creg> = \u003Creg> - \u003Cval> |\n| \u003Creg> *= \u003Cval> | Compound Tag | \u003Creg> = \u003Creg> * \u003Cval> |\n| \u003Creg> \u002F= \u003Cval> | Compound Tag | \u003Creg> = \u003Creg> \u002F \u003Cval> |\n| \u003Creg> %= \u003Cval> | Compound Tag | \u003Creg> = \u003Creg> % \u003Cval> |\n| \u003Creg> \u003C\u003C= \u003Cval> | Compound Tag | \u003Creg> = \u003Creg> \u003C\u003C \u003Cval> |\n| \u003Creg> >>= \u003Cval> | Compound Tag | \u003Creg> = \u003Creg> >> \u003Cval> |\n| \u003Creg1> = \u003Creg2> + \u003Cval> | Base Arithmetic | Addition (Supports immediate realignment) |\n| \u003Creg1> = \u003Creg2> - \u003Cval> | Base Arithmetic | Subtraction (Supports immediate realignment) |\n| \u003Creg1> = \u003Creg2> & \u003Cval> | Base Arithmetic | Bitwise AND (Supports immediate realignment) |\n| \u003Creg1> = \u003Creg2> | \u003Cval> | Base Arithmetic | Bitwise OR (Supports immediate realignment) |\n| \u003Creg1> = \u003Creg2> ^ \u003Cval> | Base Arithmetic | Bitwise XOR (Supports immediate realignment) |\n| \u003Creg1> = \u003Creg2> \u003C\u003C \u003Cval> | Base Arithmetic | Logical Shift Left (Supports immediate realignment) |\n| \u003Creg1> = \u003Creg2> >> \u003Cval> | Base Arithmetic | Logical Shift Right (Supports immediate realignment) |\n| \u003Creg1> = \u003Creg2> * \u003Cval> | Base Arithmetic | Hardware Multiplication (M-Extension) |\n| \u003Creg1> = \u003Creg2> \u002F \u003Cval> | Base Arithmetic | Hardware Division (M-Extension) |\n| \u003Creg1> = \u003Creg2> % \u003Cval> | Base Arithmetic | Hardware Remainder (M-Extension) |\n## 11. Comprehensive Code Examples\n### Riscrithm Source Code\nExample one:\n``` text\nheader default\nentrypoint main\n\ndefine foo = x1\ndefine bar = x2\ndefine baz = x3\n\nmain:\n    load foo = 10\n    load bar = 20\n\n    foo += 5\n    bar += 2\n\n    baz = foo + bar\n\n    halt\n```\nExample two:\n``` text\nheader default\nentrypoint main\n\ndefine foo = x1\ndefine bar = x2\n\nmain:\n    load foo = 42\n    load bar = 99\n\n    foo -> stack.w\n    bar -> stack.w\n\n    foo \u003C- stack.w\n    bar \u003C- stack.w\n\n    foo swap bar\n\n    halt\n```\nExample three:\n``` text\nheader default\nentrypoint main\n\ndefine foo = x1\ndefine bar = x2\n\nmain:\n    load foo = 7\n    load bar = 7\n\n    foo = foo * 1\n    bar = bar + 0\n\n    foo = bar * 1\n\n    foo *= 8\n    bar \u002F= 2\n\n    if foo == bar @equal_block else @not_equal_block\n\nequal_block:\n    foo ++\n    halt\n\nnot_equal_block:\n    foo --\n    trap\n```\nExample four:\n``` text\n# orange_banana.txt\n!!banana:\n    addi x1, x1, 10\n    ret\n\norange:\n    bar >>= 1\n    bar &= 10\n    return\n\napple:\n    if foo \u003C bar @banana\n```\n``` text\n# horse_battery.txt\nqux:\n    foo swap bar\n    foo ^^\n\nquux:\n    !!li x1, 10\n    bar swap foo\n    bar --\n    foo ++\n```\n``` text\n# main.txt\nheader default\nentrypoint main\n\nimport \"libraries\u002Forange_banana.txt\"\nfrom \"libraries\u002Fhorse_battery.txt\" import qux, quux\n\ndefine foo = x1\ndefine bar = x2\ndefine baz = x3\n\nmain:\n    load foo = qux\n    load bar = quux\n\n    foo += bar\n    foo -> heap.w from &baz\n\n    halt\n\n    if foo == bar @qux else @quux\n\n    @orange\n    ...\n    @banana\n```\n### Unoptimized RISC-V Assembly Output\nExample one:\n``` text\n.section .text\n.globl main\nmain:\n   li x1, 10\n   li x2, 20\n   addi x1, x1, 5\n   addi x2, x2, 2\n   add x3, x1, x2\n   ecall\n```\nExample two:\n``` text\n.section .text\n.globl main\nmain:\n   li x1, 42\n   li x2, 99\n   addi sp, sp, -4\n   sw x1, 0(sp)\n   addi sp, sp, -4\n   sw x2, 0(sp)\n   lw x1, 0(sp)\n   addi sp, sp, 4\n   lw x2, 0(sp)\n   addi sp, sp, 4\n   xor x1, x1, x2\n   xor x2, x1, x2\n   xor x1, x1, x2\n   ecall\n```\nExample three:\n``` text\n.section .text\n.globl main\nmain:\n   li x1, 7\n   li x2, 7\n   mul x1, x1, 1\n   addi x2, x2, 0\n   mul x1, x2, 1\n   mul x1, x1, 8\n   div x2, x2, 2\n   beq x1, x2, equal_block\n   j not_equal_block\nequal_block:\n   addi x1, x1, 1\n   ecall\nnot_equal_block:\n   addi x1, x1, -1\n   ebreak\n```\nExample four:\n``` text\n.section .text\n.globl main\nmain:\n   load x1 = qux\n   load x2 = quux\n   add x1, x1, x2\n   sw x1, 0(x3)\n   ecall\n   beq x1, x2, qux\n   j quux\n   j orange\n   nop\n   j banana\nbanana:\n   addi x1, x1, 10\n   ret\norange:\n   srli x2, x2, 1\n   andi x2, x2, 10\n   ret\napple:\n   blt x1, x2, banana\nqux:\n   xor x1, x1, x2\n   xor x2, x1, x2\n   xor x1, x1, x2\n   xor x1, x1, x1\nquux:\n   li x1, 10\n   xor x2, x2, x1\n   xor x1, x2, x1\n   xor x2, x2, x1\n   addi x2, x2, -1\n   addi x1, x1, 1\n```\n### Optimized RISC-V Assembly Output (-o)\nExample one:\n``` text\n.section .text\n.globl main\nmain:\n   li x1, 10\n   li x2, 20\n   addi x1, x1, 5\n   addi x2, x2, 2\n   add x3, x1, x2\n   ecall\n```\nExample two:\n``` text\n.section .text\n.globl main\nmain:\n   li x1, 42\n   li x2, 99\n   addi sp, sp, -4\n   sw x1, 0(sp)\n   addi sp, sp, -4\n   sw x2, 0(sp)\n   lw x1, 0(sp)\n   addi sp, sp, 4\n   lw x2, 0(sp)\n   addi sp, sp, 4\n   xor x1, x1, x2\n   xor x2, x1, x2\n   xor x1, x1, x2\n   ecall\n```\nExample three:\n``` text\n.section .text\n.globl main\nmain:\n   li x1, 7\n   li x2, 7\n   mv x1, x2\n   slli x1, x1, 3\n   srli x2, x2, 1\n   beq x1, x2, equal_block\n   j not_equal_block\nequal_block:\n   addi x1, x1, 1\n   ecall\nnot_equal_block:\n   addi x1, x1, -1\n   ebreak\n\n```\nExample four:\n``` text\n.section .text\n.globl main\nmain:\n   load x1 = qux\n   load x2 = quux\n   add x1, x1, x2\n   sw x1, 0(x3)\n   ecall\n   beq x1, x2, qux\n   j quux\n   j orange\n   nop\n   j banana\nbanana:\n   addi x1, x1, 10\n   ret\norange:\n   srli x2, x2, 1\n   andi x2, x2, 10\n   ret\napple:\n   blt x1, x2, banana\nqux:\n   xor x1, x1, x2\n   xor x2, x1, x2\n   xor x1, x1, x2\n   xor x1, x1, x1\nquux:\n   li x1, 10\n   xor x2, x2, x1\n   xor x1, x2, x1\n   xor x2, x2, x1\n   addi x2, x2, -1\n   addi x1, x1, 1\n```\n## Enjoy writing assembly without the traditional architecture headaches. Happy coding!\n","Riscrithm 是一种轻量级、低冗余的宏汇编方言，可以直接编译成纯 RISC-V 汇编代码。它结合了高级语言的表达能力和裸机计算硬件执行的原始确定性。核心功能包括文件模块化、清晰的控制流、严格的编译时错误检查以及增强的优化过程。适合需要直接控制底层硬件同时保持代码可读性的开发场景，如嵌入式系统或教育用途。使用 Go 语言编写，并通过简单的命令行接口进行编译和优化。","2026-06-11 04:06:19","CREATED_QUERY"]