DS, ES, SS, DI, SI, BP, SP, IP, FS 寄存器

DS, ES, SS, DI, SI, BP, SP, IP, FS 寄存器

DS is called data segment register. It points to the segment of the data used by the running program. You can point this to anywhere you want as long as it contains the desired data.

DS叫做段寄存器, 指向當前運行着的程序的數據段. 你可以把它指向任何你想要的地方, 只要那個地方有你想要的數據.


ES is called extra segment register. It is usually used with DI and doing pointers things. The couple DS:SI and ES:DI are commonly used to do string operations.

ES叫做額外的段寄存器. 它通常跟DI一起用來做指針使用. DS:SI和ES:DI配對時通常用來執行一些字符串操作.


SS is called stack segment register. It points to stack segment.

SS叫做棧段寄存器, 它指向棧段.

The register SI and DI are called index registers. These registers are usually used to process arrays or strings.

SI和DI兩個寄存器叫做索引寄存器, 這兩個寄存器通常用來處理數組或字符串.


SI is called source index and DI is destination index. As the name follows, SI is always pointed to the source array and DI is always pointed to the destination. This is usually used to move a block of data, such as records (or structures) and arrays. These register is commonly coupled with DS and ES.
SI叫做源索引寄存器, DI叫做目的索引寄存器. 正如它們的命名, SI通常指向源數組, DI通常指向目的數組. 他們通常被用來成塊地移動數據, 比如移動數組或結構體. SI和DI通常和DS和ES一起使用.


The register BP, SP, and IP are called pointer registers.

BP, SP, 和IP叫做指針寄存器.


BP is base pointer, SP is stack pointer, and IP is instruction pointer. Usually BP is used for preserving space to use local variables.

BP是基指針, SP是棧指針, IP是指令指針. 通常BP用來保存使用局部變量的地址.


SP is used to point the current stack. Although SP can be modified easily, you must be cautious. It's because doing the wrong thing with this register could cause your program in ruin.

SP用來指向當前的棧. 儘管SP可以被很容易地修改, 你還是一定要非常小心. 因爲如果這個寄存器搞錯了, 你的程序就毀了.


IP denotes the current pointer of the running program. It is always coupled with CS and it is NOT modifiable.

IP用來指示當前運行程序的當前指針. 通常和CS一起使用, IP是不允許修改的.


So, the couple of CS:IP is a pointer pointing to the current instruction of running program. You can NOT access CS nor IP directly.

所以, CS:IP配對用來指示當前運行的指令地址. 你不能直接訪問CS, 也不能直接訪問IP.


FS和GS寄存器是從386開始纔有的. FS主要用來指向Thread Information Block(TIB).


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章