This section is based on the section 3-1 - interpreting the instruction pages reference of the intel documentation and used the jmp mnemonic as example.
Definition: The jmp mnemonic transfers program control to a different point in the instruction stream without recording return information.
From Intel 64 and IA-32 Architectures (See also appendix b instruction formats and encodings)
where:
The jmp mnemonic definition can be found in the Section 3.2 - JMP - page 1065 and shows a table where:
The transfer is one-way; that is, a return address is not saved. See also 7.3.8.1 - Unconditional Transfer Instructions
The first column is called the opcode column. . Example: EB cb. It shows the object code produced and has the following format:
The second column is the Instruction column and gives the syntax of the instruction statement as it would appear in an ASM386 program.
Example: jmp rel8.
It has the following format:
mnemonic operand
where operand (See section 3.1.1.3 for the definition of the symbol operands)
Instructions with an operand in memory have an addressing-form specifier byte called the ModR/M byte.
In the encoding definition table:
For the intel CPU, the description of each instruction class can be found in the Instruction Set reference (Volume 2) Intel® 64 and IA-32 Architectures - Software Developer’s Manual - Combined Volumes: 1, 2A, 2B, 2C, 2D, 3A, 3B, 3C, 3D and 4.
The jmp instructions with opcode FF /4 enable jumping to a near, absolute address stored in a general-purpose register or a memory location; or in short, as written in the description, absolute indirect.
; as [0x1234] means rel16 (which means 2-byte offset)
; jmp is then the ''FF /4'' jump
jmp [0x1234]
generates the machine code in the default 16 bit mode of nasm to the following instruction:
ff 26 34 12
where:
The ModR/M byte comes from the 16 bit ModR/M table: