{"id":13809060,"url":"https://github.com/yamnikov-oleg/nasmfmt","last_synced_at":"2025-04-10T18:30:58.669Z","repository":{"id":52592555,"uuid":"52101491","full_name":"yamnikov-oleg/nasmfmt","owner":"yamnikov-oleg","description":"Formatter for NASM source files","archived":false,"fork":false,"pushed_at":"2023-09-07T08:22:39.000Z","size":20,"stargazers_count":61,"open_issues_count":6,"forks_count":12,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-25T02:01:36.176Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","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/yamnikov-oleg.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}},"created_at":"2016-02-19T16:38:34.000Z","updated_at":"2024-12-31T17:57:30.000Z","dependencies_parsed_at":"2024-01-07T09:45:17.394Z","dependency_job_id":null,"html_url":"https://github.com/yamnikov-oleg/nasmfmt","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yamnikov-oleg%2Fnasmfmt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yamnikov-oleg%2Fnasmfmt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yamnikov-oleg%2Fnasmfmt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yamnikov-oleg%2Fnasmfmt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yamnikov-oleg","download_url":"https://codeload.github.com/yamnikov-oleg/nasmfmt/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248271581,"owners_count":21075800,"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","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-08-04T01:01:59.925Z","updated_at":"2025-04-10T18:30:58.380Z","avatar_url":"https://github.com/yamnikov-oleg.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"# nasmfmt\n\nAutomatically format your assembly sources with a simple command.\n\nInspired by gofmt.\n\n## What it does?\n\n__In one example.__ This source:\n\n```asm\nglobal _start\n\n\nsection .text\n\n   ;Starting point\n_start:\nmov rax,1 ;write(fd, buf, len)\nmov rdi,1  ; fd\nmov rsi, msg   ; buf\nmov rdx,  msglen; len\n  syscall\n\nmov rax,60 ;exit(status)\nmov rdi, 0\n  syscall\n\nsection .data\nmsg    db \"Hello world!\",10\nmsglen equ $-msg\n```\n\nWould be formatted into:\n\n```asm\n        global _start\n\n        section .text\n\n; Starting point\n_start:\n        mov rax, 1                     ; write(fd, buf, len)\n        mov rdi, 1                     ; fd\n        mov rsi, msg                   ; buf\n        mov rdx, msglen                ; len\n        syscall\n\n        mov rax, 60                    ; exit(status)\n        mov rdi, 0\n        syscall\n\n        section .data\nmsg:\n        db \"Hello world!\", 10\n        msglen equ $-msg\n\n```\n\n## Features\n\n* __Labels and instructions indentation.__\n```asm\nlabel:\nadd rax, rbx\n```\nBecomes:\n```asm\nlabel:\n        add rax, rbx\n```\n\n* __Comments indentation.__\n```asm\n   ; Start of the cycle\ncycle:\n        inc rcx ; Make it bigger\n        jmp cycle ; Because why not?\n                  ; Here's no cycle\n```\nBecomes:\n```asm\n; Start of the cycle\ncycle:\n        inc rcx                        ; Make it bigger\n        jmp cycle                      ; Because why not?\n; Here's no cycle\n```\n\n* __Consistent labels style.__\n```asm\none_style: test rax, rbx\nanother_style:\n        test rax, rbx\n\none_style:\n        db \"Message\"\nanother_style db \"Message\"\n```\nBecomes:\n```asm\none_style:\n        test rax, rbx\nanother_style:\n        test rax, rbx\n\none_style:\n        db \"Message\"\nanother_style:\n        db \"Message\"\n\n```\n\n* __Consistent commas style.__\n```asm\n        add rax,rbx\n        add rax, rbx\n        add rax,  rbx\n\n```\nBecomes:\n```asm\n        add rax, rbx\n        add rax, rbx\n        add rax, rbx\n```\n\n* __No extra spaces and empty lines.__\n```asm\nadd_func:\n        mov    rax, rdi\n        add    rax, rsi\n        ret\n\n\n\nsub_func:\n        mov    rax, rdi\n        sub    rax, rsi\n        ret\n```\nBecomes:\n```asm\nadd_func:\n        mov rax, rdi\n        add rax, rsi\n        ret\n\nsub_func:\n        mov rax, rdi\n        sub rax, rsi\n        ret\n```\n\n## Issues\n\nThere might be some issues since I have not tested it on all nasm functionality. \nPlease, [report](https://github.com/yamnikov-oleg/nasmfmt/issues/new), if you found some.\n\n_Would it work with other assemblers?_ May be, since most assembly syntaxes are similar.\n\n## Usage\n\n```\nUsage: nasmfmt [params] [file1 [file2 ...]]\nParameters:\n  -ci int\n        Indentation for comments in spaces (default 40)\n  -ii int\n        Indentation for instructions in spaces (default 8)\n```\n\nExamples:\n* `nasmfmt main.asm funcs1.asm funcs2.asm`\n* `nasmfmt -ii 4 main.asm`\n* `nasmfmt -ii 4 -ci 36 main.asm`\n\n## Installing\n\nVisit [Releases](https://github.com/yamnikov-oleg/nasmfmt/releases) to download a binary for your platform.\n\n## Building\n\nBuilding requires latest version of golang from [golang.org](https://golang.org/).\n\nIf you installed one, run `go install github.com/yamnikov-oleg/nasmfmt@latest`. Built binary will be located in your $GOPATH/bin.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyamnikov-oleg%2Fnasmfmt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyamnikov-oleg%2Fnasmfmt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyamnikov-oleg%2Fnasmfmt/lists"}