[Overview][Procedures and functions][Index] | Reference for unit 'emu387' (#rtl)

# npxsetup

Set up coprocessor emulation.

## Declaration

Source position: emu387.pp line 18

`procedure npxsetup(`
`prog_name: string`
`);`

## Description

npxsetup checks whether a coprocessor is found. If not, it loads the file wmemu387.dxe into memory and initializes the code in it.

If the environment variable 387 is set to N, then the emulation will be loaded, even if there is a coprocessor present. If the variable doesn't exist, or is set to any other value, the unit will try to detect the presence of a coprocessor unit.

The function searches the file wmemu387.dxe in the following way:

1. If the environment variable EMU387 is set, then it is assumed to point at the wmemu387.dxe file.
2. if the environment variable EMU387 does not exist, then the function will take the path part of prog_name and look in that directory for the file wmemu387.dxe.

It should never be necessary to call this function, because the initialization code of the unit contains a call to the function with as an argument paramstr(0). This means that you should deliver the file wmemu387.dxe together with your program.

## Errors

If there is an error, an error message is printed to standard error, and the program is halted, since any floating-point code is bound to fail anyhow.

Documentation generated on: Feb 26 2014