background image

Vol. 2D A-17

OPCODE MAP

A.4 

OPCODE EXTENSIONS FOR ONE-BYTE AND TWO-BYTE OPCODES

Some 1-byte and 2-byte opcodes use bits 3-5 of the ModR/M byte (the nnn field in Figure A-1) as an extension of 
the opcode.

Opcodes that have opcode extensions are indicated in Table A-6 and organized by group number. Group numbers 
(from 1 to 16, second column) provide a table entry point. The encoding for the r/m field for each instruction can 
be established using the third column of the table.

A.4.1  

Opcode Look-up Examples Using Opcode Extensions

An Example is provided below.

Example A-4.  Interpreting an ADD Instruction

An ADD instruction with a 1-byte opcode of 80H is a Group 1 instruction:

Table A-6 indicates that the opcode extension field encoded in the ModR/M byte for this instruction is 000B. 

The r/m field can be encoded to access a register (11B) or a memory address using a specified addressing 
mode (for example: mem = 00B, 01B, 10B).

Example A-5.  Looking Up 0F01C3H

Look up opcode 0F01C3 for a VMRESUME instruction by using Table A-2Table A-3 and Table A-6:

0F tells us that this instruction is in the 2-byte opcode map.

01 (row 0, column 1 in Table A-3) reveals that this opcode is in Group 7 of Table A-6.

C3 is the ModR/M byte. The first two bits of C3 are 11B. This tells us to look at the second of the Group 7 rows 
in Table A-6.

The Op/Reg bits [5,4,3] are 000B. This tells us to look in the 000 column for Group 7.

Finally, the R/M bits [2,1,0] are 011B. This identifies the opcode as the VMRESUME instruction.

A.4.2  

Opcode Extension Tables

See Table A-6 below.

mod

nnn

R/M

Figure A-1.  ModR/M Byte nnn Field (Bits 5, 4, and 3)