13.07.2015 Views

iAPX 286 Operating System Writers Guide 1983

iAPX 286 Operating System Writers Guide 1983

iAPX 286 Operating System Writers Guide 1983

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

NUMERICS PROCESSOR EXTENSIONMath Present Flag (MP)The MP bit of the 80<strong>286</strong> machine status word (MSW) indicates to the CPU whether an 80287 NPXis actually attached. The MP flag controls the function of the WAIT instruction. If, when executing aWAIT instruction, the CPU finds MP set, then it tests TS; it does not otherwise test TS during aWAIT instruction. If it finds TS set under these conditions, the CPU causes trap 7.Note that MP must never be set concurrently with EM.Task Switched Flag (TS)The TS bit of the MSW helps to determine when the context of the 80287 NPX does not match thatof the 80<strong>286</strong> CPU. The CPU sets TS each time it performs a task switch (whether triggered by softwareor by hardware interrupt). If, when interpreting one of the ESC instructions, the CPU finds TS alreadyset, it causes trap 7. The MP flag also relates to TS.The CL TS instruction (legal only at PL 0) resets TS.WAIT InstructionThe WAIT instruction is not an ESC instruction, but WAIT causes the CPU to perform some of thesame tests that it performs upon encountering an ESC instruction:• The CPU waits until the NPX no longer asserts the BUSY pin. You can therefore use WAIT tosynchronize the CPU with the NPX.• The CPU tests the ERROR pin (if EM is not set). You can therefore use WAIT to cause trap 16if an error is pending from a previous ESC instruction. (The CPU makes this test only after BUSYgoes inactive.) Note that, if no 80287 is present, the ERROR pin should be tied inactive to preventWAIT from causing spurious traps.SummaryTable 12-1 summarizes functions of the ESC and WAIT instructions that depend on setting of the MPand EM flags.INITIALIZATIONDuring its initialization phase the operating system must• Set flags in the MSW to reflect the numerics processing environment• Reset the 80287 (if present)• Switch the 80287 into protected modeYou can use a configuration parameter to communicate the numerics proccssing environment to theoperating system. The FNINIT instruction (INIT$REAUMATH$UNIT in PL/M-<strong>286</strong>) resets the80287, and the FSETPM instruction places the 80287 into protected mode.12-2 121960-001

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!