aboutsummaryrefslogtreecommitdiffhomepage
path: root/problems/12-Convert-Endian
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2024-09-04 01:55:47 +0900
committernsfisis <nsfisis@gmail.com>2024-09-04 01:55:47 +0900
commitff5bd7ff8835e259dbcf6dc64771c68ee154c180 (patch)
tree550f87bb4500084734976c4f15d66772fdbacf44 /problems/12-Convert-Endian
parentfe91eb847f138d66e2662968c0867180f345e572 (diff)
downloadmncore-challenge-ff5bd7ff8835e259dbcf6dc64771c68ee154c180.tar.gz
mncore-challenge-ff5bd7ff8835e259dbcf6dc64771c68ee154c180.tar.zst
mncore-challenge-ff5bd7ff8835e259dbcf6dc64771c68ee154c180.zip
12-Convert-Endian (incomplete)
Diffstat (limited to 'problems/12-Convert-Endian')
-rw-r--r--problems/12-Convert-Endian/03.vsm22
1 files changed, 22 insertions, 0 deletions
diff --git a/problems/12-Convert-Endian/03.vsm b/problems/12-Convert-Endian/03.vsm
new file mode 100644
index 0000000..bd1791f
--- /dev/null
+++ b/problems/12-Convert-Endian/03.vsm
@@ -0,0 +1,22 @@
+# n = 6909045637428952499
+# bin = n.to_s(2).rjust(64, '0')
+# ds = bin.each_char.each_slice(8).map(&:join)
+#
+# puts n
+# 8.times { |i| puts "[#{i}] = #{ds[i]}" }
+# puts
+# 8.times { |i| puts "[#{i}] = #{ds[8-i-1]}" }
+# puts
+# puts
+
+imm i"8" $s1v2
+imm i"16" $s9v2
+imm i"32" $s17v2
+
+sbsl $lm0v $ls0v $lr0v
+
+d getd $lr0 1
+quit
+
+ibsl $aluf $ls8v $nowrite
+lbsl $aluf $ls16v $ln0v