作者RoyalCh (不想当小螺丝钉!)
看板Grad-ProbAsk
标题[理工] 计组 98台联大
时间Wed Jan 4 10:45:07 2012
A MIPS branch instruction performs a modification of PC+4
if the condition is true.The maximum range of the jump is PC+4-A to
PC+4+B where both A and B are positive numbers.
What are A and B?
I type的 instruction里面
address的栏位是16个bits
所以我写了 B=2^16-4 A=2^16
可是答案是17次
想问一下为什麽
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 140.113.67.165
1F:推 qqoil:(PC+4)单位是Byte,instruction address单位是word 01/04 10:51
2F:→ RoyalCh:为什麽不是*4? 一个word 不是4byte吗 01/04 10:53
3F:→ RoyalCh:(2^16-1)*4 这样 01/04 10:54
4F:推 JiDung:可跳的范围的确是2^16 * 4 没错 01/04 10:57
5F:→ qqoil:分支区间 -2^15~2^15-1 word 01/04 10:57
6F:→ JiDung:所以范围大小是2^18 bytes 而范围起点终点是 01/04 10:57
7F:→ JiDung:-2^17 ~ 2^17 -1 01/04 10:57
8F:→ RoyalCh:阿 我知道了...谢谢 01/04 10:58