下面这段,为什么循环超过255以后会出错
for i:=0 to nheight-1 do begin
sptr := PBYTE(integer(sddsd.lpSurface) + (y+i) * sddsd.lPitch + x);
asm
mov scount, 0
mov esi, sptr
lea edi, source
@@CopySource:
mov ebx, scount //ebx = scount
cmp ebx, srclen
jae @@EndSourceCopy
db $0F,$6F,$04,$1E /// movq mm0, [esi+ebx]
db $0F,$7F,$07 /// movq [edi], mm0
mov ebx, 0
@@Loop8:
cmp ebx, 8
jz @@EndLoop8
movzx eax, [edi+ebx].byte
mov edx, peff
movzx eax, [edx+eax].byte //
mov [edi+ebx], al
inc ebx
jmp @@Loop8
@@EndLoop8:
mov ebx, scount
db $0F,$6F,$07 /// movq mm0, [edi]
db $0F,$7F,$04,$1E /// movq [esi+ebx], mm0
add edi, 8
add scount, 8
jmp @@CopySource
@@EndSourceCopy:
db $0F,$77 /// emms
end;
end;