diff options
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 |
