commit 0b1c9fa41f872dfe10dae9ec06f0662f5dcc4069
parent 6c71f9a1d984b525595dce8ef3b2f7372e2a9e58
Author: Brian Swetland <swetland@frotz.net>
Date: Mon, 3 Dec 2018 14:47:42 -0800
cpu16: some more alu tests
Diffstat:
2 files changed, 42 insertions(+), 0 deletions(-)
diff --git a/tests/006-rotate-ops.s b/tests/006-rotate-ops.s
@@ -0,0 +1,21 @@
+mov r0, 0x1234
+shl r1, r0, 4
+rol r2, r0, 4
+ror r3, r0, 4
+ror r4, r3, 1
+rol r5, r4, 1
+shl r6, r5, 4
+rol r7, r6, 1
+nop
+nop
+halt
+
+;R0 1234
+;R1 2340
+;R2 2341
+;R3 4123
+;R4 a091
+;R5 4123
+;R6 1230
+;R7 2460
+
diff --git a/tests/007-swizzle-ops.a b/tests/007-swizzle-ops.a
@@ -0,0 +1,21 @@
+mov r0, 0x1234
+mov r1, 0xa7b6
+dup r2, r0, r1
+swp r3, r0, r0
+dup r4, r0, r0
+swp r5, r1, r1
+dup r6, r1, r0
+swp r7, r1, r0
+nop
+nop
+halt
+
+;R0 1234
+;R1 a7b6
+;R2 34b6
+;R3 3412
+;R4 3434
+;R5 b6a7
+;R6 b634
+;R7 b612
+