summaryrefslogtreecommitdiff
path: root/tests/alu
diff options
context:
space:
mode:
Diffstat (limited to 'tests/alu')
-rw-r--r--tests/alu19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/alu b/tests/alu
new file mode 100644
index 0000000..7496359
--- /dev/null
+++ b/tests/alu
@@ -0,0 +1,19 @@
+# X op Y = RESULT ZERO CARRY
+#
+# Operations:
+# + : add
+# - : subtract
+# * : multiply
+# / : divide
+# & : and
+# | : or
+# ^ : xor
+
+0x0123 + 0x1234 = 0x1357 Z=0 C=0
+0x0123 - 0x1234 = 0xeeef Z=0 C=1
+0x0123 - 0x0123 = 0x0000 Z=1 C=0
+0x0123 * 0x1234 = 0xb11c Z=0 C=0
+0x3e58 / 0x0078 = 0x0085 Z=0 C=0
+0xaf74 & 0x7cc7 = 0x2c44 Z=0 C=0
+0xaf74 | 0x7cc7 = 0xfff7 Z=0 C=0
+0xaf74 ^ 0x7cc7 = 0xd3b3 Z=0 C=0