Hello all,
i need your help regaring this code, which is in python and i need to convert it into mips??
register $s0 holds the base address of list my_data, $s1 holds the length of the list my_data,
register $s2 holds the base address of list my_data2 and $s3 holds the length of the list
my_data2.
def sum_to_x(x):
sum = 0
for i in range (x):
sum += i
return sum
my_data = [1, 3, 6, 7]
my_data2 = [2, 1, 5]
for i in range( len( my_data ) ):
my_data[ i ] = sum_to_x( my_data[ i ] )
for i in range( len( my_data2 ) ):
my_data2[ i ] = sum_to_x( my_data2[ i ] )
thanks in advance!!!