80386

Register Specified by reg Field

During 32-Bit Data Operations

reg

Function of w Field

(whenw = 0)

(whenw = 1)

 

000

AL

EAX

001

CL

ECX

010

DL

EDX

011

BL

EBX

100

AH

ESP

101

CH

EBP

110

DH

ESI

111

BH

EDI

8.2.3.3ENCODING OF THE SEGMENT REGISTER (sreg) FIELD

The sreg field in certain instructions is a 2-bit field allowing one of the four 80286 segment registers to be specified. The sreg field in other instructions is a 3-bit field, allowing the 80386 FS and GS segment registers to be specified.

2-Bit sreg2 Field

2-Bit

Segment

Register

sreg2 Field

Selected

 

00

ES

01

CS

10

SS

11

DS

3-Bit sreg3 Field

3-Bit

Segment

Register

sreg3 Field

Selected

 

000

ES

001

CS

010

SS

011

DS

100

FS

101

GS

110

do not use

111

do not use

8.2.3.4 ENCODING OF ADDRESS MODE

Except for special instructions, such as PUSH or POP, where the addressing mode is pre-determined, the addressing mode for the current instruction is specified by addressing bytes following the primary opcode. The primary addressing byte is the "mod rim" byte, and a second byte of addressing informa- tion, the "s-i-b" (scale-index-base) byte, can be specified.

The s-i-b byte (scale-index-base byte) is specified when using 32-bit addressing mode and the "mod rim" byte has rim = 100 and mod = 00,01 or 10. When the sib byte is present, the 32-bit addressing mode is a function of the mod, ss, index, and base fields.

The primary addressing byte, the "mod rim" byte, also contains three bits (shown as TTT in Figure 8-1) sometimes used as an extension of the primary op- code. The three bits, however, may also be used as a register field (reg).

When calculating an effective address, either 16-bit addressing or 32-bit addressing is used. 16-bit ad· dressing uses 16-bit address components to calcu- late the effective address while 32-bit addressing uses 32-bit address components to calculate the ef- fective address. When 16-bit addressing is used, the "mod rim" byte is interpreted as a 16-bit addressing mode specifier. When 32-bit addressing is used, the "mod rim" byte is interpreted as a 32·bitaddressing mode specifier.

Tables on the following three pages define all en- codings of all 16-bit addressing modes and 32-bit addressing modes.

127

Page 188
Image 188
Intel 80386 manual Encoding of Address Mode