SEG指令在8086中起什么作用?

问题描述:

SEG A:

Assigns the content held in segment register corresponding to the segment in which A resides to the operand.

我想这意味着如果A位于数据段中,则SEG ADS相同.

I guess that means that if A lies in Data Segment, SEG A is the same as DS.

由于DS保存数据段的基地址,所以

Since DS holds the base address of the Data Segment, does

MOV AX, LEA A
MOV DX, SEG A
MOV AX, [AX + DX]

A物理地址复制到AX吗?

我想这意味着如果A位于数据段中,则SEG A与DS相同.

I guess that means that if A lies in Data Segment, SEG A is the same as DS.

如果DS指向数据段,则正确.

Correct, if DS points to Data Segment.

确实
MOV AX,LEA A
MOV DX,SEG A
MOV AX,[AX + DX]
将A的物理地址复制到AX?

does
MOV AX, LEA A
MOV DX, SEG A
MOV AX, [AX + DX]
copy the physical address of A to AX?

最后一条指令无效,在任何x86 CPU中都不存在.因此,此代码完全不执行任何操作.如果有的话,它只是位于.asm文件中,等待更正和组装.

The last instruction is invalid, it does not exist in any of x86 CPUs. As such, this code does nothing at all. If anything, it just sits in an .asm file waiting to be corrected and assembled.