Hi all,

I'm new to Win32 Asm, I'm also new to this forum:)
I have a procedure to resize a region, but it's a bit slow.
Can anyone help me to optimize this code


.If (tn_SizeX != 0)
mov ln_Right, ebx
add ln_Right, 8
mov edx, tn_SizeX
add dword ptr RGNDATA.rdh.rcBound.right[ebx], edx

mov ecx, ln_Count
mov eax, ecx
sub eax, 1
shl eax, 4

LoopX:
mov edi, ln_Right
add edi, eax
add dword ptr RGNDATA.Buffer[edi], edx
sub eax, 16
loop LoopX
.endif

.If (tn_SizeY != 0)
mov ln_Y1, ebx
add ln_Y1, 4
mov ln_Y2, ebx
add ln_Y2, 12

mov edx, tn_SizeY
add dword ptr RGNDATA.rdh.rcBound.bottom[ebx], edx

mov ecx, ln_Count ; get region array
shr ecx,1 ; divide by 2 (integer)
mov eax, ecx
shl eax, 4 ; multiply by 16
mov ll_First, 0
mov ll_Start, 0
.While (ll_Start == 0) && (ecx < ln_Count)
mov edi, ln_Y2
add edi, eax
mov ebx, dword ptr RGNDATA.Buffer[edi]
add ebx, edx

mov edi, ln_Y1
add edi, eax
sub ebx, dword ptr RGNDATA.Buffer[edi]
.If (ebx > 0)
mov ll_Start, 1
.else
add eax, 16
inc ecx
.endif
.EndW

.While (ecx < ln_Count)
.If (ll_First == 0)
mov ll_First, 1
.else
mov edi, ln_Y1
add edi, eax
add dword ptr RGNDATA.Buffer[edi], edx
.endif

mov edi, ln_Y2
add edi, eax
add dword ptr RGNDATA.Buffer[edi], edx
add eax, 16
inc ecx
.EndW
.endif


TIA
Posted on 2002-11-24 18:12:42 by HermanT