title: Assembly language program (sum the differences of a number in an array)
body: <p>I have been tasked, with a homework assignment (I'm not going to sugar-coat it), writing a 32-bit assembly program that uses a loop and indexed addressing to calculate the sum of the gaps between successive array elements, which are in non-decreasing order.  (Ex: dwarray dword 0,2,5,9,10)</p>
  
  <p>What I don't know how to do is subtract the nth element of an array from the nth-1 element in the array using a loop. If I did, then I would store the result in a different register and keep adding the results into that register until the last element has been reached.  I'm only looking to be pointed in the right direction (I'm not looking for the answer).  Does anyone have any suggestions?</p>