So I'm writing a subroutine in ARM assembly in CCSv6 that counts the length of a string passed to it by a C program. The subroutine works fine, and it returns the numerical count to the calling function in C via R0. This works, but when another subroutine is called from this C function, R0 gets replaced by other things, as I would expect, but the value in the C program is then changed to whatever is in R0. I can't seem to save this value permanently. I've tried creating an independent C variable and copying the value, which also doesn't work. Any thoughts?
Aucun commentaire:
Enregistrer un commentaire