[理工] [計組] BEQ

作者: ken52011219 (呱)   2016-11-06 11:46:51
For a conditional branch instruction such as beq rs , rt , loop ,which
of following statement are true ?
(A) The label "loop" defines the base address of the branch target
(B) The label "loop" is an offset relative to the program counter which
points to the sequential instruction of the branch instruction
(C) The label "loop" is an unsigned number
(D) The label "loop" is coded into the instruction as "loop"
Ans : B
想請問C、D為何錯 感謝
作者: boy00114 (ponny)   2016-11-08 00:26:00
這題老師上課是說c)可以填負數d)沒有叫"loop"這個名字的指令 不知道有沒有記錯@@
作者: aa06697 (todo se andarà)   2016-11-07 11:51:00
樓上說的沒錯吧? 那16bit 要用signed number 來看
作者: yorunohoshi (夜の星)   2016-11-06 12:01:00
C的話 如果loop是在beq指令上方可以填負數D的話,在指令裡會把loop轉成"(PC+4)+相對位址*4"不曉得有沒有記錯@@
作者: Transfat (Transfat)   2016-11-06 13:21:00
C的解釋還是有點不懂欸,什麼叫作“可以填負數”啊
作者: k2shouai (coding....)   2016-11-06 14:03:00
你要跳的點在你所在行數的上方就要填負數。
作者: kyuudonut (善良老百姓)   2016-11-06 16:04:00
重點不是正數還是負數 而是se unit會把他當有號數看待啊啊 抱歉我看錯意思了~ 請忽略

Links booklink

Contact Us: admin [ a t ] ucptt.com