title: Assembly - Comparing two integers at same index in 2 arrays
body: <p>I need some help comparing two elements of different arrays at the same index and counting if how many pairs equal each other. The program is suppose to count how many times the two arrays contain the same integer at the same index. I can't figure out how to include the size (if one is bigger than the other) and also how to print the count of pairs.</p>
  
  <p>Thanks        </p>
  
  <pre><code>      .globl  main
  
  main: 
        li      $t1,0 #arrays index
        li      $t2,0 #counter
        li      $t4,0 #count pairs
  
  loop: 
        beq     $t2,10,end
        lw      $v0,arrayA($t1)
        lw      $v1,arrayB($t1)
  
        beq     $v0, $v1, equal
        addi    $t1,$t1,4
        addi    $t2,$t2,1
        b loop
  
  equal: 
        addi    $t4,$t4,1
        addi    $t1,$t1,4
        addi    $t2,$t2,1
        b loop
  
  end:   
        lw      $a0,($t4)
        li      $v0,1
        syscall
  
        li      $v0,10
        syscall #Halt
  
          .data
  sizeA:  .word 10
  arrayA: .word -1, 0, 3, 6, 8, 10, 21, 11, 14, 10
  sizeB:  .word 10
  arrayB: .word -2, 0, 7, 2, 12, 9, 2, 19, 20, 15
  
  # end of program
  </code></pre>