From ced273944b0a03216d0168c46bfcb44950d3301c Mon Sep 17 00:00:00 2001 From: Enrico Lumetti Date: Wed, 5 May 2021 20:55:19 +0200 Subject: [PATCH] Add conclusion and rename _main to start --- aarch64-hello.s | 9 +++++---- runtime.s | 6 ++++-- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/aarch64-hello.s b/aarch64-hello.s index 2142ffb..75b33a9 100644 --- a/aarch64-hello.s +++ b/aarch64-hello.s @@ -1,5 +1,6 @@ -.global _main +.global start -_main: - mov x0, 42 // exit code - ret +start: + mov x0, 1 + add x0, x0, 41 + b conclusion diff --git a/runtime.s b/runtime.s index 44f3fcf..406b1c3 100644 --- a/runtime.s +++ b/runtime.s @@ -1,5 +1,7 @@ -.global main +.global main, conclusion main: - bl _main + b start + +conclusion: mov x8, 93 // sys_exit() is at index 93 in kernel functions table svc #0 // generate kernel call sys_exit(123);