我可以在MIPS寻址模式下使用两个寄存器作为索引吗?

时间:2018-10-14 18:19:04

标签: assembly mips instruction-set addressing-mode

我有以下C行代码:

B[x] = A[x+7] + A[x+2];

假定 A 存储在 $ s1 x < / strong>中的 $ t0

我有以下MIPS代码:

add $t1, $t0, 7  
add $t2, $t0, 2   
lw  $t3, $t1($s0)  
lw  $t4, $t2($s0)  
add $t3, $t3, $t4 
sw  $t3, $t0($s1)

现在我的问题是,我是否可以在这样的MIPS代码中使用: $ t0($ s1),如果没有,那么谁能解释为什么以及我可以使用的其他替代方法是什么? / p>

我在网上搜索,但无法获得正确的答案!

0 个答案:

没有答案