#include<windows.h> #define ARRAY_SIZE (1024*1000) #define OVERLAP_ROOFING (1024) void Init_( void* pDest/*0x08*/ , int Size/*0x0C*/ , char InitValue/*0x10*/ ) { __asm { cld; mov edi , dword ptr[ ebp + 0x08 ]; mov ecx , dword ptr[ ebp + 0x0C ]; xor eax , eax; mov al , byte ptr[ ebp + 0x10 ]; rep stosb; } } int main() { char Dest[ARRAY_SIZE] = { 0 , }; DWORD dwOld1 = GetTickCount(); for ( int i = 0 ; i < OVERLAP_ROOFING ; ++i ) Init_( Dest , ARRAY_SIZE , (char)0xFF ); DWORD dwDuring1 = GetTickCount() - dwOld1; DWORD dwOld2 = GetTickCount(); for ( int i = 0 ; i < OVERLAP_ROOFING ; ++i ) for ( int j = 0 ; j < ARRAY_SIZE ; ++j ) Dest[j] = (char)0xFF; DWORD dwDuring2 = GetTickCount() - dwOld2; return 0; }x86