1 #include <stdio.h>
2 void my_strcpy(const char *src, char *dst)
3 {
4 int ch;
5 __asm
6 {
7 loop:
8 ldrb ch, [src], #1
9 strb ch, [dst], #1
10 cmp ch, #0
11 bne loop
12 }
13 }
14 int main(void)
15 {
16 const char *a = hello world!;
17 char b[20];
18 my_strcpy (a,b);
19 printf(original string: '%s'\n, a);
20 printf(copied string: '%s'\n, b);
21 return 0;
22 }