//
// Assembler program to print "Hello World!"
// to stdout.
//
// X0-X2 - parameters to system services
// X8    - system call number
//
.global _start   // Provide program starting address to linker

// Setup the parameters to print hello world and then call the system to do it.

_start: mov X0, #1          // 1 = stdout.
        ldr X1, =helloworld // String to print.
        mov X2, #13         // Length of string.
        mov X8, #64         // Linux write system call.
        svc 0               // Call the system to output the string.

// Setup the parameters to exit the program and then call the system to do it.

        mov X0, #0         // Use 0 return code to indicate success.
        mov X8, #93        // Linux terminate program system call.
        svc 0              // Call the system to terminate the program.

.data
helloworld: .ascii  "Hello World!\n"
