count不是字节长度,而是sample结构的个数吧?
假定sample结构是4的整数倍,并且是对齐到4字节边界
int len = sizeof(sample)/2;
__asm {
push esi
push edi
mov eax,len
mul count
mov ecx,eax
mov edi,dest
mov esi,src
rep movsd
pop edi
pop esi
}
asm{ ;embed asm in vc
push esi ;esi into stack
push edi ;edi into stack
mov esi,src ;var in src trans to esi
mov edi,dst ;var in dst trans to edi
mov ecx,count ;var in count trans to ecx
push ecx ;ecx into stack (stack :0+6)
shr ecx,2 ;ecx shift rolling two bit
cld ;order a move direction
rep movsd ;circle rolling
pop ecx ;ecx out stack
and ecx,11b ;ecx become 11b
rep movsb ;circle rolling
pop edi ;edi out stack
pop esi ;esi out stack
ret ;return
}