{"id":15033148,"url":"https://github.com/tenderlove/aarch64","last_synced_at":"2026-03-09T03:02:49.355Z","repository":{"id":41361472,"uuid":"470785979","full_name":"tenderlove/aarch64","owner":"tenderlove","description":"Pure Ruby ARM64 Assembler","archived":false,"fork":false,"pushed_at":"2024-05-14T11:24:46.000Z","size":1067,"stargazers_count":84,"open_issues_count":4,"forks_count":4,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-04-02T07:09:31.515Z","etag":null,"topics":["arm64","assembly","ruby","ruby-assembler"],"latest_commit_sha":null,"homepage":"","language":"Ruby","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/tenderlove.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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-03-16T23:43:16.000Z","updated_at":"2025-03-27T15:09:14.000Z","dependencies_parsed_at":"2024-05-14T12:45:34.980Z","dependency_job_id":null,"html_url":"https://github.com/tenderlove/aarch64","commit_stats":{"total_commits":497,"total_committers":1,"mean_commits":497.0,"dds":0.0,"last_synced_commit":"e86f43d843a53ba646610cd66a886444c0e47f8b"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tenderlove%2Faarch64","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tenderlove%2Faarch64/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tenderlove%2Faarch64/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tenderlove%2Faarch64/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tenderlove","download_url":"https://codeload.github.com/tenderlove/aarch64/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247999860,"owners_count":21031046,"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":["arm64","assembly","ruby","ruby-assembler"],"created_at":"2024-09-24T20:20:14.077Z","updated_at":"2026-03-09T03:02:44.309Z","avatar_url":"https://github.com/tenderlove.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AArch64\n\nThis is a pure Ruby ARM64 assembler.  Are you tired of writing Ruby in Ruby?\nNow you can write ARM64 assembly in Ruby with this gem!\n\n## Example\n\nThis example uses the DSL methods.  The DSL methods make accessing the\nregisters, shifts, and options a little more easy.\n\n```ruby\nrequire \"aarch64\"\nrequire \"jit_buffer\"\n\n# create a JIT buffer\njit_buffer = JITBuffer.new 4096\n\nasm = AArch64::Assembler.new\n\n# Make some instructions\nasm.pretty do\n  asm.movz x0, 0xCAFE\n  asm.movk x0, 0xF00D, lsl(16)\n  asm.ret\nend\n\n# Write the instructions to a JIT buffer\njit_buffer.writeable!\nasm.write_to jit_buffer\njit_buffer.executable!\n\n# Execute the JIT buffer\np jit_buffer.to_function([], -Fiddle::TYPE_INT).call.to_s(16) # =\u003e f00dcafe\n```\n\nThe following is the same example, but without the DSL.  The main difference is\nthat you must access registers via the constant names.\n\n```ruby\nrequire \"aarch64\"\nrequire \"jit_buffer\"\n\n# create a JIT buffer\njit_buffer = JITBuffer.new 4096\nasm = AArch64::Assembler.new\n\n# Make some instructions\nasm.movz AArch64::Registers::X0, 0xCAFE\nasm.movk AArch64::Registers::X0, 0xF00D, lsl: 16\nasm.ret\n\n# Write the instructions to a JIT buffer\njit_buffer.writeable!\nasm.write_to jit_buffer\njit_buffer.executable!\n\n# Execute the JIT buffer\np jit_buffer.to_function([], -Fiddle::TYPE_INT).call.to_s(16) # =\u003e f00dcafe\n```\n\nYou can include `AArch64::Registers` if you don't want to use the DSL, but\nwant easier access to the registers.  For example:\n\n```ruby\ninclude AArch64::Registers\n\nasm = AArch64::Assembler.new\nasm.movz X0, 0xCAFE\nasm.movk X0, 0xF00D, lsl: 16\nasm.ret\n```\n\nHere is another example of the same assembly, but using the built-in ARM64\nassembly parser:\n\n```ruby\nrequire \"jit_buffer\"\nrequire \"aarch64/parser\"\n\nparser = AArch64::Parser.new\nasm = parser.parse \u003c\u003c~eoasm\n  movz x0, 0xCAFE\n  movk x0, 0xF00D, lsl #16\n  ret\neoasm\n\n# create a JIT buffer\njit_buffer = JITBuffer.new 4096\n\n# Write the instructions to a JIT buffer\njit_buffer.writeable!\nasm.write_to jit_buffer\njit_buffer.executable!\n\n# Execute the JIT buffer\np jit_buffer.to_function([], -Fiddle::TYPE_INT).call.to_s(16) # =\u003e f00dcafe\n```\n\n## Hacking / Contributing\n\nHacking on this gem should be similar to most.  Just do:\n\n```\n$ gel install\n$ gel exec rake test\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftenderlove%2Faarch64","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftenderlove%2Faarch64","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftenderlove%2Faarch64/lists"}