Hello, I tried to convert below code, but I couldn't.. What is wrong?
void invert(unsigned char *image, int width, int height){
for(int i=0;i<width*height;i++)
image[i]=255-image[i];
}
---------------------ASM---------
invert PROC
push ebp ; save ebp register
mov ebp,esp ; get current stack pointer
mov esi,[ebp+8] ; get first parameter
mov eax,[ebp+12] ; get second parameter
mov ebx,[ebp+16] ; get third parameter
mul ebx ; eax=eax * ebx
mov ecx,eax ; get image size
dec ecx
mov al,255
L1:
sub al,[esi] ; al=al-image[i]
mov [esi],al ; image[i]=al
inc esi
loop L1
pop ebp ; restore ebp
ret ; return to caller
invert ENDP
--------------------------------------------------
please help me....thanks...