The structure of ModR/M byte

The structure of ModR/M byte

7.3.2.3
Increment and Decrement Instructions in 64-Bit Mode
The INC and DEC instructions are supported in 64-bit mode. However, some forms of
INC and DEC (the register operand being encoded using register extension field in the MOD R/M byte are not encodable in 64-bit mode because the opcodes are treated as REX prefixes.
------------------------------------------------------------------------------------

Where is the register extension field of ModR/M byte?

3 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.
Best Reply

in 32 bit you can encode inc eax using two forms direct with register number (0x40+ reg_num- single byte) or using modr/m form (ff /0 - two bytes encoding, with the register being encoded in the m section of the byte and 11b as mod). in 64 bit the 1st form is gone and treated as REX prefix, but you can still use the 2nd form to encode inc/dec

thank you neni for clear explanation.

and register extention field is the Mod/RM byte itself.

Leave a Comment

Please sign in to add a comment. Not a member? Join today