汇编各类寄存器
in 汇编 with 0 comment
汇编各类寄存器
in 汇编 with 0 comment

在X86寄存器中,分为 (4大类):通用寄存器、指令指针寄存器、段寄存器、标志寄存器。

{dotted startColor="#ff6c6c" endColor="#1989fa"/}

通用寄存器(32位):数据寄存器、指针变址寄存器

数据寄存器EAXEBXECXEDX
指针变址寄存器EBPESPESIEDI

{dotted startColor="#ff6c6c" endColor="#1989fa"/}

数据寄存器

寄存器解释备注
EAX(Accumulator)累加寄存器在乘法和除法指令中被自动使用;在Win32中,一般用在函数的返回值中。
EBX(Base)基址寄存器DS段中的数据指针
ECX(Count)计数寄存器CPU自动使用ECX作为循环计数器,在字符串和循环操作中常用,在循环指令(LOOP)或串操作中,ECX用来进行循环计数,每执行一次循环,ECX都会被CPU自动减一
EDX(Data)数据寄存器

指针变址寄存器:

寄存器解释备注
EBP(Base Pointer)扩展基址指针寄存器SS段中堆栈内数据指针。EBP由高级语言用来引用参数和局部变量,通常称为堆栈基址指针寄存器。
ESP(Stack Pointer)堆栈指针寄存器SS段中堆栈指针。ESP用来寻址堆栈上的数据,ESP寄存器一般不参与算数运算。
ESI(Source Index)源变址寄存器字符串操作源指针
EDI(Destination Index)目的指针寄存器字符串操作目标指针

{dotted startColor="#ff6c6c" endColor="#1989fa"/}

指令指针寄存器:

寄存器解释备注
EIP(Instruction Pointer)指令指针寄存器保存着下一条要执行的指令的地址。程序运行时,CPU会读取EIP中的一条指令的地址,传送指令到指令缓冲区后,EIP寄存器的值自动增加,增加的大小即是读取指令的字节大小,即下一条指令的地址为当前指令的地址加上当前指令的长度。

{dotted startColor="#ff6c6c" endColor="#1989fa"/}
段寄存器:

寄存器解释
CS(Code Segment)代码段
DS(Data Segment)数据段
SS(Stack Segment)堆栈段
ES(Extra Segment)附加数据段
FS附加数据段
GS附加数据段

{dotted startColor="#ff6c6c" endColor="#1989fa"/}

标志寄存器

寄存器解释备注
FLAGS(flags)或PSW标志寄存器程序状态字寄存器

标志寄存器 又分为两类:条件标志寄存器、控制标志寄存器

条件标志寄存器:

寄存器解释备注
OF(OverFlow Flag)溢出标志位用来反应有符号数加减法运算所得结果是否溢出。运算超出当前运算位数所能表示的范围,则称为溢出,标志位被置为1,否则为0。
SF(Sign Flag)符号标志位用来反应运算结果是否为0。运算结果为负时置为1,否则为0。
ZF(Zero Flag)零标志位用来反应运算结果是否为0。为零时置为1,否则为0。
AF(Auxilliary carry Flag)辅助进位标志位在字操作址,发生低字节向高字节进位或借位时该标志位被置为1,否则为0。
PF(Parity Flag)奇偶标志位用于反应结果中“1”的个数的奇偶性。如果“1”为偶数置为1,否则为0。
CF(Carry Flag)进位标志位运算结果的最高位产生了一个进位或错位,则该标志位置为1,否则为0。

控制标志寄存器:

寄存器解释备注
DF(Direction Flag)方向标志位用于串操作指令中,控制地址的变化方向。当DF为0时,存储器地址自动增加;当 DF为1时,存储器地址自动减少。
IF(Interupt Flag)中断标志位用于控制外部可屏蔽中断是否可以被处理器响应。
TF(Trap Flag)陷阱标志位用于控制处理器是否进入单步操作方式。当TF为0时,处理器在正常模式下运行;当为1时,处理器单步执行指令,调试器可以逐步指令进行执行就是使用了该标志位。

Deprecated: array_key_exists(): Using array_key_exists() on objects is deprecated. Use isset() or property_exists() instead in /www/wwwroot/ae.lcean.com/usr/themes/pinghsu-master/post.php on line 109

Deprecated: array_key_exists(): Using array_key_exists() on objects is deprecated. Use isset() or property_exists() instead in /www/wwwroot/ae.lcean.com/usr/themes/pinghsu-master/post.php on line 111

Deprecated: array_key_exists(): Using array_key_exists() on objects is deprecated. Use isset() or property_exists() instead in /www/wwwroot/ae.lcean.com/usr/themes/pinghsu-master/post.php on line 113

Deprecated: array_key_exists(): Using array_key_exists() on objects is deprecated. Use isset() or property_exists() instead in /www/wwwroot/ae.lcean.com/usr/themes/pinghsu-master/post.php on line 115

Deprecated: array_key_exists(): Using array_key_exists() on objects is deprecated. Use isset() or property_exists() instead in /www/wwwroot/ae.lcean.com/usr/themes/pinghsu-master/post.php on line 117

Deprecated: array_key_exists(): Using array_key_exists() on objects is deprecated. Use isset() or property_exists() instead in /www/wwwroot/ae.lcean.com/usr/themes/pinghsu-master/post.php on line 119

Deprecated: array_key_exists(): Using array_key_exists() on objects is deprecated. Use isset() or property_exists() instead in /www/wwwroot/ae.lcean.com/usr/themes/pinghsu-master/post.php on line 121

Deprecated: array_key_exists(): Using array_key_exists() on objects is deprecated. Use isset() or property_exists() instead in /www/wwwroot/ae.lcean.com/usr/themes/pinghsu-master/post.php on line 123

Deprecated: array_key_exists(): Using array_key_exists() on objects is deprecated. Use isset() or property_exists() instead in /www/wwwroot/ae.lcean.com/usr/themes/pinghsu-master/post.php on line 125

Deprecated: array_key_exists(): Using array_key_exists() on objects is deprecated. Use isset() or property_exists() instead in /www/wwwroot/ae.lcean.com/usr/themes/pinghsu-master/post.php on line 127
Responses