Hi I would really appreciate some help with this Thanks Writ
Hi, I would really appreciate some help with this.
Thanks
Write an equivalent MIPS32 assembly fragment to the pseudocode procedure listed below. Note that all variables in the pseudocode procedure must be represented by data segment variables in the MIPS32 assembly fragment. This fragment is working with 32-bit integers. Follow register conventions established in class. If min > number then Set the value of min to number End ifSolution
Please find MIPS assembly fragment as below.
Code:
lw $t0, 0($gp) # get i
lw $t1, 4($gp) # get N
slt $t1, $t0, $t1 # set $t1 to 1 and check if $t0 < $t1, to 0 otherwise
beq $t1, $zero, skip # (i>N)
sll $t0, $t0, 2 # i as a offset byte
add $t0, $t0, $gp # &A[i] - 28
sw $zero, 28($t0) # A[i] = 0
skip:
