Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for (i=0; i<128; i++)
- { a[i] = b[i] - c[i] + 5; }
- add $t4, $zero, $zero # I1 i is initialized to 0, $t4 = 0
- Loop:
- add $t5, $t4, $t1 # I2 temp reg $t5 = address of b[i]
- lw $t6, 0($t5) # I3 temp reg $t6 = b[i]
- add $t5, $t4, $t2 # I4 temp reg $t5 = address of c[i]
- lw $t7, 0($t5) # I5 temp reg $t7 = c[i] + 5
- sub $t6, $t6, $t7 # I6 temp reg $t6 = b[i] - c[i] + 5
- add $t5, $t4, $t0 # I7 temp reg $t5 = address of a[i]
- sw $t6, 0($t5) # I8 a[i] = b[i] - c[i] + 5
- addi $t4, $t4, 4 # I9 i = i + 1
- slti $t5, $t4, 256 # I10 $t5 = 1 if $t4 < 128, i.e. i < 10
- bne $t5, $zero, Loop # I11 go to Loop if $t4 < 128
- exit:
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement