Я пытаюсь выяснить, какими будут опасности данных для этого кода ...
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
Поиск опасностей данных;где они происходят и почему