szLeft is Hutch's proc.I can't understand the lines with ??. My_szLeft is mine.Is there any part of it wrong? I'm new to assembly.I shall be grateful if you explain the lines with ??. I think this forum is for those who are good in assembly,and this question is a beginner one, but I need help. Thanks in advance. ; ######################################################################## szLeft proc lpszSource:DWORD,lpszTarget:DWORD,ln:DWORD push esi push edi cld mov esi, lpszSource mov edi, lpszTarget mov ecx, ln shr ecx, 2 ;?? rep movsd mov ecx, ln and ecx, 3 ;?? rep movsb mov al, 0 mov , al pop edi pop esi ret szLeft endp ; ########################################################################### ; ######################################################################## My_szLeft proc lpszSource:DWORD,lpszTarget:DWORD,ln:DWORD push esi push edi cld mov esi, lpszSource mov edi, lpszTarget mov ecx, ln rep movsB mov al, 0 mov , al pop edi pop esi ret My_szLeft endp ; ###########################################################################
Posted on 2001-01-17 20:37:00 by Nada
Nada, shr ecx, 2 divides ECX by 4 as the following MOVSD moves 4 bytes at a time, mov ecx, ln and ecx, 3 rep movsb calculates the remainder if the byte length is not evenly divided by 4 so that you have the correct count in ECX. Regards, hutch@pbq.com.au
Posted on 2001-01-18 03:16:00 by Steve Hutchesson
Much thanks Sir.
Posted on 2001-01-18 07:16:00 by a.nada