aboutsummaryrefslogtreecommitdiff
path: root/examples/load.hdass
diff options
context:
space:
mode:
authorhachem <im@hachem.wtf>2026-08-31 16:56:40 +0200
committerhachem <im@hachem.wtf>2026-08-31 16:56:40 +0200
commit53aed3fadf1f7ad66dea9a8a0b46bf42eda921be (patch)
treeea14a08b29a18072d1e420353a39c1397f85bee2 /examples/load.hdass
parentf8a2d02c75df62f74e5907696d5a99a024d59018 (diff)
feat: add memory loads via ^reg
Diffstat (limited to 'examples/load.hdass')
-rw-r--r--examples/load.hdass17
1 files changed, 17 insertions, 0 deletions
diff --git a/examples/load.hdass b/examples/load.hdass
new file mode 100644
index 0000000..6e68ffc
--- /dev/null
+++ b/examples/load.hdass
@@ -0,0 +1,17 @@
+[entry: main]
+
+// Stores 7 into a stack cell, loads it back through a pointer, and exits with it.
+const SYS_EXIT = 60
+
+proc main
+{
+ stack cell[8]
+
+ rbx = 7
+ rsi = cell // address of the cell
+ ^rsi = rbx // store
+ rdi = ^rsi // load it back
+
+ rax = SYS_EXIT
+ syscall
+}