The MASM Forum Archive 2004 to 2012

Miscellaneous Forums => 16 bit DOS Programming => Topic started by: leetow2003 on November 27, 2010, 01:32:47 PM

Title: Ask a question about prefix of operand
Post by: leetow2003 on November 27, 2010, 01:32:47 PM
Hello all:
Look:
jump32 macro  selector,offsetv
         db     66h
         db     0eah      ;jmp
         dd     offsetv   ;4 bytes offset address
         dw     selector 
       endm
I find that these codes are unassembled:jmp selector:offsetv,and the
codes are embedded in 16-bit real mode,then look:
jump16 macro  selector,offsetv
        db     66h 
        db     0eah       ;jmp
        dw     offsetv    ;2 bytes offset address
        dw     selector 
      endm
but these codes aren't unassembled:jmp selector:offsetv in 32-bit p-mode,
I want to know which is operand,selector or offsetv?And which operand
is influenced by the prefix 66h,selector or offsetv?




Title: Re: Ask a question about prefix of operand
Post by: clive on November 27, 2010, 01:48:50 PM
How the prefix is interpreted depends on the current mode of the processor. A disassembler looking at such code would need to know the context (16/32-bit) in effect to display the correct interpretation.

A segment/selector is always viewed as a 16-bit value, the address is what is 16 or 32-bit. The prefix inverts the normal sense the processor is working with.