title: MIPS Help: Adding arrays and printing their sum
body: <p>Add Two Arrays:
  Write a MIPS assembly language program that adds two arrays (element-by-element addition) and
  prints their sum.</p>
  
  <p>Print out the element of the sum in a single line, labeled and with values separated by spaces.
  The line should be terminated by a \n" character. For instance, if the arrays a and b are as above,
  the output will look like:
  The sum is: 1 4 7 6 10 14 11 16 21 16</p>
  
  <p>Here's the code I have so far</p>
  
  <pre><code># data segment
  
  .data
  
  
  
  
  size:    .word  10 #Size of first array
  $a0:    .word  2, 4, 6, 8, 10, 12, 14, 16, 18, 20 #First array's elements
  size2:   .word 10 #Size of second array
  $a1:   .word -1, 0, 1, -2, 0, 2, -3, 0, 3, -4 #Second array's elements
  size3:   .word 10 #size of third array
  
  main:
  
  la   $t0, $a0   #$t0 points to $a0[0]          
  lw   $t1, size   #$t1 equals number of elements in $a0[]  
  la   $t2, $a1  #$t2 points to $a1[0] 
  lw   $t3, size2  #$t3 equals number of elements in $a1[]
  
  
  la $t4, $a0 #load base address of array into register $t4
  la $t5,  #load base address of array into register $t5
  
  
  Assigning the array's elements to temp variables:
  
  lw $t6,0($a0)
  
  addiu $a0,$a0,4
  
  lw $t7,0($a0)
  
  addiu $a0,$a0,4
  
  lw $t8,0($a0)
  
  addiu $a0,$a0,4
  
  lw $t9,0($a0)
  
  addiu $a0,$a0,4
  
  lw $t10,0($a0)
  
  addiu $a0,$a0,4
  
  
  
  
  
  
  # exit program:
  
  li   $v0, 10      # terminate program
  syscall
  </code></pre>
  
  <p>so here's where I am stumped. How do I go about putting every element of both the first and second arrays into MIPS values like <code>$t0</code>, <code>$t1</code>, etc.</p>
  
  <p>and then how do I go about adding them together and printing out the sum of the arrays?</p>
  
  <p>I'm sorry to take up your time but I have searched for hours for a guide on how to add arrays in MIPS and then print the sum, to no avail</p>