→ tomdog12345: 好清楚!原來是這樣,我看懂了 謝謝幫忙 QAQ 07/24 18:53
※ 引述《tomdog12345 (方)》之銘言:
: 剛剛傳錯圖了抱歉
: http://i.imgur.com/3IPEVMx.jpg
: 如圖 是張凡計組上的一題練習題
: 考的是遠距離分支
: 我疑惑的是為何答案寫成這樣:
: here: bne $s0, $s2, skip
: j there
: skip: ...
: there: add $s0,$s0,$s0
: 就能跳到原本跳不到 的地方(超過16bit可表示的地方)?
: 有誰知道更詳細一點的解釋嗎QAQ 謝謝!
: -----
: Sent from JPTT on my Sony D6653.
original version:
here:
beq s0, s2, there #if s0 == s2, jump to there;
[codeblock A] #else continue [codeblock A]
there:
add s0, s0, s0
-----------------------------------------
answer:
here:
bne s0, s2, skip #if s0 != s2, continue [codeblock A]
j there #else jump to there
skip:
[codeblock A]
.
.
.
.
(很遠的距離)
.
.
.
.
there:
add s0, s0, s0
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 220.132.251.85
※ 文章網址: https://www.ptt.cc/bbs/Grad-ProbAsk/M.1469340410.A.088.html
※ 編輯: kyuudonut (220.132.251.85), 07/24/2016 14:10:50