99 成大工科(乙) 系統程式
第五題..
題目:
Assume that the variables f,g,h,i,and j are assigned to registers
$s0, $s1, $s2, $s3,and $s4, respectively.
Also, assume that the base address of integer arrays A & B are in $s6 and $s7.
For the MIPS assembly instructions bellow, what is the corresponding
C statment (in the simplest form)?
(a) add $s0, $s0, $s1
add $s0, $s3, $s2
add $s0, $s0, $s3
(b) addi $s6, $s6, -20
add $s6, $s6, $s1
lw $s0, 8($s6)
(c) Assume that the regesters $s0, $s1, $s2, $s3 contain the values 10, 20,
30, and 40, respectively.
Also, assume that register $s6 contains the value 256, and tht memory
contains the following values:
Address│Value
────┼───
256 │ 100
────┼───
260 │ 200
────┼───
264 │ 300
Find the value of $s0 at the end of the assembly code in (a) and (b),
respectively.
第(a)題我自己寫的答案是
f = f + g;
f = i + j;
f = f + i;
(b)跟(c)我就不知道怎麼翻譯...
麻煩組合語言高手幫我解答一下~"~ 感謝
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.117.157.14