Assembly language x86 IRVINE infinite loops
<p>I'm new to Assembly language and I need help with an error I keep experiencing, my task in class is to do what I did below, everything I did is correct and how the professor wants it but I can't stop the program from infinite looping, I have the correct answer which is 14 but how do I stop the loop from being infinite without using special commands like <code>ret</code>. How do I stop it?</p>

<pre><code>;Declare an array of words
;Write a loop that adds all the elements of the array located in even places
;Example 3,7,2,8,9
;3+2+9=14

INCLUDE Irvine32.inc

.data

val1 WORD 3,7,2,8,9

.code

main PROC

mov eax, 0

L1:

mov ecx, (LENGTHOF val1)*(TYPE val1+2)-(TYPE val1+4)
mov eax, ecx

call writeDec

loop L1


    exit
main ENDP
END main
</code></pre>