{"id":25635027,"url":"https://github.com/yousabmenissy/aslib","last_synced_at":"2026-06-16T12:32:08.754Z","repository":{"id":278924699,"uuid":"936840374","full_name":"yousabmenissy/aslib","owner":"yousabmenissy","description":"A collection of functions and macros written in the GNU assembler","archived":false,"fork":false,"pushed_at":"2025-02-22T15:11:39.000Z","size":27,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-22T15:45:35.620Z","etag":null,"topics":["assembly","gnu-assembler"],"latest_commit_sha":null,"homepage":"","language":"Assembly","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/yousabmenissy.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":"2025-02-21T19:27:48.000Z","updated_at":"2025-02-22T15:11:42.000Z","dependencies_parsed_at":"2025-02-22T15:45:45.315Z","dependency_job_id":"17e0949d-383c-4b69-b699-5155ab736c18","html_url":"https://github.com/yousabmenissy/aslib","commit_stats":null,"previous_names":["yousabmenissy/aslib"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/yousabmenissy/aslib","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yousabmenissy%2Faslib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yousabmenissy%2Faslib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yousabmenissy%2Faslib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yousabmenissy%2Faslib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yousabmenissy","download_url":"https://codeload.github.com/yousabmenissy/aslib/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yousabmenissy%2Faslib/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34406820,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-16T02:00:06.860Z","response_time":126,"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":["assembly","gnu-assembler"],"created_at":"2025-02-22T23:17:52.161Z","updated_at":"2026-06-16T12:32:08.739Z","avatar_url":"https://github.com/yousabmenissy.png","language":"Assembly","funding_links":[],"categories":[],"sub_categories":[],"readme":"# aslib\nA collection of functions and macros written in the GNU assembler, `as`. \n\nDesigned for Unix/Linux x86_64 systems it provides a variety of useful utilities for various tasks, written entirely in assembly language.\n\n## Table of Contents\n- [Tutorial](#tutorial)\n- [Examples](#examples)\n  - [Hello World](#hello-world)\n  - [Echo](#echo)\n  - [Decimal Sum](#decimal-sum)\n  - [More Examples](#more-examples)\n- [Directory Structure](#directory-structure)\n- [Features](#features)\n- [Formatting](#formatting)\n- [100% Assembly](#100-assembly)\n- [License](#license)\n- [Contributing](#contributing)\n- [Contact](#contact)\n\n## Tutorial\nTo use the library, clone the aslib directory into the current working directory:\n```sh\ngit clone https://github.com/yousabmenissy/aslib.git\n```\nand include it in your program by adding the line:\n```as\n.include \"aslib/aslib.s\"\n```\nat the top of your main assembly file. Now you can use all macros and functions from aslib in your program.\n\n## Examples\n\n### Hello World\n```as\n.include \"aslib/aslib.s\"\n\n.section .data\nmsg: .string \"hello world\"\nlen: .quad .-msg\n\n.section .text\n.global _start\n_start:\n    WRITELN $1, msg(%rip), len(%rip)\n    EXIT    $0\n```\n\n### Echo\n```as\n.include \"aslib/aslib.s\"\n\n.section .text\n.global _start\n_start:\n    movq  %rsp, %rbp\n    movq  (%rbp), %r8\n\n    .LP0:\n    incq   %rbx\n    movq   8(%rbp, %rbx, 8), %rdi\n    call   strlen\n    movq   8(%rbp, %rbx, 8), %rsi\n    WRITE  $1, (%rsi), %rax\n    movq   $1, %rdi\n    movq   $' ', %rsi\n    call   putc\n\n    decq  %r8\n    cmpq  $1, %r8\n    jne   .LP0\n\n    NEWLN  $1\n    EXIT   $0\n```\n\n### Decimal Sum\n```as\n.include \"aslib/aslib.s\"\n\n.section .data\nerr: .string \"sum: ignored bad input '{s}' \\n\"\n\n.section .text\n.global _start\n\n_start:\n    movq  %rsp, %rbp\n\n    pxor  %xmm1, %xmm1\n    cmpq  $1, (%rbp)\n    jne   .LP0\n    EXIT  $0\n\n    .LP0:\n    incq  %rbx\n    movq  8(%rbp, %rbx, 8), %rdi\n    cmpq  $0, %rdi\n    je    2f\n\n    ATOD\n    testq  %rdx, %rdx\n    jns    1f\n\n    pushq  $0\n    pushq  8(%rbp, %rbx, 8)\n    movq   $1, %rdi\n    leaq   err(%rip), %rsi\n    call   printf\n    jmp    .LP0\n\n    1:\n    DADD\n    movaps  %xmm0, %xmm1\n    pxor    %xmm0, %xmm0\n    jmp     .LP0\n\n    2:\n    movaps  %xmm1, %xmm0\n    PUTD    $1\n    NEWLN   $1\n    EXIT    $0\n```\n\n### More Examples\nYou can find many more examples at [aslib examples](https://github.com/yousabmenissy/aslib-examples.git).\n\n## Directory Structure\n- `aslib.s`: Main include file that includes all other files.\n- `sys/`: System call macros.\n- `string/`: String manipulation functions.\n- `io/`: Input/output functions.\n- `decimal/`: Functions for operating on decimal numbers.\n\n## Features\n- **Syscall macros** - Readable and easy-to-use macros for many system calls.\n- **Conversion utilities** - Convert between string, int, float, and decimal.\n- **Read/Write utilities** - Read and write values of various types.\n- **String Manipulation** - Operate on strings and command line arguments.\n- **Decimal type** - Read, store, and operate on decimal values with exact precision.\n\n## Formatting\nThe library has a somewhat unconventional formatting where local labels are indented alongside the instructions. Not only did I not find an assembly autoformatter that does that, but I didn't find any formatter for GNU assembly anywhere.\n\nOut of frustration, I made my own GAS autoformatter in C called [cur](https://github.com/yousabmenissy/cur.git). It's portable, small, simple, and very opinionated. It's what is used to format [aslib](https://github.com/yousabmenissy/aslib.git) and [aslib examples](https://github.com/yousabmenissy/aslib-examples.git).\n\n## 100% Assembly\nThis library is entirely composed of handwritten assembly instructions. It does not use the C standard library, compilers, or libraries from any other language.\n\n## License\nCopyright (c) 2025-present Yousab Menissy\n\nLicensed under MIT License. See the [LICENSE](LICENSE) file for details.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyousabmenissy%2Faslib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyousabmenissy%2Faslib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyousabmenissy%2Faslib/lists"}