aboutsummaryrefslogtreecommitdiff
path: root/tests/stack_machine_old_store/instructions.s.tcl
diff options
context:
space:
mode:
Diffstat (limited to 'tests/stack_machine_old_store/instructions.s.tcl')
-rwxr-xr-xtests/stack_machine_old_store/instructions.s.tcl29
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/stack_machine_old_store/instructions.s.tcl b/tests/stack_machine_old_store/instructions.s.tcl
new file mode 100755
index 0000000..ddc3a8e
--- /dev/null
+++ b/tests/stack_machine_old_store/instructions.s.tcl
@@ -0,0 +1,29 @@
+#!/usr/bin/env tclsh
+
+source tclasm.tcl
+
+### simple test - write value hDEADBEEF to address h3ABCD
+
+## get value hDEADBEEF into r1
+
+# DDDD EEEE AA
+# bits 31:22 of hDEADBEEF are 1101 1110 10
+_immediate im<<=b1101111010
+# AA DDDD BBBB E
+# bits 21:11 of hDEADBEEF are 10 1101 1011 1
+_immediate im<<=b10110110111
+# EEE EEEE FFFF
+# bits 10:0 of hDEADBEEF are 110 1110 1111
+_exchange_im im<<=b11011101111
+
+## get address h7579A into im
+
+# 7777 5555 7
+# bits 19:11 of h7579A are 0111 0101 0
+_immediate im=b011101010
+# 777 9999 AAAA
+# bits 10:0 of h7579A are 111 1001 1010
+store im<<=b11110011010
+
+## finish test
+halt