| 123456789101112131415161718192021222324252627282930 |
- @
- @ Assembler program to print "Hello World!"
- @ to stdout
- @
- @ R0-R2 - parameters to Linux function services
- @ R7 - Linux function number
- @
- .global _start @ Provide program starting
- @ address to linker
- @ Set up the parameters to print hello world
- @ and then call Linux to do it.
- _start: mov R0, #1 @ 1 = StdOut
- ldr R1, =helloworld @ string to print
- mov R2, #13 @length of our string
- mov R7, #4 @ Linux write system call
- svc 0 @ Call Linux to print
- @ Set up the parameters to exit the program
- @ and then call Linux to do it.
- mov R0, #0 @ Use 0 return code
- mov R7, #1 @ Sevice command code 1
- @ terminates the program
- svc 0 @ Call Linux to terminate
- .data
- helloworld: .ascii "Hello World!\n"
|