#include
void my_memcpy(unsigned char * dst, unsigned char * src, size_t cnt)
{
int i;
for (i = 0; i < cnt; i++)
dst[i] = src[i];
}
void main()
{
}
#if 0
/*
* intel
*/
0000000000001129
1129: f3 0f 1e fa endbr64
112d: 55 push %rbp
112e: 48 89 e5 mov %rsp,%rbp
1131: 48 89 7d e8 mov %rdi,-0x18(%rbp) // dst
1135: 48 89 75 e0 mov %rsi,-0x20(%rbp) // src
1139: 48 89 55 d8 mov %rdx,-0x28(%rbp) // cnt
113d: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%rbp) // i
1144: eb 23 jmp 1169
1146: 8b 45 fc mov -0x4(%rbp),%eax // i
1149: 48 63 d0 movslq %eax,%rdx
114c: 48 8b 45 e0 mov -0x20(%rbp),%rax // src
1150: 48 01 d0 add %rdx,%rax // src+i
1153: 8b 55 fc mov -0x4(%rbp),%edx // i
1156: 48 63 ca movslq %edx,%rcx
1159: 48 8b 55 e8 mov -0x18(%rbp),%rdx // dst
115d: 48 01 ca add %rcx,%rdx // dst+i
1160: 0f b6 00 movzbl (%rax),%eax // eax=src[i]
1163: 88 02 mov %al,(%rdx) // dst[i]=al=src[i]
1165: 83 45 fc 01 addl $0x1,-0x4(%rbp)
1169: 8b 45 fc mov -0x4(%rbp),%eax
116c: 48 98 cltq
116e: 48 39 45 d8 cmp %rax,-0x28(%rbp)
1172: 77 d2 ja 1146
1174: 90 nop
1175: 90 nop
1176: 5d pop %rbp
1177: c3 retq
0000000000001178
1178: f3 0f 1e fa endbr64
117c: 55 push %rbp
117d: 48 89 e5 mov %rsp,%rbp
1180: 90 nop
1181: 5d pop %rbp
1182: c3 retq
1183: 66 2e 0f 1f 84 00 00 nopw %cs:0x0(%rax,%rax,1)
118a: 00 00 00
118d: 0f 1f 00 nopl (%rax)
/*
* arm
*/
000000000040051c
40051c: d100c3ff sub sp, sp, #0x30
400520: f9000fe0 str x0, [sp, #24]
400524: f9000be1 str x1, [sp, #16]
400528: f90007e2 str x2, [sp, #8]
40052c: b9002fff str wzr, [sp, #44]
400530: 1400000c b 400560
400534: b9802fe0 ldrsw x0, [sp, #44]
400538: f9400be1 ldr x1, [sp, #16]
40053c: 8b000021 add x1, x1, x0
400540: b9802fe0 ldrsw x0, [sp, #44]
400544: f9400fe2 ldr x2, [sp, #24]
400548: 8b000040 add x0, x2, x0
40054c: 39400021 ldrb w1, [x1]
400550: 39000001 strb w1, [x0]
400554: b9402fe0 ldr w0, [sp, #44]
400558: 11000400 add w0, w0, #0x1
40055c: b9002fe0 str w0, [sp, #44]
400560: b9802fe0 ldrsw x0, [sp, #44]
400564: f94007e1 ldr x1, [sp, #8]
400568: eb00003f cmp x1, x0
40056c: 54fffe48 b.hi 400534
400570: d503201f nop
400574: 9100c3ff add sp, sp, #0x30
400578: d65f03c0 ret
000000000040057c
40057c: d503201f nop
400580: d65f03c0 ret
400584: 00000000 .inst 0x00000000 ; undefined
#endif