Data Transfer Instructions; Flag Storage Formats - Intel iAPX 86/88 User Manual

Table of Contents

Advertisement

8086/8088 CPU
8086/8088 INSTRUCTION SET
The
8086/8088
instructions treat different types of oper-
ands uniformly. Nearly every instruction can operate on
either byte or word data. Register, memory and immedi-
ate operands may be specified interchangeably in most
instructions. The exception to this is that immediate val-
ues serve as "source" and not "destination" operands. In
particular, memory variables may be added to, subtracted
from, shifted, compared, and so on, in place, without
moving them in and out of registers. This saves instruc-
tions, registers, and execution time in assembly language
programs. In high-level languages, where most variables
are memory based, compilers can produce faster and
shorter object programs.
The
8086/8088
instruction set can be viewed as existing
on two levels. One is the assembly level and the other is
the machine level. To the assembly language program-
mer, the 8086/8088 appear to have a repertoire of about
100 instructions. One MOV (move) instruction, for exam-
ple, transfers a byte or a word from a register or a mem-
ory location or an immediate value to either a register or a
memory location. The
8086/8088
CPU's, however, rec-
ognize 28 different MOV machine instructions ("move
byte register to memory," move word immediate to regis-
ter," etc.).
The two levels of instruction set address two different re-
quirements: efficiency and simplicity. The approximately
300 forms of machine-level instructions make very effi-
cient use of storage. For example, the machine instruc-
tions that increments a memory operand is three or four
bytes long because the address of the operand must be
encoded in the instruction. To increment a register, how-
ever, does not require as much information, so the in-
struction can be shorter. The 8086/88 have eight different
machine-level instructions that increment a different
16-bit register. Each of these instructions are only one
byte long.
The assembly level instructions simplify the programmers
view of the instruction set. The programmer writes one
form of an INC (increment) instruction and the ASM-86
assembler examines the operand to determine which ma-
chine level instruction to generate. The following para-
graphs provide a functional description of the
assembly-level instructions.
Data Transfer Instructions
The 8086/8088 instruction set contains 14 data transfer
instructions. These instructions move single bytes and
words between memory and registers, and also move sin-
gle bytes and words between the AL or AX registers and
110
ports. Table 1-3 lists the four types of data transfer
instructions and their functions.
1-13
Table 1-3 Data Transfer Instructions
GENERAL PURPOSE
MOV
Move byte or word
PUSH
Push word onto stack
POP
Pop word off stack
XCHG
Exchange byte or word
XLAT
Translate byte
INPUT /OUTPUT
IN
Input byte or word
OUT
Output byte or word
ADDRESS OBJECT
LEA
Load effective address
LDS
Load pointer using DS
LES
Load pointer using ES
FLAG TRANSFER
LAHF
Load AH register from flags
SAHF
Store AH register in flags
PUSHF
Push flags onto stack
POPF
Pop flags off stack
Data transfer instructions are categorized into four types:
1) general purpose; 2) input/output; 3) address object;
and 4) flag transfer. The stack manipulation instructions,
which are used for transferring flag contents, and the in-
structions for loading segment registers are also included
in this group. Figure 1-16 shows the flag storage formats.
These formats are used primarily by the LAHF instruction
~:~~'
I s !
Z
!
U
!
A
!
U
!
P
!
U
!
C
I
1 7 6 5 4 3 2 1 0 1
1_8080/8085 FLAGS_I
1
1
I
I
~g~~F,
I
u ,
U
I
U , U
,0,0
I
I , T , S
I
Z
I
U
I
A
I
U ,
P,
U
,c
I
15 14 13 12 11 10 9
8
7
6
5
4
3
2
1
0
U
=
UNDEFINED; VALUE IS INDETERMINATE
D
=
OVERFLOW FLAG
D
=
DIRECTION FLAG
I
=
INTERRUPT ENABLE FLAG
T
=
TRAP FLAG
S
=
SIGN FLAG
Z
=
ZERO FLAG
A
=
AUXILIARY CARRY FLAG
P
=
PARITY FLAG
C
=
CARRY FLAG
Figure 1-16 Flag Storage Formats
210912-001

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Iapx 186/188

Table of Contents