X86 8086/8088中有多少寄存器?

X86 8086/8088中有多少寄存器?,x86,cpu,cpu-registers,microprocessors,X86,Cpu,Cpu Registers,Microprocessors,我参加了计算机体系结构课程,我知道处理器有32个寄存器,每个寄存器都是32位的。现在我正在学习计算机体系结构课程,在课程中我读到了8086已经完成。但我读的书和网站上显示了许多注册。我对8086和8088中的寄存器感到困惑。请帮帮我 注: 我对不同处理器中的不同寄存器大小有很好的了解。我只是对寄存器的数量感到困惑。8086和8088是16位处理器-它们的寄存器都是16位宽度。(一些指令将DX和AX的组合视为32位整数,如div输入和mul输出。) 注意,8086具有16位数据总线;8088具有8

我参加了计算机体系结构课程,我知道处理器有32个寄存器,每个寄存器都是32位的。现在我正在学习计算机体系结构课程,在课程中我读到了8086已经完成。但我读的书和网站上显示了许多注册。我对8086和8088中的寄存器感到困惑。请帮帮我

注:
我对不同处理器中的不同寄存器大小有很好的了解。我只是对寄存器的数量感到困惑。

8086和8088是16位处理器-它们的寄存器都是16位宽度。(一些指令将DX和AX的组合视为32位整数,如div输入和mul输出。)

注意,8086具有16位数据总线;8088具有8位数据总线。(因此加载/存储一个16位字需要2个总线周期。两个总线周期的地址仍然是20位。)

通用寄存器

8086 CPU有8个通用寄存器,每个寄存器有自己的名称:

AX-累加器寄存器(分为AH/AL):

BX-基址寄存器(分为BH/BL)

CX-计数寄存器(分为CH/CL):

DX-数据寄存器(分为DH/DL):

SI-源索引寄存器:

Can be used for pointer addressing of data
Used as source in some string processing instructions
Offset address relative to DS by default
Can be used for pointer addressing of data
Used as destination in some string processing instructions as ES:DI
Offset address relative to DS outside of string instructions
DI-目标索引寄存器:

Can be used for pointer addressing of data
Used as source in some string processing instructions
Offset address relative to DS by default
Can be used for pointer addressing of data
Used as destination in some string processing instructions as ES:DI
Offset address relative to DS outside of string instructions
BP-基指针:

Primarily used to access parameters and locals on the stack
Offset address relative to SS
SP-堆栈指针:

