作者:
RealJustice (Nice to Meet You~)
2011-02-28 12:40:46最近看書回想到一個經典問題 : function call 與 interrupt差在哪裡.
int 不能傳參數, 不能返回參數, 這兩個是最基本的;
我記得有個關鍵差異, 是關於stack的操縱. 但現在回想不起來.
這兩者都需要把return address塞入stack, 暫存器內容塞入stack,
CPU狀態 (PSR, processor status register) 塞入stack,
執行完畢再陸續pop回來. 這樣想想, 兩者幾乎是一樣的??
有人能解答這兩者的差異嗎?