1
寄存器工厂和仓库,电力能源,手动输入变化的化学信息材料。
并行寄存器
移位寄存器
通用寄存器 : EAX:通用寄存器。相对其他寄存器,在进行运算方面比较常用。在保护模式中,也可以作为内存偏移指针(此时,DS作为段 寄存器或选择器)
EBX:通用寄存器。通常作为内存偏移指针使用(相对于EAX、ECX、EDX),DS是默认的段寄存器或选择器。
在保护模式中,同样可以起这个作用。
ECX:通用寄存器。通常用于特定指令的计数。在保护模式中,也可以作为内存偏移指针(此时,DS作为 寄存器或段选择器)。
EDX:通用寄存器。在某些运算中作为EAX的溢出寄存器(例如乘、除)。
在保护模式中,也可以作为内存偏移指针(此时,DS作为段 寄存器或选择器)。
同AX分为AH&AL一样,上述寄存器包括对应的16-bit分组和8-bit分组。
标志寄存器 : 标志寄存器(EFlags)
进位标志CF(Carry Flag) 进位标志CF主要用来反映运算是否产生进位或借位。
如果运算结果的最高位产生了一个进位或借位,那么,其值为1,否则其值为0。
使用该标志位的情况有:多字(字节)数的加减运算,无符号数的大小比较运算,
移位操作,字(字节)之间移位,专门改变CF值的指令等。
奇偶标志PF(Parity Flag)
奇偶标志PF用于反映运算结果中”1″的个数的奇偶性。
如果”1″的个数为偶数,则PF的值为1,否则其值为0。
利用PF可进行奇偶校验检查,或产生奇偶校验位。
在数据传送过程中,为了提供传送的可靠性,
如果采用奇偶校验的方法,就可使用该标志位。
辅助进位标志AF(Auxiliary Carry Flag)
在发生下列情况时,辅助进位标志AF的值被置为1,否则其值为0:
(1)、在字操作时,发生低字节向高字节进位或借位时;
(2)、在字节操作时,发生低4位向高4位进位或借位时。
对以上6个运算结果标志位,
在一般编程情况下,标志位CF、ZF、SF和OF的使用频率较高,
而标志位PF和AF的使用频率较低。
零标志ZF(Zero Flag)
零标志ZF用来反映运算结果是否为0。如果运算结果为0,则其值为1,否则其值为0。
在判断运算结果是否为0时,可使用此标志位。
符号标志SF(Sign Flag)
符号标志SF用来反映运算结果的符号位,它与运算结果的最高位相同。
在微机系统中,有符号数采用补码表示法,所以,SF也就反映运算结果的正负号。
运算结果为正数时,SF的值为0,否则其值为1。
溢出标志OF(Overflow Flag)
溢出标志OF用于反映有符号数加减运算所得结果是否溢出。
如果运算结果超过当前运算位数所能表示的范围,则称为溢出,OF的值被置为1,
否则,OF的值被清为0。”
溢出”和”进位”是两个不同含义的概念,不要混淆。
I/O特权标志IOPL(I/O Privilege Level)
I/O特权标志用两位二进制位来表示,也称为I/O特权级字段。
该字段指定了要求执行I/O指令的特权级。
如果当前的特权级别在数值上小于等于IOPL的值,那么,该I/O指令可执行,否则将发生一个保护异常。
嵌套任务标志NT(Nested Task)
嵌套任务标志NT用来控制中断返回指令IRET的执行。具体规定如下:
(1)、当NT=0,用堆栈中保存的值恢复EFLAGS、CS和EIP,执行常规的中断返回操作;
(2)、当NT=1,通过任务转换实现中断返回。
重启动标志RF(Restart Flag)
重启动标志RF用来控制是否接受调试故障。规定:RF=0时,表示”接受”调试故障,否则拒绝之。
在成功执行完一条指令后,处理机把RF置为0,当接受到一个非调试故障时,处理机就把它置为1。
虚拟8086方式标志VM(Virtual 8086 Mode)
如果该标志的值为1,则表示处理机处于虚拟的8086方式下的工作状态,
否则,处理机处于一般保护方式下的工作状态
段寄存器 : 段寄存器(ES、CS、SS、DS、FS和GS)
CS——代码段寄存器(Code Segment Register),其值为代码段的段值;
DS——数据段寄存器(Data Segment Register),其值为数据段的段值;
ES——附加段寄存器(Extra Segment Register),其值为附加数据段的段值;
SS——堆栈段寄存器(Stack Segment Register),其值为堆栈段的段值;
FS——附加段寄存器(Extra Segment Register),其值为附加数据段的段值;
GS——附加段寄存器(Extra Segment Register),其值为附加数据段的段值
向量寄存器
常数寄存器
浮点寄存器
地址寄存器
特殊目的寄存器
指令寄存器
索引寄存器
存储器缓冲寄存器
存储器数据寄存器
存储器地址寄存器
存储器型态范围寄存器
AX
累加寄存器 : AH&AL=AX(accumulator):累加寄存器,常用于运算;在乘除等指令中指定用来存放操作数,另外,
所有的I/O指令都使用这一寄存器与外界设备传送数据.
BX
基址寄存器 : BH&BL=BX(base):基址寄存器,常用于地址索引;
CX
计数寄存器 : CH&CL=CX(count):计数寄存器,常用于计数;常用于保存计算值,如在移位指令,循环(loop)和串处理指令中用作隐含的计数器
DX
数据寄存器 : DH&DL=DX(data):数据寄存器,常用于数据传递。
数据寄存器(EAX、EBX、ECX和EDX)
指针寄存器 : 指针寄存器(ESP和EBP)
变址寄存器 : ESI
ESI、EDI、SI和DI称为变址寄存器(Index Register)
SP
堆栈指针 : SP(Stack Pointer):堆栈指针,与SS配合使用,可指向目前的堆栈位置;
BP
基址指针寄存器 : BP(Base Pointer):基址指针寄存器,可用作SS的一个相对基址位置;
SI
源变址寄存器 : SI(Source Index):源变址寄存器可用来存放相对于DS段之源变址指针;
DI
目的变址寄存器 : DI(Destination Index):目的变址寄存器,可用来存放相对于 ES 段之目的变址指针。
CS
代码段寄存器 : CS(Code Segment):代码段寄存器;
DS
数据段寄存器 : DS(Data Segment):数据段寄存器;
SS
堆栈段寄存器 : SS(Stack Segment):堆栈段寄存器;
ES
附加段寄存器 : ES(Extra Segment):附加段寄存器
UxCTL寄存器
控制寄存器 : CR0, CR2, CR3(控制寄存器)。举一个例子,CR0的作用是切换实模式和保护模式。
调试寄存器 : D0, D1, D2, D3, D6和D7(调试寄存器)。他们可以作为调试器的硬件支持来设置条件断点。
测试寄存器 : TR3, TR4, TR5, TR6 和 TR? 寄存器(测试寄存器)用于某些条件测试
模式指示寄存器(机器指示寄存器)
深入浅谈,CPU设计原理(已完结) :caolizhen
https://bbs.kafan.cn/thread-563743-1-1.html
Last edited by zzz19760225 on 2018-9-19 at 19:11 ]
1
Register Factory and Warehouse, Power Energy, Manually Inputting Changing Chemical Information Materials.
Parallel Registers
Shift Registers
General Registers: EAX: General register. Compared with other registers, it is more commonly used in arithmetic operations. In protected mode, it can also be used as a memory offset pointer (at this time, DS is used as a segment register or selector)
EBX: General register. Usually used as a memory offset pointer (compared with EAX, ECX, EDX), DS is the default segment register or selector.
In protected mode, it can also play this role.
ECX: General register. Usually used for counting in specific instructions. In protected mode, it can also be used as a memory offset pointer (at this time, DS is used as a register or segment selector).
EDX: General register. In some operations, it is used as an overflow register of EAX (for example, multiplication and division).
In protected mode, it can also be used as a memory offset pointer (at this time, DS is used as a segment register or selector).
Similar to AX being divided into AH & AL, the above registers include corresponding 16-bit groups and 8-bit groups.
Flags Register: Flags Register (EFlags)
Carry Flag CF (Carry Flag) The carry flag CF is mainly used to reflect whether a carry or borrow is generated in the operation.
If a carry or borrow is generated in the highest bit of the operation result, then its value is 1, otherwise its value is 0.
The situations where this flag bit is used include: addition and subtraction operations of multi-word (byte) numbers, size comparison operations of unsigned numbers,
Shift operations, shifts between words (bytes), instructions that specifically change the CF value, etc.
Parity Flag PF (Parity Flag)
The parity flag PF is used to reflect the parity of the number of "1"s in the operation result.
If the number of "1"s is even, then the value of PF is 1, otherwise its value is 0.
Using PF can perform parity check and generate parity bits.
In the process of data transmission, in order to provide the reliability of transmission,
If the parity check method is adopted, this flag bit can be used.
Auxiliary Carry Flag AF (Auxiliary Carry Flag)
The value of the auxiliary carry flag AF is set to 1 in the following situations, otherwise its value is 0:
(1) When a carry or borrow occurs from the low byte to the high byte during a word operation;
(2) When a carry or borrow occurs from the low 4 bits to the high 4 bits during a byte operation.
For the above 6 operation result flag bits,
In general programming, the flag bits CF, ZF, SF, and OF are used more frequently,
While the flag bits PF and AF are used less frequently.
Zero Flag ZF (Zero Flag)
The zero flag ZF is used to reflect whether the operation result is 0. If the operation result is 0, then its value is 1, otherwise its value is 0.
When judging whether the operation result is 0, this flag bit can be used.
Sign Flag SF (Sign Flag)
The sign flag SF is used to reflect the sign bit of the operation result, which is the same as the highest bit of the operation result.
In the microcomputer system, signed numbers are represented in two's complement, so SF also reflects the positive or negative sign of the operation result.
When the operation result is positive, the value of SF is 0, otherwise its value is 1.
Overflow Flag OF (Overflow Flag)
The overflow flag OF is used to reflect whether the result of the signed number addition and subtraction operation overflows.
If the operation result exceeds the range that can be represented by the current operation bit, it is called an overflow, and the value of OF is set to 1,
Otherwise, the value of OF is cleared to 0. "
"Overflow" and "carry" are two concepts with different meanings, so don't confuse them.
I/O Privilege Flag IOPL (I/O Privilege Level)
The I/O privilege flag is represented by two binary bits, also called the I/O privilege level field.
This field specifies the privilege level required to execute I/O instructions.
If the current privilege level is numerically less than or equal to the value of IOPL, then this I/O instruction can be executed, otherwise a protection exception will occur.
Nested Task Flag NT (Nested Task)
The nested task flag NT is used to control the execution of the interrupt return instruction IRET. The specific regulations are as follows:
(1) When NT = 0, restore EFLAGS, CS, and EIP with the values saved in the stack, and perform a normal interrupt return operation;
(2) When NT = 1, the interrupt return is realized through task switching.
Restart Flag RF (Restart Flag)
The restart flag RF is used to control whether to accept debugging faults. It is stipulated that when RF = 0, it means "accept" debugging faults, otherwise it refuses.
After successfully executing an instruction, the processor sets RF to 0, and when a non-debugging fault is received, the processor sets it to 1.
Virtual 8086 Mode Flag VM (Virtual 8086 Mode)
If the value of this flag is 1, it means that the processor is in the working state in the virtual 8086 mode,
Otherwise, the processor is in the working state in the general protection mode
Segment Registers: Segment Registers (ES, CS, SS, DS, FS, and GS)
CS - Code Segment Register (Code Segment Register), the value is the segment value of the code segment;
DS - Data Segment Register (Data Segment Register), the value is the segment value of the data segment;
ES - Extra Segment Register (Extra Segment Register), the value is the segment value of the extra data segment;
SS - Stack Segment Register (Stack Segment Register), the value is the segment value of the stack segment;
FS - Extra Segment Register (Extra Segment Register), the value is the segment value of the extra data segment;
GS - Extra Segment Register (Extra Segment Register), the value is the segment value of the extra data segment
Vector Registers
Constant Registers
Floating-Point Registers
Address Registers
Special-Purpose Registers
Instruction Registers
Index Registers
Memory Buffer Register
Memory Data Register
Memory Address Register
Memory Type Range Register
AX
Accumulator Register: AH & AL = AX (accumulator): Accumulator register, often used in arithmetic operations; in instructions such as multiplication and division, it is specified to store operands, in addition,
All I/O instructions use this register to transfer data with external devices.
BX
Base Register: BH & BL = BX (base): Base register, often used for address indexing;
CX
Count Register: CH & CL = CX (count): Count register, often used for counting; often used to save the calculated value, such as used as an implicit counter in shift instructions, loops (loop), and string processing instructions
DX
Data Register: DH & DL = DX (data): Data register, often used for data transfer.
Data Registers (EAX, EBX, ECX, and EDX)
Pointer Registers: Pointer Registers (ESP and EBP)
Index Registers: ESI
ESI, EDI, SI, and DI are called Index Registers (Index Register)
SP
Stack Pointer: SP (Stack Pointer): Stack pointer, used in conjunction with SS, can point to the current stack position;
BP
Base Pointer Register: BP (Base Pointer): Base pointer register, can be used as a relative base position of SS;
SI
Source Index Register: SI (Source Index): The source index register can be used to store the source index pointer relative to the DS segment;
DI
Destination Index Register: DI (Destination Index): The destination index register can be used to store the destination index pointer relative to the ES segment.
CS
Code Segment Register: CS (Code Segment): Code segment register;
DS
Data Segment Register: DS (Data Segment): Data segment register;
SS
Stack Segment Register: SS (Stack Segment): Stack segment register;
ES
Extra Segment Register: ES (Extra Segment): Extra segment register
UxCTL Register
Control Registers: CR0, CR2, CR3 (Control Registers). For example, the role of CR0 is to switch between real mode and protected mode.
Debug Registers: D0, D1, D2, D3, D6, and D7 (Debug Registers). They can be used as hardware support for debuggers to set conditional breakpoints.
Test Registers: TR3, TR4, TR5, TR6, and TR? Registers (Test Registers) are used for certain conditional tests
Mode Indicator Register (Machine Indicator Register)
In-Depth Discussion, CPU Design Principles (Completed): caolizhen
https://bbs.kafan.cn/thread-563743-1-1.html
Last edited by zzz19760225 on 2018-9-19 at 19:11 ]