From 62636576bce8e8121a3d70f63547fae40a52f697 Mon Sep 17 00:00:00 2001 From: hachem Date: Mon, 12 Oct 2026 11:41:05 +0200 Subject: chore: refactor --- examples/records.hdass | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'examples/records.hdass') 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 -- cgit v1.3