PROGRAMMING NUMERIC APPLICATIONS

FLDLG2

FLDLG2 (load log base 10 of 2) loads (pushes) the value LOG lO 2 onto the stack.

FLDLN2

FLDLN2 (load log base e of 2) loads (pushes) the value LOGe 2 onto the stack.

Processor Control Instructions

The processor control instructions shown in table 2-11 are not typically used in calculations; they provide control over the 80287 NPX for system-level activities. These activities include initialization, exception handling, and task switching.

As shown in table 2-11, many of the NPX processor control instructions have two forms of assembler mnemonic:

A wait form, where the mnemonic is prefixed only with an F, such as FSTSW. This form checks for unmasked numeric errors.

A no-waitform, where the mnemonic is prefixed with an FN, such as FNSTSW. This form ignores unmasked numeric errors.

When the control instruction is coded using the no-waitform of the mnemonic, the ASM286 assembler does not precede the ESC instruction with a wait instruction, and the CPU does not test the ERROR status line from the NPX before executing the processor control instruction.

Only the processor control class of instructions have this alternate no-wait form. All numeric instruc- tions are automatically synchronized by the 80286, with the CPU testing the BUSY status line and only executing the numeric instruction when this line is inactive. Because of this automatic synchroni- zation by the 80286, numeric instructions for the 80287 need not be preceded by a CPU wait instruc- tion in order to execute correctly.

Table 2-11. Processor Control Instructions

FINITjFNINIT

Initialize processor

FSETPM

Set Protected Mode

FLDCW

Load control word

FSTCWjFNSTCW

Store control word

FSTSWjFNSTSW

Store status word

FSTSW AXjFNSTSW AX

Store status word to AX

FCLEXjFNCLEX

Clear exceptions

FSTENVjFNSTENV

Store Environment

FLDENV

Load environment

FSAVEjFNSAVE

Save state

FRSTOR

Restore state

FINCSTP

Increment stack pointer

FDECSTP

Decrement stack pointer

FFREE

Free register

FNOP

No operation

FWAIT

CPU Wait

2-15

Page 407
Image 407
Intel 80286, 80287 manual Processor Control Instructions