Implemented more arm64 instructions
This commit is contained in:
parent
1832d2c73b
commit
014f161633
26 changed files with 232 additions and 73 deletions
26
src/arm/LoadAddress_test.go
Normal file
26
src/arm/LoadAddress_test.go
Normal file
|
@ -0,0 +1,26 @@
|
|||
package arm_test
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"git.urbach.dev/cli/q/src/arm"
|
||||
"git.urbach.dev/cli/q/src/cpu"
|
||||
"git.urbach.dev/go/assert"
|
||||
)
|
||||
|
||||
func TestLoadAddress(t *testing.T) {
|
||||
usagePatterns := []struct {
|
||||
Destination cpu.Register
|
||||
Number int
|
||||
Code uint32
|
||||
}{
|
||||
{arm.X0, 56, 0x100001C0},
|
||||
{arm.X1, 80, 0x10000281},
|
||||
}
|
||||
|
||||
for _, pattern := range usagePatterns {
|
||||
t.Logf("adr %s, %d", pattern.Destination, pattern.Number)
|
||||
code := arm.LoadAddress(pattern.Destination, pattern.Number)
|
||||
assert.DeepEqual(t, code, pattern.Code)
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue