What does SEG directive do in 8086?

前端 未结 3 1694
花落未央
花落未央 2021-01-23 19:51

SEG A :

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

I guess that means

3条回答
  •  不思量自难忘°
    2021-01-23 20:18

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

    Correct, if DS points to Data Segment.

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

    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.

提交回复
热议问题