If any must be used, they must be saved before use, and restored before returning. Registers r4-r11 must be preserved by a subroutine. These registers are corruptible by the subroutine. Registers r0-r3 and r12 can be used for temporary storage if they were not used for arguments, or if the argument value is no longer needed. If there are more than four arguments, or they are too large to fit in the 32-bit registers, they are passed on the stack. The arguments (if any) are passed in registers r0-r3, starting with r0. When a function calls a subroutine, it places the return address in the link register lr. There are certain register use conventions which must be followed for the assembly code to coexist with the C code. Register usage and the Arm Procedure Call Standard Void my_strcpy(const char *src, char *dst) This function creates two character arrays, a and b, and calls two functions, my_strcpy and my_capitalize, that shall be implemented later. The main FunctionĬreate the main C function. Right-click Source Group 1 and select Add New Item. You will create a C application, but add assembly language subroutines to perform string copy and capitalization operations.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |