IvoB1n

Untitled

Apr 12th, 2021 (edited)
240
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. task22:
  2.        
  3.         push ebp
  4.         mov ebp, esp
  5.         push ebx
  6.         push ecx
  7.         push edx
  8.        
  9.        
  10.         mov eax, [ebp+8];value to be search for [eax
  11.         mov ecx, [ebp+12];lenght [ecx
  12.         mov ebx, [ebp+16];array pointer [ebx
  13.         cmp ebx, 0
  14.         je .error
  15.         cmp ecx, 0
  16.         jle .error
  17.     .start:
  18.         sub ecx, 1
  19.         cmp ecx , -1
  20.         je .error
  21.        
  22.         cmp al, [ebx + ecx]
  23.         je .clean
  24.         jmp .start
  25.  
  26.     .error:
  27.         mov ecx, -1
  28.         jmp .clean
  29.     .clean:
  30.         mov eax, ecx
  31.        
  32.         pop edx
  33.         pop ecx
  34.         pop ebx
  35.        
  36.         mov esp, ebp
  37.         pop ebp
  38.     ret 12
Add Comment
Please, Sign In to add comment