Hello world in assembly language ARM64 (AArch64, ARMv8)


.text //code section
.globl _start
_start:
	mov x0, 0     // stdout has file descriptor 0
	ldr x1, =msg  // buffer to write
	mov x2, len   // size of buffer
	mov x8, 64    // sys_write() is at index 64 in kernel functions table
	svc #0        // generate kernel call sys_write(stdout, msg, len);
	
	mov x0, 123 // exit code
	mov x8, 93  // sys_exit() is at index 93 in kernel functions table
	svc #0      // generate kernel call sys_exit(123);

.data //data section
msg:
    .ascii      "Hello, ARM!\n"
len = . - msg

"g:\virtualpc\gcc_arm64_4_8\bin\aarch64-linux-gnu-as.exe" -o hello.o hello.s

"g:\virtualpc\gcc_arm64_4_8\bin\aarch64-linux-gnu-ld.exe" -o hello hello.o