Uploaded by Andrew Photinakis

01b swap mips.txt

advertisement
8/28/23, 1:34 PM
cs.rit.edu/~paw/250/notes/135e/,notes.231/01b/swap_mips.txt
00110100000010000000000000000100
00000001000001010000000000011000
00000000000000000100000000010010
00000001000001000100000000100000
10001101000010010000000000000000
10001101000010100000000000000100
10101101000010100000000000000000
10101101000010010000000000000100
00000011111000000000000000001000
https://www.cs.rit.edu/~paw/250/notes/135e/,notes.231/01b/swap_mips.txt
li
mul
$8, 4
$8, $8,$4
add
lw
lw
sw
sw
jr
$8, $8,$4
$9, 0($8)
$10,4($8)
$10,0($8)
$9, 4($8)
$ra
# r8 = 4
# r8 = t0 * i
#
#
#
#
#
#
r8 = r8 + base
r9 = arr[i]
r10= arr[i + 1]
arr[i] = r10
arr[i + 1] = r9
return
1/1
Download