about summary refs log tree commit diff stats
path: root/subx/examples/ex6.k2
diff options
context:
space:
mode:
Diffstat (limited to 'subx/examples/ex6.k2')
-rw-r--r--subx/examples/ex6.k213
1 files changed, 13 insertions, 0 deletions
diff --git a/subx/examples/ex6.k2 b/subx/examples/ex6.k2
new file mode 100644
index 00000000..d9b54dd4
--- /dev/null
+++ b/subx/examples/ex6.k2
@@ -0,0 +1,13 @@
+var size : int = 14
+var x : (array character) = "hello, world!"
+
+fn main [
+  call write 1/stdout, x, size
+  call exit, 0
+]
+
+fn exit x : int [
+  code/EBX <- copy x
+  code/EAX <- copy 1/exit
+  syscall
+]