sl@0: // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of the License "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // e32\klib\x86\cumem.cia sl@0: // sl@0: // sl@0: sl@0: #include sl@0: sl@0: extern "C" { sl@0: sl@0: __NAKED__ void CopyInterSeg() sl@0: // sl@0: // Copy ECX bytes from DS:ESI to ES:EDI sl@0: // Modifies EAX, EBX, ECX, EDX, ESI, EDI sl@0: // sl@0: { sl@0: asm("pushfd"); sl@0: asm("cld"); // assume forward copy initially sl@0: asm("test ecx,ecx"); // sl@0: asm("jz short memcopy0");// if length=0, nothing to do sl@0: asm("xor edx,edx"); // sl@0: asm("cmp edi,esi"); // compare source and dest addresses sl@0: asm("jc short memcopy1");// if dest