aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/modulo.hdass15
1 files changed, 15 insertions, 0 deletions
diff --git a/examples/modulo.hdass b/examples/modulo.hdass
new file mode 100644
index 0000000..44c290d
--- /dev/null
+++ b/examples/modulo.hdass
@@ -0,0 +1,15 @@
+[entry: main]
+
+// Modulo: 2024 % 100 = 24, returned as the exit status.
+const SYS_EXIT = 60
+
+proc main
+{
+ rax = 2024
+ rbx = 100
+ rax %= rbx
+
+ rdi = rax
+ rax = SYS_EXIT
+ syscall
+}