Saturday, March 6, 2010

8086 Instruction set

80x86 instructions can be (roughly) divided into eight different classes:
1) Data movement instructions
• mov, lea, les , push, pop, pushf, popf
2) Conversions
• cbw, cwd, xlat
3) Arithmetic instructions
• add, inc sub, dec, cmp, neg, mul, imul, div, idiv
4) Logical, shift, rotate, and bit instructions
• and, or, xor, not, shl, shr, rcl, rcr
5) I/O instructions
• in, out
6) String instructions
• movs, stos, lods
7) Program flow control instructions
• jmp, call, ret, conditional jumps
8) Miscellaneous instructions.
• clc, stc, cmc
The following sections describe all the instructions in these groups and how they operate.
At one time a text such as this one would recommend against using the extended
80386 instruction set. After all, programs that use such instructions will not run properly
on 80286 and earlier processors. Using these additional instructions could limit the number
of machines your code would run on. However, the 80386 processor is on the verge of
disappearing as this text is being written. You can safely assume that most systems will
contain an 80386sx or later processor. This text often uses the 80386 instruction set in various
example programs. Keep in mind, though, that this is only for convenience. There is
no program that appears in this text that could not be recoded using only 8088 assembly
language instructions.
A word of advice, particularly to those who learn only the instructions noted above:
as you read about the 80x86 instruction set you will discover that the individual 80x86
instructions are not very complex and have simple semantics. However, as you approach

One quick note: this chapter lists many instructions as “available only on the 80286
and later processors.” In fact, many of these instructions were available on the 80186
microprocessor as well. Since few PC systems employ the 80186 microprocessor, this text
ignores that CPU. However, to keep the record straight...

No comments:

Post a Comment