I've been looking into the Software Developer's Manual of the x86 architecture trying to brush my reverse engineering skills. I know that the architecture is complex and backwards compatible with previous generations. With newer generations some of the older documentation parts get left out. But one of the disturbing explanations and misinterpretations were instructions similar to this one:
80 /2 ib
So instructions based on the following 80 OpCode would be followed by a MOD/RM/REG byte.
One of the side affects of disregarding old content, I had no clue about different versions MOD/RM/REG byte. But I always assumed their was a difference due to the architectural roots being 8/16-bit. Thankfully I stumbled on the dissection of the MOD/RM/REG byte during the original introduction of the architecture.
So instructions as the one provided above followed by the forward slash digit says that the Octal value would be contained within the RM offset of the MOD/RM/REG byte would be a value of 2.
My actual question(s) are the following:
Does the MOD offset in MOD/RM/REG byte accept all addressing modes in the current condition or are there any imposed restrictions?
The other thing does anybody have a clue why the digit is specified with a /2? Would that be a reason to assume that lower values were used in older generations of the ISA and thus are preserved for backwards compatibility.
/2refers to the value ofregfield ofModRMbyte.regfield has size of 3 bits (bits 3..5). In AMD manual Vol 3:/n A ModRM-byte reg field or SIB-byte base field, where n is a value between zero (binary 000) and 7 (binary 111).ibmeans immediate byte. In 16-bit code80 00 00isadd byte [bx+si], 0x0,80 08 00isor byte [bx+si], 0x0,80 10 00isadc byte [bx+si], 0x0,80 18 00issbb byte [bx+si], 0x0,80 20 00isand byte [bx+si], 0x0,80 28 00issub byte [bx+si], 0x0,80 30 00isxor byte [bx+si], 0x0, and80 38 00iscmp byte [bx+si], 0x0.