Why MOV AH,1 is not supported in 64 bit mode of intel microprocessor?

后端 未结 2 767
北海茫月
北海茫月 2020-12-20 03:29

In the book \"THE INTEL MICROPROCESSORS\" of Barry B. Brey, it is written that

MOV AH, 1

is not allowed in 64 bit mode, but allowed in 32

2条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-20 03:58

    There is no problem with mov ah,1. It runs just fine in X64 mode.

    The opcode for it is b4 01.

    The only time when mov ah is not allowed is when the mov has a REX prefix.

    from: http://www.felixcloutier.com/x86/MOV.html

    ***In 64-bit mode, r/m8 can not be encoded to access the following byte registers if a REX prefix is used: AH, BH, CH, DH.

    In that case the high byte registers (AH, BH, CH, and DH) are redefined as DIL, SIL, BPL and SPL. But this is only if a REX prefix is present.

    Instructions with a REX prefix are:

    anything with the R8..R15 regs and parts thereof
    anything that accesses the new 8 bit regs: DIL, SIL, BPL, SPL
    anything that accesses 64 bit registers.
    

提交回复
热议问题