For these two instructions (https://www.felixcloutier.com/x86/adc):
12 /r ADC r8, r/m8
- Add with carry r/m8 to byte register.
REX + 12 /r ADC r8*, r/m8*
- Add with carry r/m641 to byte register.*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.
Both of these can have the REX prefix if the register on the first instruction is 9-16... So how does the CPU differentiate between the two? Is the REX prefix on the first instruction missing the 1 in the 7th bit so it's just REX.B 0x01?
Footnote 1: editor's note: That's a typo in Intel's manual. Both are 8-bit operand-size, so both should describe an "r/m8" source, not "r/m64". 16/32/64-bit operand-size has a different opcode than 8-bit, and REX.W or a 66h
prefix select the operand-size attribute.