请看这两条伪汇编代码:
1)
li $t0,53
sll $t1,$t0,2
srl $t2,$t0,2
sra $t3,$t0,2
print $t1
print $t2
print $t3
2)
li $t0,-53
sll $t1,$t0,2
srl $t2,$t0,2
sra $t3,$t0,2
print $t1
print $t2
print $t3
在第一种情况下,输出是:
212
13
13
后者是:
-212
107374...
-14
但不应该:sra (-53) = - (srl 53) ?