aboutsummaryrefslogtreecommitdiff
path: root/examples/hello_world.hdass
diff options
context:
space:
mode:
Diffstat (limited to 'examples/hello_world.hdass')
-rw-r--r--examples/hello_world.hdass19
1 files changed, 19 insertions, 0 deletions
diff --git a/examples/hello_world.hdass b/examples/hello_world.hdass
new file mode 100644
index 0000000..59dac80
--- /dev/null
+++ b/examples/hello_world.hdass
@@ -0,0 +1,19 @@
+const SYS_WRITE = 1
+const SYS_EXIT = 60
+
+const STDOUT = 1
+
+data message = "Hello, World!\n"
+
+proc main
+{
+ rax = SYS_WRITE
+ rdi = STDOUT
+ rsi = message
+ rdx = message.len
+ syscall
+
+ rax = SYS_EXIT
+ rdi = 0
+ syscall
+}