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);