Added basic support for arm64

This commit is contained in:
2025-03-06 13:40:17 +01:00
parent 14abb8202b
commit 2f09b96f34
25 changed files with 270 additions and 33 deletions

10
src/arm/Call.go Normal file
View File

@ -0,0 +1,10 @@
package arm
import "encoding/binary"
// Call branches to a PC-relative offset, setting the register X30 to PC+4.
// The offset starts from the address of this instruction and is encoded as "imm26" times 4.
// This instruction is also known as BL (branch with link).
func Call(code []byte, offset uint32) []byte {
return binary.LittleEndian.AppendUint32(code, uint32(0b100101<<26)|offset)
}