Bit shift operators

This commit is contained in:
Ian Gulliver
2021-11-19 17:04:11 -10:00
parent e2dafcf21a
commit c536961df3
4 changed files with 66 additions and 18 deletions

View File

@@ -135,6 +135,26 @@ functions:
expectGlobalMemory(t, state, 0, 21)
}
func TestShR(t *testing.T) {
state := assembleAndExecute(t, `
functions:
- - [mov, g0, 53]
- [shr, g0, 2]
`)
expectGlobalMemory(t, state, 0, 13)
}
func TestShL(t *testing.T) {
state := assembleAndExecute(t, `
functions:
- - [mov, g0, 53]
- [shl, g0, 2]
`)
expectGlobalMemory(t, state, 0, 212)
}
func TestEq(t *testing.T) {
state := assembleAndExecute(t, `
functions: