Thanks for your reply.
What I see is there is one return value v0 because its always the case in MIPS (I think) and what I also know from MIPS is that a0, a1 are parameters.
What I also know from this code is there are two loops one is the inner and the other is the outer loop. t4 = 32 is set and starts in inner loop subi decrements the counter if its 0 then it will jump to the next label. Here is my understanding from the code in green but I am not sure if I understand it correctly.
why is there andi? its a mask?
srl means I am doing a multiplication by 2.
start: here v0 = 0 and t0 = 0 is the initialization.
two loops: outer and inner
outer
t3 = I am loading the value from a0 into t3.
t4 is set to 32
inner
if(t4 == 0 ) go to next
else
do mask with and
sum up v0 with t3 in v0
multiply t3 by 2
decrement the counter t4 by 1
jump to the label inner and do it until the condition beq is true, that means if t4 == 0 then jump to next label
next
t0 = 1
a0 = 4
jump to outer loop