Always points to top item on the stack
Offset address relative to SS (but can't be used in 16-bit addressing modes)
Should always points to word (byte at even address)
An empty stack will have SP = FFFEh
段寄存器

  • CS-包含当前程序的段上的点
  • DS-通常指定义变量的段上的点
  • ES-额外段寄存器,由编码器定义其用法
  • SS-包含堆栈的段上的点
尽管可以在段寄存器中存储任何数据,但这绝不是一个好主意。段寄存器有一个非常特殊的用途——指向可访问的内存块

段寄存器与通用寄存器一起工作,以访问任何内存值。例如,如果我们想访问物理地址为12345h(十六进制)的内存,我们可以设置DS=1230h和SI=0045h。通过这种方式,我们可以形成20位线性地址,而不是单寄存器的16位地址。(这适用于实模式;在保护模式下,分段是不同的。)

CPU通过将段寄存器乘以10h并将通用寄存器添加到其中(1230h*10h+45h=12345h)来计算物理地址:

由两个寄存器组成的地址称为有效地址。
默认情况下,BX、SI和DI寄存器与DS段寄存器一起工作
BP和SP使用SS段寄存器。
其他通用寄存器不能形成有效地址。
此外,虽然BX可以形成有效地址,但BH和BL不能

专用寄存器

IP-指令指针:

Always points to next instruction to be executed
Offset address relative to CS
IP寄存器总是和CS段寄存器一起工作,它指向当前正在执行的指令

标志寄存器

标志寄存器-确定处理器的当前状态。它们在数学运算后由CPU自动修改,这允许确定结果的类型,并确定将控制转移到程序其他部分的条件。 通常不能直接访问这些寄存器

Carry Flag (CF) - this flag is set to 1 when there is an unsigned overflow. For example when you add bytes 255 + 1 (result is not in range 0...255). When there is no overflow this flag is set to 0.
Parity Flag (PF) - this flag is set to 1 when there is even number of one bits in (the low 8 bits of a) result, and to 0 when there is odd number of one bits. 
Auxiliary Flag (AF) - set to 1 when there is an unsigned overflow (carry-out) for low nibble (4 bits).
Zero Flag (ZF) - set to 1 when result is zero. For non-zero result this flag is set to 0.
Sign Flag (SF) - set to 1 when result is negative. When result is positive it is set to 0. (This flag takes the value of the most significant bit.)
Trap Flag (TF) - Used for on-chip debugging.
Interrupt enable Flag (IF) - when this flag is set to 1 CPU reacts to interrupts from external devices.
Direction Flag (DF) - this flag is used by some instructions to process arrays.  When this flag is set to 0 the processing is done forward, when this flag is set to 1 the processing is done backward.
Overflow Flag (OF) - set to 1 when there is a signed overflow. For example, when you add bytes 100 + 50 (result is not in range -128...127). 
我参加了计算机体系结构课程,我理解这个处理器 具有32个寄存器,每个寄存器的32位

这并不能回答你的问题,但是如果你想和其他工程师交流,你必须使用正确的语言。说“一个(某些)处理器有32个大小为32位的寄存器”并没有任何意义,处理器的数量是数不清的

8086有八个(或多或少通用)16位寄存器,包括 堆栈指针,但不包括指令指针,标志 寄存器和段寄存器。其中四个,AX,BX,CX,DX,可以 当 其他四个,BP、SI、DI、SP,仅为16位

我想这种困惑来自维基百科上的这句话。你读到的两个来源都是正确的。共有8个通用的紫色寄存器(在文章中被称为“或多或少的通用”,我不知道谁会写),它们是:AX BX CX DX和SI DI BP SP。还有段寄存器、特殊的紫色寄存器和标志寄存器(在“排除”字后注明,我猜,支持将其读为“有注册,如果不包括这3组,有8个注册”,这很模糊)


问题在于措辞。引用的句子令人困惑,我可以看出你的问题来自何处。提问从来都没有坏处,但你应该明白,维基百科不是可靠的知识来源,如果你感到困惑,就拿起一本书。

8086有14个16位寄存器。AX、BX、CX、DX、SI、DI、BP、SP、CS、DS、SS,ES、IP和标志寄存器。后两个寄存器只能间接访问。

计算机体系结构书籍通常使用MIPS作为示例,因为它非常简单且具有教育意义。MIPS有32个寄存器,但这并不意味着其他32位体系结构也有32个寄存器。此处的32位仅表示计算机有。它是与寄存器的数量没有任何关系

Carry Flag (CF) - this flag is set to 1 when there is an unsigned overflow. For example when you add bytes 255 + 1 (result is not in range 0...255). When there is no overflow this flag is set to 0.
Parity Flag (PF) - this flag is set to 1 when there is even number of one bits in (the low 8 bits of a) result, and to 0 when there is odd number of one bits. 
Auxiliary Flag (AF) - set to 1 when there is an unsigned overflow (carry-out) for low nibble (4 bits).
Zero Flag (ZF) - set to 1 when result is zero. For non-zero result this flag is set to 0.
Sign Flag (SF) - set to 1 when result is negative. When result is positive it is set to 0. (This flag takes the value of the most significant bit.)
Trap Flag (TF) - Used for on-chip debugging.
Interrupt enable Flag (IF) - when this flag is set to 1 CPU reacts to interrupts from external devices.
Direction Flag (DF) - this flag is used by some instructions to process arrays.  When this flag is set to 0 the processing is done forward, when this flag is set to 1 the processing is done backward.
Overflow Flag (OF) - set to 1 when there is a signed overflow. For example, when you add bytes 100 + 50 (result is not in range -128...127). 
ARM是最流行的32位体系结构,有16个寄存器(尽管ARMv8 64位将这个数字翻了一番,达到32个)。许多其他32位体系结构也有32以外的寄存器号,如Motoroka 68k和SuperH v2/3/4,它们都有16个寄存器。请看体系结构列表。您知道,64位体系结构很少有64个寄存器,因为这会大大增加寄存器文件的大小,并使上下文切换更糟。大多数体系结构都有32个寄存器。

几十年前与8086向后兼容的x86只有8个可见整数寄存器,但事实上,现在的x86 CPU有hundr
Carry Flag (CF) - this flag is set to 1 when there is an unsigned overflow. For example when you add bytes 255 + 1 (result is not in range 0...255). When there is no overflow this flag is set to 0.
Parity Flag (PF) - this flag is set to 1 when there is even number of one bits in (the low 8 bits of a) result, and to 0 when there is odd number of one bits. 
Auxiliary Flag (AF) - set to 1 when there is an unsigned overflow (carry-out) for low nibble (4 bits).
Zero Flag (ZF) - set to 1 when result is zero. For non-zero result this flag is set to 0.
Sign Flag (SF) - set to 1 when result is negative. When result is positive it is set to 0. (This flag takes the value of the most significant bit.)
Trap Flag (TF) - Used for on-chip debugging.
Interrupt enable Flag (IF) - when this flag is set to 1 CPU reacts to interrupts from external devices.
Direction Flag (DF) - this flag is used by some instructions to process arrays.  When this flag is set to 0 the processing is done forward, when this flag is set to 1 the processing is done backward.
Overflow Flag (OF) - set to 1 when there is a signed overflow. For example, when you add bytes 100 + 50 (result is not in range -128...127).