assembly - x86 OpCode Instruction Decoding -


I'm looking at the software developer's manual of x86 architecture trying to brush my reverse engineering skills. I know that architecture is complex and is backwards compatible with previous generations. Parts of old documents are abandoned with new generations. But one of the disturbing explanations and misinterpretations was such as:

  80/2 ib  

then the instructions on the following 80 will be followed by a MOD / RM / REG byte by OpCode. On the one hand, there is an impact on the exclusion of old material, I have no clue about the different versions, which MOD / RM / RAG byte but I always believed that due to the fact that the Vaastu roots are 8/16-bit their difference Was there. Thankfully, I stumbled on the dissection of MOD / RM / REG byte during the original introduction of architecture.

The instructions are given as follows, which are in accordance with the forward slash number given above, within the RM offset of MOD / RM / REG byte, value 2 will be honoured.

My real questions are:

Does the offset MOD in MOD / RM / REG byte accept all address modes in the current state or is there any restriction? Secondly, does anyone have a clue, why is the digit specified with / 2 ? Does it believe that low values ​​are used in the old generations of ISA and behind this it is preserved for backward compatibility.

You should read the Chapter 2 instruction format in the manual. As a summary summary, the / numeral notation of the value given by reg / opcode field modr / m byte as an opcode extension of the given value Does. The manual says: Specifies either a register number or three more bits of opcode information in the reg / opcode field. See also 32-bit addressing form with table 2-2 ModR / m byte .

The OPOD extension is used when there is no other registration operator, such as for quick, as in your example ADC R / M8, IM8 Other instructions exist with the main opcode 80 , but you can view the different extensions in table A-6 for group number for one and two-byte opoad extension , And see that the opoad extension from 0 to 7 ADD , OR , ADC , Sbibi , and , sub , XOR , CMP , respectively.

Also keep in mind that modr / m and thus this encoding scheme is also used in 32 and 64 bit code, so it is not something obsolete, for example, ADC [EX] , 0x42 contains the machine code 80 10 42 , where 80 is the main opcode, 10 in the reged area, a 2 Moderator / M with and specify [eax] , and absolutely 42 is immediate. / P>


Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -