hachem.wtf
aboutsummaryrefslogtreecommitdiff
path: root/examples/logical.hdass
diff options
context:
space:
mode:
authorhachem <im@hachem.wtf>2026-10-12 11:41:05 +0200
committerhachem <im@hachem.wtf>2026-10-12 11:41:05 +0200
commit62636576bce8e8121a3d70f63547fae40a52f697 (patch)
tree077dfe4f04235cce63b7abb1b05bb539232ae74a /examples/logical.hdass
parentc0f000ea166a24781fcdbf23c080b203cd9b8ed7 (diff)
chore: refactor
Diffstat (limited to 'examples/logical.hdass')
-rw-r--r--examples/logical.hdass13
1 files changed, 5 insertions, 8 deletions
diff --git a/examples/logical.hdass b/examples/logical.hdass
index 5fb27fc..1b7dd2a 100644
--- a/examples/logical.hdass
+++ b/examples/logical.hdass
@@ -1,19 +1,16 @@
[entry: main]
[enable: logical_registers]
-// With the logical_registers extension, r1..r14 name the general-purpose
-// registers (r1 = rax, r2 = rbx, ...) instead of the architecture names.
-// Computes (4 + 3) * 3 = 21 and returns it as the exit status.
const SYS_EXIT = 60
proc main
{
- r1 = 4 // rax
- r2 = 3 // rbx
- r1 += r2 // 7
- r1 *= r2 // 21
+ r1 = 4
+ r2 = 3
+ r1 += r2
+ r1 *= r2
- r6 = r1 // rdi = 21 (the exit status)
+ r6 = r1
r1 = SYS_EXIT
syscall
}