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/records.hdass | |
| parent | c0f000ea166a24781fcdbf23c080b203cd9b8ed7 (diff) | |
chore: refactor
Diffstat (limited to 'examples/records.hdass')
| -rw-r--r-- | examples/records.hdass | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/examples/records.hdass b/examples/records.hdass index 8e87a4c..a6d5659 100644 --- a/examples/records.hdass +++ b/examples/records.hdass @@ -1,7 +1,5 @@ [entry: main] -// An enum of status codes and a struct describing a memory layout. Stores two -// fields into a stack instance, reads them back, and exits with their sum. enum Status { Ok, @@ -24,20 +22,20 @@ proc main rsi = pair rsi += Pair.a rbx = 40 - ^rsi = rbx // pair.a + ^rsi = rbx rsi = pair rsi += Pair.b - rcx = Status.Fail // 2 - ^rsi = rcx // pair.b + rcx = Status.Fail + ^rsi = rcx rsi = pair rsi += Pair.a - rdi = ^rsi // load a = 40 + rdi = ^rsi rsi = pair rsi += Pair.b - rax = ^rsi // load b = 2 - rdi += rax // 42 + rax = ^rsi + rdi += rax rax = SYS_EXIT syscall |
