我阅读的是第二卷,Chapter2 Instruction Format.
有些地方实在不明白:
2.4. MODR/M AND SIB BYTES Most instructions that refer to an operand in memory have an addressing-form specifier byte (called the ModR/M byte) following the primary opcode. The ModR/M byte contains three fields of information: • The mod field combines with the r/m field to form 32 possible values: eight registers and 24 addressing modes. • The reg/opcode field specifies either a register number or three more bits of opcode information. The purpose of the reg/opcode field is specified in the primary opcode. • The r/m field can specify a register as an operand or can be combined with the mod field to encode an addressing mode. Certain encodings of the ModR/M byte require a second addressing byte, the SIB byte, to fully specify the addressing form. The base-plus-index and scale-plus-index forms of 32-bit addressing require the SIB byte. The SIB byte includes the following fields: • The scale field specifies the scale factor. • The index field specifies the register number of the index register. • The base field specifies the register number of the base register. See Section 2.6., “Addressing-Mode Encoding of ModR/M and SIB Bytes
如果能列举一个例子也许还能读懂,什么样的汇编指令?哪条用到SIB了,如何fully specify the addressing form?
2.6. ADDRESSING-MODE ENCODING OF MODR/M AND SIB BYTES
第四段: Across the top of Tables 2-1 and 2-2, the eight possible values of the 3-bit Reg/Opcode field are listed, in decimal (sixth row from top) and in binary (seventh row from top). The seventh row is labeled “REG=”, which represents the use of these 3 bits to give the location of a second operand, which must be a general-purpose, MMX, or XMM register. If the instruction does not require a second operand to be specified, then the 3 bits of the Reg/Opcode field may be used as an extension of the opcode, which is represented by the sixth row, labeled “/digit (Opcode)”.
能不能举个例子?指令不需要第二个操作数,3 bits of Reg/Opcode域会成为扩展?太抽象了,能不能给一条汇编指令
我自己可以反汇编来看看。
APPENDIX B INSTRUCTION FORMATS AND ENCODINGS
B.1. MACHINE INSTRUCTION FORMAT
The primary opcode for an instruction is encoded in one or two bytes of the instruction. Some instructions also use an opcode extension field encoded in bits 5, 4, and 3 of the ModR/M byte. Within the primary opcode, smaller encoding fields may be defined. These fields vary according to the class of operation being performed. The fields define such information as register encoding, conditional test performed, or sign extension of immediate byte.
这段更令人费解:主要操作码中,什么时smaller encoding fields, conditional test 和sign extension又是指什么,
感觉都没有这样的汇编指令对应一样,能否也给条汇编指令的例子?
|