Intel® ISA Extensions
Use hardware-based isolation and memory encryption to provide more code protection in your solutions.

The structure of ModR/M byte

logicman112
Beginner
595 Views
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?
0 Kudos
1 Solution
neni
New Contributor II
595 Views
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

View solution in original post

0 Kudos
2 Replies
neni
New Contributor II
596 Views
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
0 Kudos
logicman112
Beginner
595 Views
thank you neni for clear explanation.

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