{"id":33925913,"url":"https://github.com/codebycruz/dasm","last_synced_at":"2025-12-12T10:03:43.283Z","repository":{"id":255438542,"uuid":"850476930","full_name":"codebycruz/dasm","owner":"codebycruz","description":"Tiny dynamic assembly library for x86/amd64/rv32i/rv64i","archived":false,"fork":false,"pushed_at":"2025-02-12T21:21:59.000Z","size":57,"stargazers_count":6,"open_issues_count":5,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-09T05:39:55.985Z","etag":null,"topics":["amd64","assembler","code-generator","risc-v","rust","rv32i","rv64i","x86","x86-64"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/codebycruz.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":"2024-08-31T22:01:38.000Z","updated_at":"2025-10-09T05:07:15.000Z","dependencies_parsed_at":"2024-12-20T02:32:49.360Z","dependency_job_id":"704d0a5f-8e73-4f80-bed3-f0a87142e9aa","html_url":"https://github.com/codebycruz/dasm","commit_stats":null,"previous_names":["dvvcz/dasm","codebycruz/dasm"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/codebycruz/dasm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codebycruz%2Fdasm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codebycruz%2Fdasm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codebycruz%2Fdasm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codebycruz%2Fdasm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codebycruz","download_url":"https://codeload.github.com/codebycruz/dasm/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codebycruz%2Fdasm/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27680579,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-12-12T02:00:06.775Z","response_time":129,"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":["amd64","assembler","code-generator","risc-v","rust","rv32i","rv64i","x86","x86-64"],"created_at":"2025-12-12T10:01:46.773Z","updated_at":"2025-12-12T10:03:43.274Z","avatar_url":"https://github.com/codebycruz.png","language":"Rust","readme":"\u003ch1 align=\"center\"\u003e dasm \u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n\tA tiny, zero dependency assembler that currently supports x86 and amd64.\n\u003c/p\u003e\n\n\u003cdiv align=\"center\"\u003e\n\t\u003ca href=\"https://crates.io/crates/dasm\"\u003e\n\t\t\u003cimg alt=\"Crates.io Version\" src=\"https://img.shields.io/crates/v/dasm?color=orange\"\u003e\n\t\u003c/a\u003e\n\t\u003ca href=\"https://docs.rs/dasm/latest/dasm\"\u003e\n\t\t\u003cimg alt=\"Docs.rs Link\" src=\"https://img.shields.io/docsrs/dasm?color=blue\"\u003e\n\t\u003c/a\u003e\n\t\u003ca href=\"https://github.com/DvvCz/dasm/actions\"\u003e\n\t\t\u003cimg alt=\"Test Status\" src=\"https://img.shields.io/github/actions/workflow/status/DvvCz/dasm/test.yml?branch=master\u0026label=tests\"\u003e\n\t\u003c/a\u003e\n\u003c/div\u003e\n\n## Note\n\n`dasm` has a goal of acting as a lightweight, simple instructions for compilers.\n\nIf you want a higher-level library or something more comprehensive, there's other great solutions like [`Iced`](https://github.com/icedland/iced) or [`dynasm-rs`](https://github.com/CensoredUsername/dynasm-rs).\n\n## How it works\n\nCode generation doesn't have to be hard. This just provides explicit functions for generating instructions.  \nNo abstractions through macros, or some DSL you need to learn. Just functions.\n\n**Example**\n\n```rust\nuse dasm::tier::raw::amd64::*;\n\nlet rax = 0;\nlet rsi = 6; // Argument 2\nlet rdi = 7; // Argument 1\n\nlet asm = [\n\t\u0026mov_r64_r64(rax, rdi) as \u0026[u8],\n\t\u0026add_r64_r64(rax, rsi),\n\t\u0026ret()\n].concat();\n\n// Allocate an executable memory block\nlet mmapped = dasm::mmap::Mmap::exec(\u0026asm)\n\t.expect(\"Failed to mmap\");\n\n// Simply cast that memory into a function to call it.\nlet adder: extern \"C\" fn(x: u64, y: u64) -\u003e u64 = unsafe { std::mem::transmute(mmapped.as_ptr()) };\nassert_eq!(adder(5, 200), 205);\n```\n\n*There's also an example showcasing a tiny AOT compiled lisp at [`examples/tinylisp`](https://github.com/DvvCz/dasm/tree/master/examples/tinylisp).*\n\n\n## Why\n\nAll of the other solutions are either too big for my usecase (`LLVM`), too complex (`Cranelift`) or have too many abstractions.  \nSometimes, you don't need all of that - you just need to write some assembly.  \nThat's what `dasm` is for.\n\n*Of course - No shade to any other library. Anyone can use the tool they prefer.*","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodebycruz%2Fdasm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodebycruz%2Fdasm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodebycruz%2Fdasm/lists"}