title: Understanding Assembly MIPS .ALIGN and Memory Addressing
body: <p>I'm taking this course, and I'm really struggling understanding the directive <code>.align</code> concept.<br />
  Here's an example, which I couldn't understand:</p>
  <p><img src="https://i.stack.imgur.com/tesct.png" alt="enter image description here" /></p>
  <p>I know that inside the data segment, there are addresses, starting with 0x10010000,0x10010020,etc.</p>
  <p>And I know, that inside each address, there are 8 memory fields, each has 32bit.</p>
  <p>Now, what I don't understand is, how and why <code>var2</code> inside the address 0x10010010? <code>str1</code> is inside the address 0x10010003 because we reserved 3 bits for the <code>var1</code>.</p>
  <p>The last thing is, what exactly the directive <code>.align</code> doing? When I tested it in Mars4, it only shifted the data into the next memory field when I used <code>align 3</code> and up, but I don't really get it.</p>