[理工] MIPS 指令轉換
abs $t2, $t3 // $t3取絕對值存到$t2
答案改寫成
addu $t2, $zero ,$t3 # copy $t3 into $t2
bgez $t3, Next # if $t3>=0 then done
sub $t2, $zero, $t3 # negate $t3 and place into $t2
Next:
想問 改寫後第一行 addu 不能用add嗎?
用add好像也沒問題吧?
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 182.235.37.221
推
08/13 17:31, , 1F
08/13 17:31, 1F
→
08/13 17:32, , 2F
08/13 17:32, 2F
→
08/13 17:33, , 3F
08/13 17:33, 3F
→
08/13 19:39, , 4F
08/13 19:39, 4F
推
08/13 22:24, , 5F
08/13 22:24, 5F