标签:
#pragma check_stack( off) LPVOID __cdecl _memcpy(void * dst, void* src, size_t size) { int dwSize = size/4; int byteSize = size%4; __asm{ mov edi,dst mov esi,src mov ecx,dwSize rep movs dword ptr es:[edi],dword ptr ds:[esi] mov ecx,byteSize rep movs byte ptr es:[edi],byte ptr ds:[esi] } return dst; } #pragma check_stack( off) LPVOID __cdecl __memset( void * dst, int val, size_t size) { int dwSize = size/4; int byteSize = size%4; int fixVal; __asm{ mov eax,val lea edi, fixVal mov ecx,4 rep stos byte ptr es:[edi] mov eax, fixVal mov ecx, dwSize mov edi,dst rep stos dword ptr es:[edi] mov ecx, byteSize rep stos byte ptr es:[edi] } return dst; }
标签:
原文地址:http://www.cnblogs.com/lyo1005/p/4612647.html