系統(tǒng)會(huì)用到下面幾種寄存器: 1.EIP 2.ESP 3.EBP。三者的作用。
1.EIP寄存器里存儲(chǔ)的是CPU下次要執(zhí)行的指令的地址。
2.EBP寄存器里存儲(chǔ)的是是棧的棧底指針,通常叫棧基址,而這個(gè)地址是由ESP在函數(shù)調(diào)用前傳遞給EBP的。等到調(diào)用結(jié)束,EBP會(huì)把其地址再次傳回給ESP。所以ESP又一次指向了函數(shù)調(diào)用結(jié)束后,棧頂?shù)牡刂贰?br />3.ESP寄存器里存儲(chǔ)的是棧的棧頂。并且始終指向棧頂。
Eax – arithmetic, default location where division occurs (accumulator)是很多加法乘法指令的缺省寄存器。
Ebx – base index for arrays
Ecx – couner (used with the loop instruction)重復(fù)(REP)前綴指令和LOOP指令的內(nèi)定計(jì)數(shù)器。
Edx – data/general 總是被用來(lái)放整數(shù)除法產(chǎn)生的余數(shù)。
Edi, esi – used as indices in string operations
Ebp – positive offsets are the arguments, negative offsets are the local variables
posted on 2011-11-27 23:15
鷹擊長(zhǎng)空 閱讀(154)
評(píng)論(0) 編輯 收藏 引用