about summary refs log tree commit diff stats
path: root/subx/ex1.1.subx
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2018-06-30 22:00:52 -0700
committerKartik Agaram <vc@akkartik.com>2018-06-30 22:00:52 -0700
commitc7e5f1bfe84e9046030a05194fde91b12b37d366 (patch)
tree64759aa83b065e4f1e12aa6a2524e2d91b6eefe0 /subx/ex1.1.subx
parentda5968f71e35f308d86f910b80a8715fcf684ffa (diff)
downloadmu-c7e5f1bfe84e9046030a05194fde91b12b37d366.tar.gz
4296
Diffstat (limited to 'subx/ex1.1.subx')
-rw-r--r--subx/ex1.1.subx14
1 files changed, 14 insertions, 0 deletions
diff --git a/subx/ex1.1.subx b/subx/ex1.1.subx
new file mode 100644
index 00000000..9e20d443
--- /dev/null
+++ b/subx/ex1.1.subx
@@ -0,0 +1,14 @@
+## first program: same as https://www.muppetlabs.com/~breadbox/software/tiny/teensy.html
+#
+# To run:
+#   $ subx translate ex1.1.subx ex1
+#   $ subx run ex1
+
+# opcode        ModR/M                    SIB                   displacement    immediate
+# instruction   mod, reg, Reg/Mem bits    scale, index, base
+# 1-3 bytes     0/1 byte                  0/1 byte              0/1/2/4 bytes   0/1/2/4 bytes
+  bb                                                                            2a 00 00 00  # copy 0x2a (42) to EBX
+  05                                                                            01 00 00 00  # copy 1 to EAX
+  cd                                                                            80           # int 80h
+
+# vim:ft=subx