summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBobby Bingham <koorogi@koorogi.info>2017-01-08 19:33:35 -0600
committerBobby Bingham <koorogi@koorogi.info>2017-01-08 22:02:28 -0600
commite601b9315384792b82517ba3ab30cee316295558 (patch)
tree6ec92d0d61c918b057490b12a9d3eca6337bffb2 /tests
parent8d316df61f4b01b6fcd8ca211faa6cb146127528 (diff)
add ALU test for shift operations
Diffstat (limited to 'tests')
-rw-r--r--tests/alu24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/alu b/tests/alu
index 7496359..474acbb 100644
--- a/tests/alu
+++ b/tests/alu
@@ -8,6 +8,14 @@
# & : and
# | : or
# ^ : xor
+# << : left shift extended with zeros
+# <<1 : left shift extended with ones
+# <<- : left shift extended with least significant bit
+# <<< : left rotate
+# >> : right shift extended with zeros
+# 1>> : right shift extended with ones
+# ->> : right shift extended with most significant bit
+# >>> : right rotate
0x0123 + 0x1234 = 0x1357 Z=0 C=0
0x0123 - 0x1234 = 0xeeef Z=0 C=1
@@ -17,3 +25,19 @@
0xaf74 & 0x7cc7 = 0x2c44 Z=0 C=0
0xaf74 | 0x7cc7 = 0xfff7 Z=0 C=0
0xaf74 ^ 0x7cc7 = 0xd3b3 Z=0 C=0
+0xfa0a << 0x01 = 0xf414 Z=0 C=0
+0xfa0a << 0x02 = 0xe828 Z=0 C=0
+0xfa0a >> 0x02 = 0x3e82 Z=0 C=0
+0xfa0a >> 0x04 = 0x0fa0 Z=0 C=0
+0xfa0a << 0x04 = 0xa0a0 Z=0 C=0
+0xfa0a <<1 0x04 = 0xa0af Z=0 C=0
+0xfa0a 1>> 0x04 = 0xffa0 Z=0 C=0
+0xfa0a <<- 0x04 = 0xa0a0 Z=0 C=0
+0xfa0a ->> 0x04 = 0xffa0 Z=0 C=0
+0xfa0a >>> 0x04 = 0xafa0 Z=0 C=0
+0xfa0a <<< 0x04 = 0xa0af Z=0 C=0
+0x0001 <<- 0x0e = 0x7fff Z=0 C=0
+0x0001 <<- 0x10 = 0xffff Z=0 C=0
+0x0001 ->> 0x10 = 0x0000 Z=1 C=0
+0x0001 <<- 0xff = 0xffff Z=0 C=0
+0x0001 ->> 0xff = 0x0000 Z=1 C=0