{"id":13626663,"url":"https://github.com/momumi/x86-zig","last_synced_at":"2025-04-16T15:31:26.355Z","repository":{"id":52392203,"uuid":"237721116","full_name":"momumi/x86-zig","owner":"momumi","description":"library for assembling x86 in zig (WIP)","archived":false,"fork":false,"pushed_at":"2021-04-30T02:58:19.000Z","size":846,"stargazers_count":26,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-08-02T22:27:33.607Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Zig","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/momumi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-02-02T05:02:44.000Z","updated_at":"2024-06-28T14:27:37.000Z","dependencies_parsed_at":"2022-09-03T16:12:19.264Z","dependency_job_id":null,"html_url":"https://github.com/momumi/x86-zig","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/momumi%2Fx86-zig","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/momumi%2Fx86-zig/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/momumi%2Fx86-zig/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/momumi%2Fx86-zig/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/momumi","download_url":"https://codeload.github.com/momumi/x86-zig/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223716670,"owners_count":17191088,"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-01T21:02:25.891Z","updated_at":"2024-11-08T16:31:17.440Z","avatar_url":"https://github.com/momumi.png","language":"Zig","funding_links":[],"categories":["Zig","Libraries","Other","Systems Programming"],"sub_categories":["Operating Systems"],"readme":"# x86-zig\n\nA library for assembling x86 instructions written in zig.\n\n## Example\n\n```zig\nconst warn = @import(\"std\").debug.warn;\n\nconst x86 = @import(\"src/x86.zig\");\n\npub fn main() anyerror!void {\n    const machine64 = x86.Machine.init(.x64);\n\n    // MOV RAX, R15\n    {\n        const op1 = x86.Operand.register(.RAX);\n        const op2 = x86.Operand.register(.R15);\n        const instr = try machine64.build2(.MOV, op1, op2);\n        warn(\"{x}\\t\\t\\tMOV\\t\\t{}, {}\\n\", .{instr.asSlice(), op1, op2});\n    }\n\n    // LOCK MOV DWORD PTR FS:[8*ECX + EBX + 0x33221100], EAX\n    {\n        const op1 = x86.Operand.memorySib(.FS, .DWORD, 8, .ECX, .EBX, 0x33221100);\n        const op2 = x86.Operand.register(.EAX);\n        const instr = try machine64.build2_pre(.Lock, .MOV, op1, op2);\n        warn(\"{x}\\tLOCK MOV\\t{}, {}\\n\", .{instr.asSlice(), op1, op2});\n    }\n\n    // JMP -20\n    {\n        const op1 = x86.Operand.immediateSigned(-20);\n        const instr = try machine64.build1(.JMP, op1);\n        warn(\"{x}\\t\\t\\tJMP\\t\\t{}\\n\", .{instr.asSlice(), op1});\n    }\n}\n```\n\n## Building examples\n\n### example-hello\n\nAssembles, loads to RAM, and executes a simple hello world program (Linux-x64).\n\n```\nzig build example-hello\n```\n\n## License\n\nLicensed under either of\n\n * Public domain ([UNLICENSE](UNLICENSE) or https://unlicense.org/)\n * Apache License, Version 2.0\n   ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)\n\nat your option.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmomumi%2Fx86-zig","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmomumi%2Fx86-zig","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmomumi%2Fx86-zig/lists"}