title: How to break infinite loop assembly Windows x64
body: <p>I'm trying to add arrA and arrB and store the values into arrC and print out.. once I run the code it takes me to infinite loop. How can I break the loop? Any suggestions greatly appreciated.</p>
  <pre><code>ExitProcess PROTO
  WriteHex64  PROTO
  .data
   arrA BYTE 10h, 30h
   arrB BYTE 0E0h, 40h
   arrC BYTE 0, 0
   string BYTE &quot;, &quot;, 00h 
  
   .code
   main PROC
     nop
  
     mov rdi, OFFSET arrA
     mov rsi, OFFSET arrB
     mov rbx, OFFSET arrC
     mov rdx, OFFSET string
   
     mov rcx, LENGTHOF arrA
  
     mov rax, 0
  
     L1:
       mov rax, [rdi]
       mov rax, [rsi]
       add rdi, TYPE arrA
       add rsi, TYPE arrB
       mov [rbx], rax
       add rbx, TYPE arrC
       call WriteHex64
       call WriteString
       loop L1
       
     nop
       
     mov ecx, 0
     call ExitProcess
   main ENDP
   END
  
   
  </code></pre>