mov al,byte ptr [ecx]
add ecx,1
test al,al
je short byte_3
test ecx,3
jne short str_misaligned
add eax,dword ptr 0
align 16
redundant
main_loop:
mov eax,dword ptr [ecx]
mov edx,7efefeffh
add edx,eax
xor eax,-1
xor eax,edx
add ecx,4
test eax,81010100h
je short main_loop
mov eax,[ecx - 4]
test al,al
je short byte_0
test ah,ah
je short byte_1
test eax,00ff0000h
je short byte_2
test eax,0ff000000h
je short byte_3
jmp short main_loop
byte_3:
lea eax,[ecx - 1]
mov ecx,string
sub eax,ecx
ret
byte_2:
lea eax,[ecx - 2]
mov ecx,string
sub eax,ecx
ret
byte_1:
lea eax,[ecx - 3]
mov ecx,string
sub eax,ecx
ret
byte_0:
lea eax,[ecx - 4]
mov ecx,string
sub eax,ecx
ret
;数组初始化
mov ecx, 10h
lea edi, [esp+6Ch+var_40]
rep stosd
;以下就是楼主贴的代码
lea edi, [esp+6Ch+var_64]
or ecx, 0FFFFFFFFh
repne scasb
not ecx
dec ecx
push ecx
push offset aStringLengthD ; "string length = %d\n"
call ds:printf
add esp, 8
xor eax, eax
pop edi
pop esi
add esp, 64h
retn