
2-86
PRELIMINARY
Floating Point Unit Operations
Advanci ng the S tandar ds
Floating Point Unit Operations
2-86
2.18.4 Entering and Leaving
V86 Mode
V86 mode is entered from protected mode by
either executing an IRET instruction at CPL = 0
or by task switching. If an IRET is used, the
stack must contain an EFLAGS image with
VM = 1. If a task switch is used, the TSS must
contain an EFLAGS image containing a 1 in
the VM bit position. The POPF instruction
cannot be used to enter V86 mode since the
state of the VM bit is not affected. V86 mode
can only be exited as the result of an interrupt
or exception. The transition out must use a
32-bit trap or interrupt gate which must point
to a non-conforming privilege level 0 segment
(DPL = 0), or a 32-bit TSS. These restrictions
are required to permit the trap handler to IRET
back to the V86 program.
2.19
Floating Point Unit
Operations
The M II CPU includes an on-chip FPU that
provides the user access to a complete set of
floating point instructions (see Chapter 6).
Information is passed to and from the FPU
using eight data registers accessed in a
stack-like manner, a control register, and a
status register. The M II CPU also provides a
data register tag word which improves context
switching and performance by maintaining
empty/non-empty status for each of the eight
data registers. In addition, registers in the
CPU contain pointers to (a) the memory
location containing the current instruction
word and (b) the memory location containing
the operand associated with the current
instruction word (if any).
FPU Tag Word Register. The M II CPU main-
tains a tag word register (Figure 2-40 (Page
2-87)) comprised of two bits for each physical
data register. Tag Word fields assume one of
four values depending on the contents of their
associated data registers, Valid (00), Zero (01),
Special (10), and Empty (11). Note: Denor-
mal, Infinity, QNaN, SNaN and unsupported
formats are tagged as “Special”. Tag values are
maintained transparently by the M II CPU and
are only available to the programmer indirectly
through the FSTENV and FSAVE instructions.
FPU Control and Status Registers. The
FPU circuitry communicates information
about its status and the results of operations
to the programmer via the status register. The
FPU status register is comprised of bit fields
that reflect exception status, operation execu-
tion status, register status, operand class, and
comparison results. The FPU status register
bit definitions are shown in Figure 2-41
(Page 2-87) and Table 2-41 (Page 2-87).
The FPU Mode Control Register (MCR) is used
by the CPU to specify the operating mode of
the FPU. The MCR contains bit fields which
specify the rounding mode to be used, the pre-
cision by which to calculate results, and the
exception conditions which should be report-
ed to the CPU via traps. The user controls pre-
cision, rounding, and exception reporting by
setting or clearing appropriate bits in the
MCR. The FPU mode control register bit def-
initions are shown in Figure 2-42 (Page 2-88)
and Table 2-42 (Page 2-88).