section .text
   global _start        
	
_start:	                

   mov ecx,len       ; tamanho da string
   mov edi,my_string ; string onde vai pesquisar
   mov al , 'e'      ; caracter a pesquisar
   cld
   repne scasb
   je found ; se encontrou
   ; Se não encontrou segue o codigo abaixo
	
   mov eax,4
   mov ebx,1
   mov ecx,msg_notfound
   mov edx,len_notfound
   int 80h
   jmp exit
	
found:
   mov eax,4
   mov ebx,1
   mov ecx,msg_found
   mov edx,len_found
   int 80h
	
exit:
   mov eax,1
   mov ebx,0
   int 80h
	
section .data
my_string db 'hello world', 0
len equ $-my_string  

msg_found db 'Encontrado!', 0xa
len_found equ $-msg_found

msg_notfound db 'Não encontrou!'
len_notfound equ $-msg_notfound 
