Bitwise operators
This commit is contained in:
@@ -94,6 +94,47 @@ functions:
|
||||
expectGlobalMemorySigned(t, state, 2, 1)
|
||||
}
|
||||
|
||||
func TestNot(t *testing.T) {
|
||||
state := assembleAndExecute(t, `
|
||||
functions:
|
||||
- - [mov, g0, 8]
|
||||
- [not, g0]
|
||||
- [and, g0, 15]
|
||||
`)
|
||||
|
||||
expectGlobalMemory(t, state, 0, 7)
|
||||
}
|
||||
|
||||
func TestAnd(t *testing.T) {
|
||||
state := assembleAndExecute(t, `
|
||||
functions:
|
||||
- - [mov, g0, 7]
|
||||
- [and, g0, 18]
|
||||
`)
|
||||
|
||||
expectGlobalMemory(t, state, 0, 2)
|
||||
}
|
||||
|
||||
func TestOr(t *testing.T) {
|
||||
state := assembleAndExecute(t, `
|
||||
functions:
|
||||
- - [mov, g0, 7]
|
||||
- [or, g0, 18]
|
||||
`)
|
||||
|
||||
expectGlobalMemory(t, state, 0, 23)
|
||||
}
|
||||
|
||||
func TestXor(t *testing.T) {
|
||||
state := assembleAndExecute(t, `
|
||||
functions:
|
||||
- - [mov, g0, 7]
|
||||
- [xor, g0, 18]
|
||||
`)
|
||||
|
||||
expectGlobalMemory(t, state, 0, 21)
|
||||
}
|
||||
|
||||
func TestEq(t *testing.T) {
|
||||
state := assembleAndExecute(t, `
|
||||
functions:
|
||||
|
||||
Reference in New Issue
Block a user