2,728
次編輯
Tankianting(討論 | 貢獻) (→第三章) |
Tankianting(討論 | 貢獻) |
||
行 62: | 行 62: | ||
rbx, rsp, rbp, r12, r13, r14, r15 | rbx, rsp, rbp, r12, r13, r14, r15 | ||
* call-live variable(會被用的變數) | |||
我們要找到同時使用的變數和不同時使用的變數,來節省暫存器的使用,這是一種圖著色問題。 | |||
==附錄:指令集摘== | |||
{| class="wikitable" | |||
|+ | |||
!指令名 | |||
!操作說明 | |||
!註 | |||
|- | |||
|<code>addq A B</code> | |||
|A + B -> B | |||
| | |||
|- | |||
|<code>negq A</code> | |||
| -A | |||
| | |||
|- | |||
|<code>subq A B</code> | |||
|B - A -> B | |||
| | |||
|- | |||
|<code>imulq A B</code> | |||
|A * B -> B | |||
| | |||
|- | |||
|<code>popq A</code> | |||
|*rsp -> A; rsp + 8 -> rsp | |||
|跳出(pop),rsp再往大移 | |||
|- | |||
|<code>push q</code> | |||
|rsp - 8 -> rsp; A -> *rsp | |||
|rsp往小移,再壓入(push) | |||
|- | |||
| | |||
| | |||
| | |||
|- | |||
| | |||
| | |||
| | |||
|} | |||
[[category:資訊]] | [[category:資訊]] |