From 3e20038bbf7206e2270655418d7884ccfe91a4e4 Mon Sep 17 00:00:00 2001 From: hachem Date: Mon, 31 Aug 2026 00:19:10 +0200 Subject: add directives and directive based entry points --- examples/fibonacci.hdasm | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'examples/fibonacci.hdasm') diff --git a/examples/fibonacci.hdasm b/examples/fibonacci.hdasm index 58f71fe..95a59c8 100644 --- a/examples/fibonacci.hdasm +++ b/examples/fibonacci.hdasm @@ -1,3 +1,5 @@ +[entry: main] + const SYS_WRITE = 1 const SYS_EXIT = 60 @@ -41,7 +43,7 @@ proc main { r12 = 0 r13 = 1 - rcx = 10 + r15 = 10 // syscall clobbers rcx/r11, so keep the counter in r15 loop: print_number(r12) @@ -50,8 +52,8 @@ loop: r12 = r13 r13 += rax - rcx -= 1 - if rcx != 0 + r15 -= 1 + if r15 != 0 goto loop rax = SYS_EXIT -- cgit v1.3