{"id":16013723,"url":"https://github.com/drom/aal5","last_synced_at":"2026-03-19T21:01:28.769Z","repository":{"id":145177158,"uuid":"164573599","full_name":"drom/AAL5","owner":"drom","description":"Algebraic Assembly Language for RISC-V","archived":false,"fork":false,"pushed_at":"2019-01-08T08:40:58.000Z","size":15,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-07-10T08:03:40.520Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/drom.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-01-08T05:55:35.000Z","updated_at":"2022-07-02T23:32:29.000Z","dependencies_parsed_at":"2023-04-19T11:06:13.423Z","dependency_job_id":null,"html_url":"https://github.com/drom/AAL5","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/drom/AAL5","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drom%2FAAL5","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drom%2FAAL5/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drom%2FAAL5/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drom%2FAAL5/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/drom","download_url":"https://codeload.github.com/drom/AAL5/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drom%2FAAL5/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29125843,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-05T14:05:12.718Z","status":"ssl_error","status_checked_at":"2026-02-05T14:03:53.078Z","response_time":65,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-08T15:00:31.744Z","updated_at":"2026-02-05T16:32:26.100Z","avatar_url":"https://github.com/drom.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# AAL5\nAlgebraic Assembly Language for RISC-V\n\n## RV32I\n\n```js\n    rd = imm20 \u003c\u003c 12                        // lui     rd imm20 6..2=0x0D 1..0=3\n    pc = pc + (imm20 \u003c\u003c 12)                 // auipc   rd imm20 6..2=0x05 1..0=3\n\n    rd = pc + 4; goto (rs1 + imm12)         // jalr    rd rs1 imm12              14..12=0 6..2=0x19 1..0=3\n    rd = pc + 4; goto (pc + imm20)          // jal     rd jimm20                          6..2=0x1b 1..0=3\n\n    if (rs1 ==  rs2) goto (pc + bimm12hi)   // beq     bimm12hi rs1 rs2 bimm12lo 14..12=0 6..2=0x18 1..0=3\n    if (rs1 !=  rs2) goto (pc + bimm12hi)   // bne     bimm12hi rs1 rs2 bimm12lo 14..12=1 6..2=0x18 1..0=3\n    if (rs1  \u003c  rs2) goto (pc + bimm12hi)   // blt     bimm12hi rs1 rs2 bimm12lo 14..12=4 6..2=0x18 1..0=3\n    if (rs1 \u003e=  rs2) goto (pc + bimm12hi)   // bge     bimm12hi rs1 rs2 bimm12lo 14..12=5 6..2=0x18 1..0=3\n    if (rs1  \u003cu rs2) goto (pc + bimm12hi)   // bltu    bimm12hi rs1 rs2 bimm12lo 14..12=6 6..2=0x18 1..0=3\n    if (rs1 \u003e=u rs2) goto (pc + bimm12hi)   // bgeu    bimm12hi rs1 rs2 bimm12lo 14..12=7 6..2=0x18 1..0=3\n\n    rd =  i8[rs1 + imm12]  // lb      rd rs1       imm12 14..12=0 6..2=0x00 1..0=3\n    rd = i16[rs1 + imm12]  // lh      rd rs1       imm12 14..12=1 6..2=0x00 1..0=3\n    rd = i32[rs1 + imm12]  // lw      rd rs1       imm12 14..12=2 6..2=0x00 1..0=3\n    rd =  u8[rs1 + imm12]  // lbu     rd rs1       imm12 14..12=4 6..2=0x00 1..0=3\n    rd = u16[rs1 + imm12]  // lhu     rd rs1       imm12 14..12=5 6..2=0x00 1..0=3\n\n     i8[rs1 + imm12lo] = rs2  // sb     imm12hi rs1 rs2 imm12lo 14..12=0 6..2=0x08 1..0=3\n    i16[rs1 + imm12lo] = rs2  // sh     imm12hi rs1 rs2 imm12lo 14..12=1 6..2=0x08 1..0=3\n    i32[rs1 + imm12lo] = rs2  // sw     imm12hi rs1 rs2 imm12lo 14..12=2 6..2=0x08 1..0=3\n\n    rd = rs1  +  imm12    // addi    rd, rs1, imm12           14..12=0 6..2=0x04 1..0=3\n    rd = rs1  \u003c  imm12    // slti    rd, rs1, imm12           14..12=2 6..2=0x04 1..0=3\n    rd = rs1 \u003cu  imm12    // sltiu   rd, rs1, imm12           14..12=3 6..2=0x04 1..0=3\n    rd = rs1  ^  imm12    // xori    rd, rs1, imm12           14..12=4 6..2=0x04 1..0=3\n    rd = rs1  |  imm12    // ori     rd, rs1, imm12           14..12=6 6..2=0x04 1..0=3\n    rd = rs1  \u0026  imm12    // andi    rd, rs1, imm12           14..12=7 6..2=0x04 1..0=3\n    rs = rs1 \u003c\u003c\u003c shamt    // slli    rd, rs1, 31..26=0  shamt 14..12=1 6..2=0x04 1..0=3\n    rd = rs1 \u003e\u003e\u003e shamt    // srli    rd, rs1, 31..26=0  shamt 14..12=5 6..2=0x04 1..0=3\n    rd = rs1 \u003e\u003e  shamt    // srai    rd, rs1, 31..26=16 shamt 14..12=5 6..2=0x04 1..0=3\n    \n    rd = rs1  +  rs2      // add     rd rs1 rs2 31..25=0  14..12=0 6..2=0x0C 1..0=3\n    rd = rs1  -  rs2      // sub     rd rs1 rs2 31..25=32 14..12=0 6..2=0x0C 1..0=3\n    rd = rs1 \u003c\u003c\u003c rs2      // sll     rd rs1 rs2 31..25=0  14..12=1 6..2=0x0C 1..0=3\n    rd = rs1  \u003c  rs2      // slt     rd rs1 rs2 31..25=0  14..12=2 6..2=0x0C 1..0=3\n    rd = rs1  \u003cu rs2      // sltu    rd rs1 rs2 31..25=0  14..12=3 6..2=0x0C 1..0=3\n    rd = rs1  ^  rs2      // xor     rd rs1 rs2 31..25=0  14..12=4 6..2=0x0C 1..0=3\n    rd = rs1 \u003e\u003e\u003e rs2      // srl     rd rs1 rs2 31..25=0  14..12=5 6..2=0x0C 1..0=3\n    rd = rs1  \u003e\u003e rs2      // sra     rd rs1 rs2 31..25=32 14..12=5 6..2=0x0C 1..0=3\n    rd = rs1  |  rs2      // or      rd rs1 rs2 31..25=0  14..12=6 6..2=0x0C 1..0=3\n    rd = rs1  \u0026  rs2      // and     rd rs1 rs2 31..25=0  14..12=7 6..2=0x0C 1..0=3\n\n    rd = fence(fm, pred, succ, sr1)\n    ecall()\n    ebreak()\n    \n```\n\n## RV64I\n\n```js\n    rd = i64[rs1 + imm12]  // ld      rd rs1       imm12 14..12=3 6..2=0x00 1..0=3\n    rd = u32[rs1 + imm12]  // lwu     rd rs1       imm12 14..12=6 6..2=0x00 1..0=3\n\n    i64[rs1 + imm12lo] = rs2  // sd     imm12hi rs1 rs2 imm12lo 14..12=3 6..2=0x08 1..0=3\n```\n\n## F\n\n```js\nrd = rs1 + rs2      // fadd.s    rd rs1 rs2      31..27=0x00 rm       26..25=0 6..2=0x14 1..0=3\nrd = rs1 - rs2      // fsub.s    rd rs1 rs2      31..27=0x01 rm       26..25=0 6..2=0x14 1..0=3\nrd = rs1 * rs2      // fmul.s    rd rs1 rs2      31..27=0x02 rm       26..25=0 6..2=0x14 1..0=3\nrd = rs1 / rs2      // fdiv.s    rd rs1 rs2      31..27=0x03 rm       26..25=0 6..2=0x14 1..0=3\n\nrd = sign(rs1, rs2) // fsgnj.s   rd rs1 rs2      31..27=0x04 14..12=0 26..25=0 6..2=0x14 1..0=3\nrd = sign(rs1, rs2) // fsgnjn.s  rd rs1 rs2      31..27=0x04 14..12=1 26..25=0 6..2=0x14 1..0=3\nrd = sign(rs1, rs2) // fsgnjx.s  rd rs1 rs2      31..27=0x04 14..12=2 26..25=0 6..2=0x14 1..0=3\n\nrd = min(rs1, rs2)      // fmin.s    rd rs1 rs2      31..27=0x05 14..12=0 26..25=0 6..2=0x14 1..0=3\nrd = max(rs1, rs2)      // fmax.s    rd rs1 rs2      31..27=0x05 14..12=1 26..25=0 6..2=0x14 1..0=3\nrd = sqrt(rs1, rs2)     // fsqrt.s   rd rs1 24..20=0 31..27=0x0B rm       26..25=0 6..2=0x14 1..0=3\n\nrd = rs1 \u003c= rs2         // fle.s     rd rs1 rs2      31..27=0x14 14..12=0 26..25=0 6..2=0x14 1..0=3\nrd = rs1 \u003c  rs2         // flt.s     rd rs1 rs2      31..27=0x14 14..12=1 26..25=0 6..2=0x14 1..0=3\nrd = rs1 == rs2         // feq.s     rd rs1 rs2      31..27=0x14 14..12=2 26..25=0 6..2=0x14 1..0=3\n\nrd = rs1                // fcvt.w.s  rd rs1 24..20=0 31..27=0x18 rm       26..25=0 6..2=0x14 1..0=3\nrd = rs1                // fcvt.wu.s rd rs1 24..20=1 31..27=0x18 rm       26..25=0 6..2=0x14 1..0=3\nrd = rs1                // fcvt.l.s  rd rs1 24..20=2 31..27=0x18 rm       26..25=0 6..2=0x14 1..0=3\nrd = rs1                // fcvt.lu.s rd rs1 24..20=3 31..27=0x18 rm       26..25=0 6..2=0x14 1..0=3\nrd = rs1                // fmv.x.w   rd rs1 24..20=0 31..27=0x1C 14..12=0 26..25=0 6..2=0x14 1..0=3\nrd = rs1                // fclass.s  rd rs1 24..20=0 31..27=0x1C 14..12=1 26..25=0 6..2=0x14 1..0=3\n\nrd = f32[rs1 + imm12]   // flw       rd rs1 imm12 14..12=2 6..2=0x01 1..0=3\n\nf32[rs + imm12lo] = rs2 // fsw       imm12hi rs1 rs2 imm12lo 14..12=2 6..2=0x09 1..0=3\n\nrd = rs1 * rs2 + rs3    // fmadd.s   rd rs1 rs2 rs3 rm 26..25=0 6..2=0x10 1..0=3\nrd = rs1 * rs2 - rs3    // fmsub.s   rd rs1 rs2 rs3 rm 26..25=0 6..2=0x11 1..0=3\nrd = -rs1 * rs2 - rs3   // fnmsub.s  rd rs1 rs2 rs3 rm 26..25=0 6..2=0x12 1..0=3\nrd = -rs1 * rs2 + rs3   // fnmadd.s  rd rs1 rs2 rs3 rm 26..25=0 6..2=0x13 1..0=3\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrom%2Faal5","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdrom%2Faal5","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrom%2Faal5/lists"}