看板 Grad-ProbAsk 關於我們 聯絡資訊
※ 引述《KESthecallin (堅持原味)》之銘言: : Let the value of the program counter(i.e.,PC) be 0xCF01FC00. : What is the target address of the instruction,j 0x20. ? : 答案上是寫 : 0xC0000080... : 可是不知道答案是怎麼算出來的= =... : 有沒有哪位大大可以出來解救... : 感恩~ 0xCF01FC00 =1100 1111 0000 0001 1111 1100 0000 0000 0x20 =0000 0000 0000 0000 0000 0000 0010 0000 所以就是跳到1100 0000 0000 0000 0000 0000 1000 0000 c 0 0 0 0 0 8 0 因為J指令的PC就是 指令的26位元向左移兩位 加上pc的最高位元 如果不知道 J指令是如何 可以參考書本 j 2500 的意思就是 go to pc=2500x4=10000 為什麼要乘4 因為 MIPS 是對齊 4byte 有錯請指正 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 61.231.168.61 ※ 編輯: cakeboy 來自: 61.231.168.61 (12/28 00:20) ※ 編輯: cakeboy 來自: 61.231.168.61 (12/28 00:21)
cksh3300110:正解~! 12/28 00:24
KESthecallin: 終於搞懂了!感恩~ 12/28 00:25
hswayne:是降嗎?! jump指令的target address應該是word address吧 01/21 20:54
hswayne:所以 j 10000(byte addr) 才會組譯成 2 2500(word addr) 01/21 20:55