So i'm writing an ARMv8 assembly program using subroutines. I'm using the 'bl' command to jump to and return from a specific subroutine, but at the end of the subroutine it is not returning.
main: stp x29, x30, [sp,-16]!
mov x29, x30
bl newPyr
bl print
ldp x29, x30, [sp], 16
ret
print: adrp x0, title
add x0, x0, :lo12:title
bl printf
adrp x0, origin
add x0, x0, :lo12:origin
ldr w1, [p_base,first_start+pyramid_start+origin_x]
mov w2, w1
bl printf
ret
there is more to the program that i haven't included but the rest is all working fine. Basically in main it runs the newPyr subroutine and when its done it returns and then runs the print subroutine. newPry works fine, but print does not. It will display the appropriate message, but when it reaches the ret, nothing happens. I'm pretty new to assembly and subroutines. any ideas?