]> git.proxmox.com Git - mirror_edk2.git/blame - EdkCompatibilityPkg/Foundation/Library/CompilerStub/Ia32/memcpyRep1.asm
Update the copyright notice format
[mirror_edk2.git] / EdkCompatibilityPkg / Foundation / Library / CompilerStub / Ia32 / memcpyRep1.asm
CommitLineData
c7f33ca4 1;------------------------------------------------------------------------------\r
2;\r
4ea9375a
HT
3; Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>\r
4; This program and the accompanying materials\r
c7f33ca4 5; are licensed and made available under the terms and conditions of the BSD License\r
6; which accompanies this distribution. The full text of the license may be found at\r
7; http://opensource.org/licenses/bsd-license.php\r
8;\r
9; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
10; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
11;\r
12; Module Name:\r
13;\r
14; CopyMem.asm\r
15;\r
16; Abstract:\r
17;\r
18; memcpy function\r
19;\r
20; Notes:\r
21;\r
22;------------------------------------------------------------------------------\r
23\r
24 .686\r
25 .model flat,C\r
26 .code\r
27\r
28;------------------------------------------------------------------------------\r
29; VOID *\r
30; memcpy (\r
31; IN VOID *Destination,\r
32; IN VOID *Source,\r
33; IN UINTN Count\r
34; );\r
35;------------------------------------------------------------------------------\r
36memcpy PROC USES esi edi\r
37 mov esi, [esp + 16] ; esi <- Source\r
38 mov edi, [esp + 12] ; edi <- Destination\r
39 mov edx, [esp + 20] ; edx <- Count\r
40 cmp esi, edi\r
41 je @CopyDone\r
42 cmp edx, 0\r
43 je @CopyDone\r
44 lea eax, [esi + edx - 1] ; eax <- End of Source\r
45 cmp esi, edi\r
46 jae @F\r
47 cmp eax, edi\r
48 jb @F ; Copy backward if overlapped\r
49 mov esi, eax ; esi <- End of Source\r
50 lea edi, [edi + edx - 1] ; edi <- End of Destination\r
51 std\r
52@@:\r
53 mov ecx, edx\r
54 rep movsb ; Copy bytes backward\r
55 cld\r
56@CopyDone:\r
57 mov eax, [esp + 12]\r
58 ret\r
59memcpy ENDP\r
60\r
61 END\r