I just compiled a simple program that would add two number and will print on console.I have compiled it on RPI board.I think it is compiled fine but when I run I am getting segmentation fault.
.text
.global main
.extern print
out:
.ascii "THE sum is %d\n\0"
main:
push {ip,lr}
mov r0,#5
mov r1,#4
add r2,r1,r0
ldr r2,=out
bl printf
pop {ip,pc}
stop: b stop
Is it because I didn't follow the ARM EABI properly?
Could anyone let me know where I am doing wrong?