size dd   10

input db "input: ", 00

output db "output: ", 00


; initialized data is put in the data segment here 

;


segment .bss


segment .text 

global main


enter 0,0 ; setup stack frame pusha


main:

mov ebx, 0

mov ecx, 0

mov edx, 10

mov eax,input

call print_string

call read_int



for:

cmp eax,[array+ebx]

je end


inc ecx

dec edx

add ebx, 4

jmp for


cmp edx, 0

je fault


end:


mov eax,output

call print_string


mov eax,ecx


call print_int


fault:

mov eax, output

call print_string

mov eax, -1

call print_int



; code is put in the text segment. Do not modify 

; the code before or after this comment. 

;


popa

mov eax, 0; return value 

leave; leave stack frame 

ret


이거 배열에 저장된 값 찾으면 그때 인덱스값 출력하는건데 없으면 -1이고 실행 왜안되는지 아시나요??