diff options
| author | hachem <im@hachem.wtf> | 2026-10-12 11:41:05 +0200 |
|---|---|---|
| committer | hachem <im@hachem.wtf> | 2026-10-12 11:41:05 +0200 |
| commit | 62636576bce8e8121a3d70f63547fae40a52f697 (patch) | |
| tree | 077dfe4f04235cce63b7abb1b05bb539232ae74a /examples/arm64 | |
| parent | c0f000ea166a24781fcdbf23c080b203cd9b8ed7 (diff) | |
chore: refactor
Diffstat (limited to 'examples/arm64')
| -rw-r--r-- | examples/arm64/exit.hdass | 7 | ||||
| -rw-r--r-- | examples/arm64/sum.hdass | 2 |
2 files changed, 2 insertions, 7 deletions
diff --git a/examples/arm64/exit.hdass b/examples/arm64/exit.hdass index a86e5e2..a7e89df 100644 --- a/examples/arm64/exit.hdass +++ b/examples/arm64/exit.hdass @@ -1,14 +1,11 @@ [entry: main] [enable: logical_registers] -// Exits with status 42 on AArch64 Linux. Logical registers map r1 -> x0 and -// r9 -> x8, so the exit code goes in x0 and the syscall number in x8; `syscall` -// lowers to `svc #0`. const SYS_EXIT = 93 proc main { - r1 = 42 // x0 = exit code - r9 = SYS_EXIT // x8 = syscall number + r1 = 42 + r9 = SYS_EXIT syscall } diff --git a/examples/arm64/sum.hdass b/examples/arm64/sum.hdass index 85820c9..6e93133 100644 --- a/examples/arm64/sum.hdass +++ b/examples/arm64/sum.hdass @@ -1,8 +1,6 @@ [entry: main] [enable: logical_registers] -// Sums 5 + 4 + 3 + 2 + 1 = 15 with a named countdown loop, returns it as the -// exit status. Shows three-operand arithmetic (r1 = r1 + r2 -> add x0, x0, x1). const SYS_EXIT = 93 proc main |
