Current location - Education and Training Encyclopedia - Educational Knowledge - I don't understand some basic knowledge of assembly language. Please help me ~
I don't understand some basic knowledge of assembly language. Please help me ~
These two instructions, seemingly similar, are actually essentially different.

The source operands of the instruction MOBVX, AX belong to register direct addressing, that is, the operands are in this register.

The source operand of the instruction MOBVX, [AX], belongs to register indirect addressing, that is, the operand is in the memory location pointed by this register. But this instruction has a serious problem: AX cannot be used as an index register, or AX is not an index register. There are four index registers as follows:

BX: base address register

SI: source index register

DI: destination index register

BP: stack index register

In the case of not using the prefix beyond the segment, there are the following provisions:

1. If the effective address is specified by one of SI, DI and BX, the default segment register is DS;

2. If the effective address is specified by BP, its default segment register is ss (i.e. stack segment).

Suppose there is an instruction: MOV BX, [di]. When executing, (DS)= 1000H, (DI)=2345H, and the content of storage unit 12345H is 4354H. What is the value of BX after executing the instruction?

Solution: According to the rule of register indirect addressing mode, when executing the instruction in this example, the value of register di is not the operand, but the address of the operand. The physical address of this operand should consist of the values of DS and DI, namely:

PA =(DS)* 16+DI = 1000h * 16+2345h = 12345h .

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