[理工] [計組] BEQ

看板Grad-ProbAsk作者 (ken52011219)時間9年前 (2016/11/06 11:46), 9年前編輯推噓7(703)
留言10則, 6人參與, 最新討論串1/1
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為何錯 感謝 -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 36.224.32.87 ※ 文章網址: https://www.ptt.cc/bbs/Grad-ProbAsk/M.1478404014.A.41C.html

11/06 12:01, , 1F
C的話 如果loop是在beq指令上方可以填負數
11/06 12:01, 1F

11/06 12:05, , 2F
D的話,在指令裡會把loop轉成"(PC+4)+相對位址*4"
11/06 12:05, 2F

11/06 12:05, , 3F
不曉得有沒有記錯@@
11/06 12:05, 3F
我懂了 頭昏了 把LOOP想成副program的title 感謝 !! ※ 編輯: ken52011219 (36.224.32.87), 11/06/2016 12:11:19

11/06 13:21, , 4F
C的解釋還是有點不懂欸,什麼叫作“可以填負數”啊
11/06 13:21, 4F

11/06 14:03, , 5F
你要跳的點在你所在行數的上方就要填負數。
11/06 14:03, 5F

11/06 16:04, , 6F
重點不是正數還是負數 而是se unit會把他當有號數看待
11/06 16:04, 6F

11/06 16:05, , 7F
啊啊 抱歉我看錯意思了~ 請忽略
11/06 16:05, 7F

11/07 11:51, , 8F
樓上說的沒錯吧? 那16bit 要用signed number 來看
11/07 11:51, 8F

11/08 00:26, , 9F
這題老師上課是說c)可以填負數d)沒有叫"loop"這個名
11/08 00:26, 9F

11/08 00:26, , 10F
字的指令 不知道有沒有記錯@@
11/08 00:26, 10F
文章代碼(AID): #1O7gUkGS (Grad-ProbAsk)