Seven addressing modes (register relative addressing mode)

Publisher:科技火箭Latest update time:2017-01-22 Source: eefocus Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

The operand is in memory and its effective address is a base register (BX, BP) or an index register (SI, D

I) and the 8-bit/16-bit offset in the instruction. The calculation formula for its effective address is shown in the formula.

Without using the segment override prefix, the following provisions apply:
 
    If the effective address is specified by one of SI, DI, and BX, the default segment register is DS;
 
    if the effective address is specified by BP, the default segment register is SS.
 
The 8-bit/16-bit offset given in the instruction is represented by a complement code. When calculating the effective address, if the offset is 8 bits, it is sign-extended to 16 bits. When the effective address obtained exceeds 0FFFFH, its 64K modulus is taken.

Example: Assume the instruction: MOV BX, [SI+100H]. When it is executed, (DS)=1000H, (SI)=2345H, and the content of memory unit 12445H is 2715H. What is the value of BX after the instruction is executed?

Solution: According to the rules of register relative addressing mode, when executing this instruction, the effective address EA of the source operand is:
 
EA=(SI)+100H=2345H+100H=2445H.
 
The physical address of the operand should be formed by the values ​​of DS and EA, that is:
 
PA=(DS)*16+EA=1000H*16+2445H=12445H.

Therefore, the execution effect of this instruction is: the value of a word starting from the physical address 12445H is transferred to BX.

The execution process is shown in the figure.


Reference address:Seven addressing modes (register relative addressing mode)

Previous article:Seven addressing modes (base address plus index addressing mode)
Next article:Seven addressing modes (register indirect addressing mode)

Latest Microcontroller Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号