MIPS Two's complement & array
<p>I need to build a MIPS program that gets an specific array and prints the unsign (with use of the two's complement) array. for example if I get the array <code>23,-2,45,67,89,12,-100,0,120,6</code>
I'll receive <code>23,254,45,67,89,12,156,0,120,6</code>. But I don't know which functions to use.
what I build so far:</p>

<pre><code>    .data
array:      .word       23,-2,45,67,89,12,-100,0,120,6
arrend: 

comma: .asciiz ", "

    # array = {23,-2,45,67,89,12,-100,0,120,6}
    # Algorithm being implemented to find the unsign value of array's elements
    # loop i = 0 to length-1 do (use $t1 for i)
    # absolute value = |array[i]|
    # end loop (use $t3 for base addr. of array)

    # registers:
    #   t3 -- pointer to current array element (e.g. arrptr)
    #   t2 -- pointer to end of array
    # 
    #   t4 -- current value fetched from array (i)

    .text

main:

    la      $t3,array               # load base addr. of array
    la      $t2,arrend              # load address of array end
    j       test 

loop:
    lw      $t4,0($t3)              # load array[i]
    addi    $t3,$t3,4               # increment array pointer

    #######

    # print unsign value of array's element
    li      $v0,1
    addi    $a0,$t5,0
    syscall

    # print comma
    li      $v0,4
    la      $a0,comma
    syscall

test:
    blt     $t3,$t2,loop            # more to do? if yes, loop
</code></pre>

<p>where there is <code>#######</code> should be the code that converts the array's element in the unsign element. How should I write it?</p>