The op code/addressing mode byte(s) may be followed by:

Which of these possibilities is used is determined by the op code and addressing mode.

The op code usually occupies the first byte, and only the first byte, of an instruction, but there are a few instructions in which a register designation is in the first byte and a few other instructions in which 3 bits of the op code are in the second byte. Within most of the op codes there are special 1-bit indicators. They are:

W-bit
If an instruction can operate on either a byte or a word, the op code includes a W-bit which indicates whether a byte (W = 0) or a word (W = 1) is being accessed.
D-bit
For double-operand instructions (except for instructions with one operand being immediate and string instructions, which are discussed in Chap. 5). One of the operands must be a register specified by a REG field. For these instructions the D-bit is used to indicate whether the register specified by REG is the source operand (D = 0) or the destination operand (D = 1).
S-bit
A 8-bit 2's complement number can be extended to a 16-bit 2's complement number by letting all of the bits in the high-order byte equal the MSB in the low-order byte. This is referred to as sign extension. The S-bit appears with the W-bit in the immediate to register/memory add, subtract, and compare instructions and is assigned as follows: For small numbers, the latter case would permit the use of a 1-byte immediate operand.
V-bit
Used by shift and rotate instructions to determine the number of shifts (see Chap. 3).
Z-bit
Used by the REP instruction (which is discussed in Chap. 5).

A register designation is 2 bits long if it is for a segment register and 3 bits long if it is for any other type of register.

Figure 2-13 Examples of 8086 instruction formats.
One byte instruction - implied operand(s)
One byte instruction - register modeREG - Register
MOD - Mode
R/M - Register or memory
DISP - Displacement
DATA - Immediate data
Register to register
Register to/from memory with no displacement
Register to/from memory with displacement
(If 16-bit displacement is used)
Immediate operand to register
(If 16-bit data are used)
Immediate operand to memory with 16-bit displacement
(If 16-bit data are used)


Table of Contents | Next page | Previous page

This is page 17.