Implemented more arm64 instructions

This commit is contained in:
Eduard Urbach 2025-03-06 23:13:14 +01:00
parent 1832d2c73b
commit 014f161633
Signed by: eduard
GPG key ID: 49226B848C78F6C8
26 changed files with 232 additions and 73 deletions

13
src/arm/Load.go Normal file
View file

@ -0,0 +1,13 @@
package arm
import "git.urbach.dev/cli/q/src/cpu"
// LoadRegister loads from memory into a register.
func LoadRegister(destination cpu.Register, base cpu.Register, offset int16, length byte) uint32 {
if offset < 0 {
offset &= 0xFF
offset |= 1 << 8
}
return 0b11111000010<<21 | uint32(offset)<<12 | uint32(base)<<5 | uint32(destination)
}