這個是題目 For the following C statement, what is the corresponding MIPS assembly code? Assume that the variables f, g, h, i, and j are assigned to registers $s0, $s1, $s2, $s3, and $s4, respectively. Assume that the base address of the arrays A and B are in registers $s6 and $7, respectively. B[8] = A[i–j]; 然後我在網路上找的答案說 sub $t0, $s3, $s4 # $t0 = i-j sll $t0, $t0, 2 # $t0 = (i-j) * 4 lw $t1, 0($s6) # $t1 = A[0] add $t1, $t1, $t0 # $t1 = &A[i-j] <
$s6裡存的是A的address吧 怎麼會用lw 還是我理解錯題目意思?Assume that the base address of the arrays A and B arein registers $s6 and$7,A[0]+(i-j)*4 怎麼會是A[i-j]的address應該要&A[0]+$t0才對吧? 還是我觀念錯了?orz