Implemented more arm64 instructions
This commit is contained in:
parent
1832d2c73b
commit
014f161633
26 changed files with 232 additions and 73 deletions
13
src/arm/Load.go
Normal file
13
src/arm/Load.go
Normal 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)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue