微擎pc 导入前缀_段覆盖前缀| 8086微处理器

微擎pc 导入前缀

As we already know that the effective address is calculated by appending the segment registers value and adding up the value of the respective offset. But what if we want to choose some other offset than the assigned one.

众所周知,有效地址是通过将段寄存器的值加上相应偏移量的值相加得出的。 但是,如果我们要选择分配的偏移量以外的其他偏移量,该怎么办。

This freedom is provided to us in 8086 microprocessor through the concept of Segment override prefix.

通过段覆盖前缀的概念在8086微处理器中为我们提供了这种自由。

The Segment Override Prefix says that if we want to use some other segment register than the default segment for a particular code, then it is possible. It can simply be one by mentioning the segment that is to be used before the address location or the offset register containing that address. By doing so, the machine, i.e. the 8086 microprocessor, while calculating the effective address will consider the mentioned segment for calculating the effective address rather than opting for the default one.

段覆盖前缀说,如果我们要为特定代码使用默认段以外的其他段寄存器,则可以。 只需提及要在地址位置或包含该地址的偏移寄存器之前使用的段,就可以成为一个。 这样,机器(即8086微处理器)在计算有效地址时将考虑上述段,以计算有效地址,而不是选择默认地址。

The syntax of doing so, as mentioned earlier is by mentioning the segment just before the address location and proceeded by a colon. The following abbreviations for each segment register are used for this purpose:

如前所述,这样做的语法是在地址位置之前并以冒号开头的段。 每个段寄存器的以下缩写用于此目的:

  • Stack Segment Register - SS

    堆栈段寄存器-SS

  • Data Segment Register - DS

    数据段寄存器-DS

  • Code Segment Register - CS

    代码段寄存器-CS

  • Extra Segment Register - ES

    额外的段寄存器-ES

Let us take the following examples to further understand this concept:

让我们通过以下示例进一步了解这个概念:

    MOV AX , [BX]

This is a normal instruction without any segment overriding. Hence the effective address will be calculated by using the default segment itself. Therefore, the effective address for the above-mentioned instruction:

这是一条正常的指令,没有任何段覆盖。 因此,有效地址将通过使用默认段本身来计算。 因此,上述指令的有效地址为:

Effective address = DS X 10H + content of BX register

有效地址= DS X 10H + BX寄存器的内容

    MOV AX, SS : [BX]

Here, in this case, the Stack segment register is used as a prefix for the offset BX. So, instead of DS, which is the default segment register for BX, the SS will be used for finding the effective address location. Therefore, the effective address in the above-mentioned equation will be:

在这种情况下,堆栈段寄存器用作偏移量BX的前缀。 因此,将使用SS代替BX的默认段寄存器DS来查找有效地址位置。 因此,上述公式中的有效地址为:

Effective address = SS X 10H + content of BX register

有效地址= SS X 10H + BX寄存器的内容

    MOV BX, SS:[1002H]

Here, in this case, the address from where the data is to be fetched is directly mentioned in the instruction. By default, such cases take the Data Segment (DS) as its offset. But as the SS is the mentioned register in the given instruction, then it will be used here. Therefore, the effective address for the given instruction is:

在这种情况下,在指令中直接提到要从中提取数据的地址。 默认情况下,此类情况将数据段( DS )作为其偏移量。 但是由于SS是给定指令中提到的寄存器,因此将在此处使用它。 因此,给定指令的有效地址为:

    Effective Address = SS X 10H + 1002H

翻译自: https://www.includehelp.com/embedded-system/segment-override-prefix-8086-microprocessor.aspx

微擎pc 导入前缀

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值