我正在尝试找出此代码的数据危害是什么...
lw $15, 8 # load num (8) into register $15
lw $16, 0 # load sum (0) into register $16
lw $17, array # load array into register $14
lw $14, 2 # load sub value(2) into register $14
while:
beq $15, $zero exitLoop # loop for; while(num>=0) statement
add $16, $16, $15 # sum = sum + num
sub $15, $15, $14 # num = num – 2
j while
exitLoop: sw $16, 12($17) # array[3] = sum; the fourth element in array is set to the sum
寻找数据危害;它们发生的位置以及原因