about summary refs log tree commit diff stats
path: root/apps/ex8.mu
diff options
context:
space:
mode:
Diffstat (limited to 'apps/ex8.mu')
-rw-r--r--apps/ex8.mu12
1 files changed, 12 insertions, 0 deletions
diff --git a/apps/ex8.mu b/apps/ex8.mu
new file mode 100644
index 00000000..c5e695ed
--- /dev/null
+++ b/apps/ex8.mu
@@ -0,0 +1,12 @@
+# Demo of floating-point support.
+#
+# To build a disk image:
+#   ./translate apps/ex8.mu        # emits code.img
+# To run:
+#   bochs -f bochsrc               # bochsrc loads code.img
+# Set a breakpoint at 0x7c00 and start stepping.
+
+fn main screen: (addr screen), keyboard: (addr keyboard), data-disk: (addr disk) {
+  var n/eax: int <- copy 0
+  var result/xmm0: float <- convert n
+}