about summary refs log tree commit diff stats
path: root/apps/ex1.mu
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2020-01-02 14:12:46 -0800
committerKartik Agaram <vc@akkartik.com>2020-01-02 14:12:46 -0800
commit8bbafb13974bbfd7223e8c69156493a123702c0d (patch)
tree5226f807ced58b0c4f96ec59f596834e2f31ea81 /apps/ex1.mu
parent42b4da908edc6a35a864bd656aca737f70823adf (diff)
downloadmu-8bbafb13974bbfd7223e8c69156493a123702c0d.tar.gz
5872
Diffstat (limited to 'apps/ex1.mu')
-rw-r--r--apps/ex1.mu13
1 files changed, 13 insertions, 0 deletions
diff --git a/apps/ex1.mu b/apps/ex1.mu
new file mode 100644
index 00000000..f6d67001
--- /dev/null
+++ b/apps/ex1.mu
@@ -0,0 +1,13 @@
+# First example: return the answer to the Ultimate Question of Life, the
+# Universe, and Everything.
+#
+# To run:
+#   $ ./translate_mu apps/ex1.mu
+#   $ ./a.elf
+# Expected result:
+#   $ echo $?
+#   42
+
+fn main -> result/ebx: int {
+  result <- copy 0x2a  # Mu requires hexadecimal
+}