Here is my ARM7 assembly snippet
.global strCopy
.text
strCopy:
strCopyloop:
LDRB R2, [R1], #1
STRB R2, [R0], #1
CMP R2, #0
BNE strCopyloop
Bx LR
Here is the C file that is using this function
#include <stdlib.h>
#include <stdio.h>
#include <stdint.h>
extern void strCopy(char* strTo, const char* strFrom);
int main(){
const char* str1 ="This one";
char* str2;
strCopy(str2,str1);
return 0;
}
I cant for the life of me figure out why its giving me a segmentation fault.