Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wdamron/arm
ARMv8 (AArch64) instruction assembler implemented in Go
https://github.com/wdamron/arm
aarch64 arm armv8 assembler go instruction-encoding jit neon
Last synced: 2 months ago
JSON representation
ARMv8 (AArch64) instruction assembler implemented in Go
- Host: GitHub
- URL: https://github.com/wdamron/arm
- Owner: wdamron
- License: mpl-2.0
- Created: 2022-08-14T00:53:40.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-08-21T18:00:01.000Z (over 2 years ago)
- Last Synced: 2024-06-20T15:01:19.704Z (7 months ago)
- Topics: aarch64, arm, armv8, assembler, go, instruction-encoding, jit, neon
- Language: Go
- Homepage:
- Size: 297 KB
- Stars: 5
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# package arm
```go
import "github.com/wdamron/arm"
```Package `arm` implements an ARMv8 (AArch64) instruction assembler in Go, for runtime or ahead-of-time generation of executable code. SVE/SME instructions are not yet supported.
This library is mostly adapted from the [CensoredUsername/dynasm-rs](https://github.com/CensoredUsername/dynasm-rs) (Rust) project, and is not heavily tested.
## Brief Overview
The `Assembler` type encodes executable instructions to a code buffer.
Some instructions support label offset arguments, which may be resolved by the `Assembler`
and encoded after all label addresses are assigned.The following are argument types:
- `Reg`: integer, SP, SIMD scalar, or SIMD vector register (with optional element index)
- `RegList`: list of sequential registers
- `Ref`: memory reference with register base, optionally followed by X register or immediate for post-indexing
- `RefOffset`: memory reference with register base and immediate offset
- `RefPreIndexed`: pre-indexed memory reference with register base and immediate offset
- `RefIndexed`: memory index with register base, register index, and optional index modifier
- `Imm`: 32-bit immediate integer
- `Float`: 32-bit immediate float
- `Wide`: 64-bit immediate integer
- `Mod`: modifier with optional immediate shift/rotate
- `Label`: label reference with optional offset from label address
- `Symbol`: constant identifier## Additional References
- [Package Documentation (pkg.go.dev)](https://pkg.go.dev/github.com/wdamron/arm)
- [Full Instruction Listing (INSTRUCTIONS.md)](./INSTRUCTIONS.md)
- [Basic Test Examples (asm_test.go)](./asm_test.go)
- [AArch64 Instruction Set Architecture (developer.arm.com)](https://developer.arm.com/documentation/102374/latest/)