Apndxd
Apndxd
Apndxd
This section provides encodings and approximate cycle times for all instructions that you would nor-
mally execute in real mode on an Intel processor. Missing are the special instructions on the 80286 and
later processors that manipulate page tables, segment descriptors, and other instructions that only an oper-
ating system should use. The cycle times are approximate. To determine exact execution times, you will
need to run an experiment. The cycle times are given for comparison purposes only.
Key to special bits in encodings:
x: Don’t care. Can be zero or one.
s: Sign extension bit for immediate operands. If zero, immediate operand is 16 or 32 bits depend-
ing on destination operand size. If s bit is one, then the immediate operand is eight bits and the
CPU sign extends to 16 or 32 bits, as appropriate.
rrr: Same as reg field in [mod-reg-r/m] byte.
Other Notes:
[disp] This field can be zero, one, two, or four bytes long as required by the instruction.
[imm] This field is one byte long if the operand is an eight bit operand or if the s bit in the instruction
opcode is one. It is two or four bytes long if the s bit contains zero and the destination operand
is 16 or 32 bits, respectively.
[mod-reg-r/m]: Instructions that have a mod-reg-r/m byte may have a scaled index byte (sib) and a zero, one,
two, or four byte displacement. See Appendix E for details concerning the encoding of this por-
tion of the instruction.
reg,reg Many instructions allow two operands using a [mod-reg-r/m] byte. A single direction bit in the
opcode determines whether the instruction treats the reg operand as the destination or the mod-
r/m operand as the destination (e.g., mov reg,mem vs. mov mem,reg). Such instructions also
allow two register operands. It turns out there are two encodings for each such reg-reg instruc-
tion. That is, you can encode an instruction like mov ax, bx with ax encoded in the reg field and
bx encoded in the mod-r/m field, or you can encode it with bx encoded in the reg field and ax
encoded in the mod-r/m field. Such instructions always have an x bit in the opcode. If the x bit
is zero, the destination is the register specified by the mod-r/m field. If the x bit is one, the desti-
nation is the register specified by the reg field. Other types of instructions support multiple
encodings for similar reasons.
Page 1361
Page 1362
Appendices
Page 1363
Appendix D
Page 1364
Appendices
Page 1365
Appendix D
Page 1366
Appendices
Page 1367
Appendix D
Page 1368
Appendices
Page 1369
Appendix D
Page 1370
Appendices
Page 1371
Appendix D
Page 1372
Appendices
Page 1373
Appendix D
Page 1374
Appendices
Page 1375
Appendix D
Page 1376
Appendices
Page 1377
Appendix D
Page 1378
Appendices
Page 1379
Appendix D
Page 1380
Appendices
Page 1381
Appendix D
Page 1382
Appendices
Page 1383
Appendix D
Page 1384
Appendices
Page 1385
Appendix D
Page 1386
Appendices
Page 1387
Appendix D
Page 1388
Appendices
Page 1389
Appendix D
Page 1390
Appendices
Page 1391
Appendix D
Page 1392
Appendices
Page 1393
Appendix D
Page 1394
Appendices
Page 1395
Appendix D
Page 1396
Appendices
Page 1397
Appendix D
Page 1398
Appendices
Page 1399
Appendix D
Page 1400
Appendices
Page 1401
Appendix D
e. On the 80386 and most versions of later processors, the processor ignores the reg field’s value for the Scc
instruction; the reg field, however, should contain zero.
f. Most assemblers accept “xchg reg,mem” and encode it as “xchg mem,reg” which does the same thing.
Page 1402