{"id":29861024,"url":"https://github.com/akabane-boy/bumriscvassembler","last_synced_at":"2026-04-17T08:31:10.505Z","repository":{"id":302863574,"uuid":"1011885920","full_name":"akabane-boy/bumriscvassembler","owner":"akabane-boy","description":null,"archived":false,"fork":false,"pushed_at":"2025-07-12T06:50:25.000Z","size":249,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-10T20:04:59.500Z","etag":null,"topics":["assembler","assembly","c","risc-v"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/akabane-boy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"zenodo":null}},"created_at":"2025-07-01T13:34:19.000Z","updated_at":"2025-07-12T06:50:28.000Z","dependencies_parsed_at":"2025-07-12T07:10:18.634Z","dependency_job_id":"2bf4c948-63f0-4e10-b8aa-46110f28ad79","html_url":"https://github.com/akabane-boy/bumriscvassembler","commit_stats":null,"previous_names":["akabane-boy/bum_riscv_assembler","akabane-boy/bumriscvassembler"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/akabane-boy/bumriscvassembler","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akabane-boy%2Fbumriscvassembler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akabane-boy%2Fbumriscvassembler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akabane-boy%2Fbumriscvassembler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akabane-boy%2Fbumriscvassembler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/akabane-boy","download_url":"https://codeload.github.com/akabane-boy/bumriscvassembler/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akabane-boy%2Fbumriscvassembler/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31921743,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-16T18:22:33.417Z","status":"online","status_checked_at":"2026-04-17T02:00:06.879Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["assembler","assembly","c","risc-v"],"created_at":"2025-07-30T04:10:13.708Z","updated_at":"2026-04-17T08:31:10.486Z","avatar_url":"https://github.com/akabane-boy.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# bumriscvassembler\n\n**bumriscvassembler** is a simple RISC-V assembler in C.\n\nAims to learn how assembler works and get C programming experience.\n\n## Usage\n```console\nfoo@bar:~$ make\nfoo@bar:~$ ./bumriscvassembler\n```\n## Result\n- Example assembly file.\n\n![example.s](./img/example.png)\n\n- Results of executing the program.\n\n![result-terminal1](./img/terminal1.png)\n\n![result-terminal2](./img/terminal2.png)\n\n![result-terminal3](./img/terminal3.png)\n\n- Resulting .txt and .bin files.\n\n![result-img](./img/result-img.png)\n\t\n\n## Instruction format\nLogical (assembly) order\n### R-type:\nadd, sub, and, or, sll, slt, sra, xor\n\n| opcode | rd | funct3 | rs1 | rs2 | funct7 |\n| --------- | --------- | --------- | --------- | --------- | --------- |\n| 7 | 5 | 3 | 5 | 5 | 7 |\n\n\n### I-type:\naddi, andi, ori, lb, ln, lw, jalr\n\n| opcode | rd | funct3 | rs1 | imm[11:0] |\n| --------- | --------- | --------- | --------- | --------- |\n| 7 | 5 | 3 | 5 | 12 |\n\n### S-type:\nsb, sh, sw\n\n| opcode | imm[4:0] | funct3 | rs1 | rs2 | imm[11:5] |\n| --------- | --------- | --------- | --------- | --------- | --------- |\n| 7 | 5 | 3 | 5 | 5 | 7 |\n\n### B-type:\nbeq, bne, blt, bge, bltu, bgeu\n\n| opcode | imm | imm[4:1] | funct3 | rs1 | rs2 | imm[10:5] | imm |\n| --------- | --------- | --------- | --------- | --------- | --------- | --------- | --------- |\n| 7 | 1 | 4 | 3 | 5 | 5 | 6 | 1 |\n\n### U-type:\nlui, auipc\n\n| opcode | rd | imm[31:12] |\n| --------- | --------- | --------- |\n| 7 | 5 | 20 |\n\n### J-type:\njal\n\n| opcode | rd  | imm[19:12] | imm[11] | imm[10:1] | imm[20] |\n| --------- | --------- | --------- | --------- | --------- | --------- |\n| 7 | 5 | 8 | 1 | 10 | 1 |\n\n## Process\nThis section illustrates how **bum_riscv_assembler works**.\n\n1. Get a assembly file.\n2. getline() and tokenize.\n3. Identify instruction mnemonic.\n4. Verify legal syntax.\n5. Create array of Instruction consists of instruction fields.\n6. Create hash table of all labels and their addresses.\n7. Parse and Encode.\n8. Write into .txt and .bin files.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakabane-boy%2Fbumriscvassembler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fakabane-boy%2Fbumriscvassembler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakabane-boy%2Fbumriscvassembler/lists"}