※ 引述《flynova (沁藍飛舞湛綠輕揚)》之銘言:
: ※ 引述《Hatred (幹,剩一科)》之銘言:
: : 標題: Re: 白濫造句II
: : 時間: Thu Jan 17 10:48:16 2002
: : ^^^^
: : ^^^^^^^^^^^^^^
: : 故意ㄉ
: : 上面那幾句話才是經典啊~~~
: : 不過考現代真ㄉ會發瘋
: 經典在哪裡....@@
: 完全看不出來.........
喔來po個經典ㄉ給你看:
int
func(int a, int b) _func
{ _main: ↗push bp ﹨
long c; push y ↗ mov bp, sp |→prolog
return 3; push x ↗ sub sp, 4 ∕
} ===>call _func /*body of _func*/
int add sp, 4 ↖ mov sp, bp ﹨
main(void) ↖ pop bp |→epilog
{ ↖ret ∕
/*code*/
int x = 1, y = 2;
func(x, y)
/*code*/
}
註:
黃色:清除傳入_func的arguments
綠色:_func中留下local variable的空間
紅色:_func中清除local variable的空間
在_func中,要access local variable時用[bp-xxx],
要access傳入的argument時用[bp+xxx]
_func的return value是放在ax裡
像printf這種不定引數的函數,不定引數達成的方法是在第一個argument可看出到底有多
少arguments
--
歡迎光臨PTTㄉCSIE_ICE版喔
來耍冰吧
--
※ 發信站: 批踢踢實業坊(ptt.twbbs.org)
◆ From: 61.216.44.148
: : --
: : 灌水中....
: : ■■■■■■■■■100% completed
: : --
: : ◆ From: 61.216.45.139
--
灌水中....
■■■■■■■■■100% completed
--
※ 發信站: 批踢踢實業坊(ptt.twbbs.org)
◆ From: 61.216.45.139
※ 編輯: Hatred 來自: 61.216.45.139 (01/17 10:51)