开发者

Register value - MIPS

The language is MIPS.

$s2 = 0x00000046   ;   $s1 = 0x000038c

What will be the $s2 value in开发者_开发百科 Hex after the following code ? :

add $s2, $s1, $s2
srl $s1, $s1, 4
or  $s2, $s1, $s2

Can some one show me the way ?

thnx !


It might help to describe what each instruction does, e.g. in pseudo code, or here in C:

add $s2, $s1, $s2  # s2 = s1 + s2;
srl $s1, $s1, 4    # s1 = s1 >> 4;
or  $s2, $s1, $s2  # s2 = s1 | s2;
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