I tried to compile this assembly program for printing "Hello World" on our Raspberry Pi server. It prints out the string but then gives me a segfault. Anybody know why?
@ hello.s
@ D. Thiebaut
@ Just your regular Hello World program!
@
@ Data Section
@
.data
string: .asciz "\nHello World!\n"
@
@ Code Section
@
.text
.global main
.extern printf
main:
push {ip, lr}
ldr r0, =string
bl printf
@ To Compile:
@ as -o hello.o hello.s
@ gcc -o hello hello.o