Save as hello.S file
```
data
msg:
    .ascii        "Hello, ARM64!\n"
len = . - msg
.text

.globl _start
_start:
    mov     x0, #1      /* fd := STDOUT_FILENO */
    ldr     x1, =msg    /* buf := msg */
    ldr     x2, =len    /* count := len */
    mov     w8, #64     /* write is syscall #64 */
    svc     #0          /* invoke syscall */

    mov     x0, #0      /* status := 0 */
    mov     w8, #93     /* exit is syscall #93 */
    svc     #0          /* invoke syscall */
```

Then execute these commands:

as -o hello.o hello.S
ld -s -o hello hello.o

Mind you thats what I done on asahi arch linux, not sure if its different on 
OpenBSD.

Anyone please feel free to correct if its wrong.

Reply via email to