[理工] [計組] MIPS
Q: f=g-A[B[4]]
Assume the variable f,g,h,i and j are assigned to registers $s0,$s1,$s2,$s3
,$s4 respectively.the base adress of the arrays A and B are in registers
$s6,$s7
A:
MIPS
lw $t0,16($s7)
sll $t0,$t0,2 <-----
add $t0,$s6,$t0 <----- 這三行的意義不太懂,有請板上高手指教,thank you
lw $s0,0($t0) <-----
sub $s0 ,$s1,$s0
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 61.227.54.233
→
07/26 23:55, , 1F
07/26 23:55, 1F
感謝提醒:P
→
07/27 00:01, , 2F
07/27 00:01, 2F
→
07/27 00:01, , 3F
07/27 00:01, 3F
為什麼B[4]*4,即A[B[4]]的位址呀?
→
07/27 00:01, , 4F
07/27 00:01, 4F
※ 編輯: hardware 來自: 61.227.54.233 (07/27 00:05)
→
07/27 00:11, , 5F
07/27 00:11, 5F
→
07/27 00:12, , 6F
07/27 00:12, 6F
→
07/27 00:18, , 7F
07/27 00:18, 7F
討論串 (同標題文章)