{"id":17040976,"url":"https://github.com/uggla/asm","last_synced_at":"2026-05-08T14:02:55.032Z","repository":{"id":148620008,"uuid":"481783036","full_name":"uggla/asm","owner":"uggla","description":"Hello world example to play with Rust inline assembly","archived":false,"fork":false,"pushed_at":"2024-09-05T17:08:54.000Z","size":16,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-09-23T17:59:52.341Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/uggla.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":"2022-04-15T00:00:01.000Z","updated_at":"2024-09-05T17:08:58.000Z","dependencies_parsed_at":"2024-11-29T16:44:39.730Z","dependency_job_id":"99e1c9df-4855-4c6c-9348-e3ef5342695d","html_url":"https://github.com/uggla/asm","commit_stats":{"total_commits":8,"total_committers":1,"mean_commits":8.0,"dds":0.0,"last_synced_commit":"fac39e8c08eb157c476a99b6756aa4b87beb81a9"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/uggla/asm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uggla%2Fasm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uggla%2Fasm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uggla%2Fasm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uggla%2Fasm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/uggla","download_url":"https://codeload.github.com/uggla/asm/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uggla%2Fasm/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279001051,"owners_count":26082991,"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-10-09T02:00:07.460Z","response_time":59,"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":[],"created_at":"2024-10-14T09:11:01.291Z","updated_at":"2025-10-09T08:32:49.811Z","avatar_url":"https://github.com/uggla.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# asm\n\nThis is a \"hello world\" project to play with Rust inline assembly.\n[Inline assembly](https://blog.rust-lang.org/2022/02/24/Rust-1.59.0.html#whats-in-1590-stable)\nwas introduced with Rust 1.59 release (2022-02-24)\nand this is an attempt to learn more about it.\n\nInspiration from this little project also comes from\n[@iMilnb](https://twitter.com/iMilnb)\nand the C From Scratch video series, mainly this\nshow https://www.youtube.com/watch?v=F-Ow6-uH6Mc\n\nThe goal of the project is to show:\n\n- How to call the `write` and `uname` syscall directly using assembly.\n- How to use raw pointers and a bit of FFI (Foreign Fonction Interface)\n  to share data.\n- Usage of unsafe in such cases.\n- Implementation of the From trait to convert data from the C style\n  structure to the Rust one. This part is shamefully more or less\n  copied from the uname crate.\n\nThe asm directory contains a \"hello world\" example written in\nassembly and was used as a reference for the project.\n\nThe project uses x86_64 assembly and is targeting a Linux x86_64\noperating system. It means that **it will not be able to run** on\nanother platform or CPU.\n\nOf course, tracing the program with `stace` shows\nthe syscalls explicitly requested with inline assembly :\n\n```\nexecve(\"./target/debug/asm\", [\"./target/debug/asm\"], 0x7fff86007bb0 /* 90 vars */) = 0\n...\n...\nwrite(1, \"Hello from: \", 12Hello from: )            = 12\nwrite(1, \"\\360\\237\\246\\211 Uggla !!!\\n\", 15🦉 Uggla !!!\n) = 15\nuname({sysname=\"Linux\", nodename=\"ugglalaptop\", ...}) = 0\n...\n...\nexit_group(0)                           = ?\n+++ exited with 0 +++\n```\n\n## Build from the sources\n\n1. Clone the project\n\n```bash\n  git clone https://github.com/uggla/asm.git\n```\n\n2. Go to the project directory\n\n```bash\n  cd asm\n```\n\n3. Build and run the program\n\n```bash\ncargo build\n./target/debug/asm\n```\n\n4. Build hello.asm within asm directory (optional)\u003cbr/\u003e\n   Install make, gcc and nasm on your system using your\n   system package manager. Then execute :\n\n```bash\ncd asm\nmake\n./hello\n```\n\n## Program output example\n\n```bash\n 🦉 uggla   main  ~  workspace  rust  asm  cargo -V\ncargo 1.80.1 (376290515 2024-07-16)\n 🦉 uggla   main  ~  workspace  rust  asm  cargo run\n    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.00s\n     Running `target/debug/asm`\nHello from: 🦉 Uggla !!!\nUnameInfo {\n    sysname: \"Linux\",\n    nodename: \"ugglalaptop\",\n    release: \"6.10.6-200.fc40.x86_64\",\n    version: \"#1 SMP PREEMPT_DYNAMIC Mon Aug 19 14:09:30 UTC 2024\",\n    machine: \"x86_64\",\n    domainname: \"(none)\",\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuggla%2Fasm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fuggla%2Fasm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuggla%2Fasm/lists"}