title: Iterate through string in register
body: <p>I have a string in the ebx register and I want to iterate through its bytes. I'm new to assembly and want to if this concept works.</p>
  
  <pre><code>#string is in ebx
  movl (%ebx), %edi #put the adresse of the string to %edi
  jmp looper
  
  looper:
  
      cmpl $0, %edi             # check if byte at edi is 0 (it's a c conform string so 0 is the terminator)
      je exit 
  
      addl $8, %edi                # load next value, increment the edi by 8 to move it to the next byte of the string 
      jmp looper            # jump to loop beginning
  </code></pre>