I'm currently studying ARM assembly with R pi I'm doing "calling convention" between C and ARM. In "main.s", the program takes 3 user inputs and passes them to a function in function.c, and this function will return char * output. Finally, the program will print the output.
The question is, in this case, what the type of char * output looks like in ARM. In my understand, in ARM, the function will return the output into 'r0'. However, when I print out this 'r0', it shows strange characters...
In my main.s,
ldr r0, =string
ldr r1, =sindex
ldr r2, =eindex
bl sub_string
ldr r1, =s_string
str r0, [r1]
@print substring
ldr r0, =result @"The substring of the given string is '%s'
ldr r1, =s_string
bl printf
pop {ip, pc}
and the result is
The substring of the given string is 'Strange character'