title: MASM moving array elements with nested loops
body: <p>Initialize a BYTE array, not a 0 terminated string, with your last name. Using nested loops and indexed addressing, write a program that rotates the members of the array forward one position for each iteration of the outer loop. The value at the begining of the array must wrap around to the last position. For example, after the first iteration of the outer loop, 'S', 'm', 'i', 't', 'h' should be transformed to 'm', 'i', 't', 'h', 'S'. Display the array after each rotation using one of the author's library functions. Use the correct number of iterations of the outer loop to return the name to it's original spelling. The inner loop should perform the rotation.</p>
  
  <p>I cannot for the life of me figure this out if someone could be of any assistance i would appreciate it. I'm very new to assembly and don't really know nested loops well. I also cannot figure out how to move the letters. This is what i have so far</p>
  
  <pre><code>INCLUDE Irvine32.inc
  WriteString PROTO
  
  .data
      source BYTE "S", "m", "i", "t", "h"
  .code
  main PROC
      mov esi, 0
      mov ecx, SIZEOF source
  L1 :
      mov al, source[esi]
      inc esi
  loop L1
      mov edx, offset source 
      call WriteString
  exit
  main ENDP
  END main
  </code></pre>
  
  <p>Can someone lead me in the right direction?</p>