home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
nec98.zip
/
FPEINT.C
< prev
next >
Wrap
C/C++ Source or Header
|
1993-09-02
|
4KB
|
112 lines
/*
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
*% Copyright (C) 1992, by WATCOM International Corp. All rights %
*% reserved. No part of this software may be reproduced in any %
*% form or by any means - graphic, electronic or mechanical, %
*% including photocopying, recording, taping or information %
*% storage and retrieval systems - except with the written %
*% permission of WATCOM International Corp. %
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Modified: By: Reason:
--------- --- -------
92/12/04 J.B.Schueler changed __NEC__ to __NEC98__ to avoid confusion
with NEC AT compatibles
*/
/*
* This file can be used to customize numeric coprocessor interrupt
* handling in the math libraries (MATH387R.LIB, MATH387S.LIB) for
* NEC PC9800 series, Fujitsu, or IBM AT compatible PCs.
*
* Compile FPEINT.C as follows:
* To replace FPEINT in MATH387R.LIB
* wcc386p/r/ez fpeint /ox/w3/zq/zc/zl/d__NEC__/ms/3r/7
* wlib math387r -+fpeint
* To replace FPEINT in MATH387S.LIB
* wcc386p/r/ez fpeint /ox/w3/zq/zc/zl/d__NEC__/ms/3s/7
* wlib math387s -+fpeint
*/
/*
* -------------------------------------------------------------------
*
* For the IBM PC, we use IRQ13 (math coprocessor exception)
* Level Function
* ----- --------
* NMI Parity, Watchdog Timer,
* Arbitration time-out,
* Channel Check
* IRQ 0 Timer
* IRQ 1 Keyboard
* IRQ 2 Cascaded Interrupt Control -- IRQ 8 Real Time Clock
* IRQ 9 Redirect Cascade
* IRQ 10 Reserved
* IRQ 11 Reserved
* IRQ 12 Mouse
* IRQ 13 Math Coprocessor Exception
* IRQ 14 Fixed Disk
* IRQ 15 Reserved
* IRQ 3 Serial Alternate
* IRQ 4 Serial Primary
* IRQ 5 Reserved
* IRQ 6 Diskette
* IRQ 7 Parallel Port
* IRQ 8 through 15 are cascaded through IRQ 2
*
* IRQ 0 through 7 map to INT 0x08 through INT 0x0F
* IRQ 8 through 15 map to INT 0x70 through INT 0x77
*
* -------------------------------------------------------------------
*
* For the NEC PC98 (286, 386), we use IRQ 8 (math coprocessor exception)
* Level Function Vector Number
* ----- --------
* IRQ 0 Timer 08
* IRQ 1 Keyboard 09
* IRQ 2 CTRV 0A
* IRQ 3 Expansion bus INT0 0B
* IRQ 4 Serial Primary (RS-232C ch0) 0C
* IRQ 5 Expansion bus INT1 0D
* IRQ 6 Expansion bus INT2 0E
* IRQ 7 Slave 0F
* IRQ 8 Math coprocessor (286, 386, ...) 10
* IRQ 9 Expansion bus INT3 (HD, HDLC) 11
* IRQ 10 Expansion bus INT41 (640KB FD) 12
* IRQ 11 Expansion bus INT42 (1MB FD) 13
* IRQ 12 Expansion bus INT5 (RS-232C ch1, ch2) 14
* IRQ 13 Expansion bus INT6 (mouse) 15
* IRQ 14 Reserved (math coprocessor in 70116) 16
* IRQ 15 Reserved 17
*
* IRQ 0 through 7 map to INT 0x08 through INT 0x0F
* IRQ 8 through 15 map to INT 0x10 through INT 0x17
*/
/*
* If IRQ_NUM is less than 8, we have a problem in the code (contact WATCOM)
*/
#if defined(__NEC98__)
#define FPE_INT 0x10 /* INT 0x10 */
#define IRQ_NUM 0x08 /* IRQ 8 */
#define IRQ_INT 0x10 /* IRQ 8 vectored thru INT 0x10 */
#define MST_PIC 0x00 /* Master PIC port number */
#define SLV_PIC 0x08 /* Slave PIC port number */
#else /* __IBMPC__ */
#define FPE_INT 0x02 /* INT 0x02 */
#define IRQ_NUM 0x0D /* IRQ 13 */
#define IRQ_INT 0x75 /* IRQ 13 vectored thru INT 0x75 */
#define MST_PIC 0x20 /* Master PIC port number */
#define SLV_PIC 0xA0 /* Slave PIC port number */
#endif
extern char __FPE_int = { FPE_INT }; /* Used for Rational Systems and Intel */
#if defined(__386__)
extern char __IRQ_num = { IRQ_NUM }; /* Used for PharLap DOS Extender */
extern char __IRQ_int = { IRQ_INT }; /* Used for Ergo DOS Extender */
extern char __MST_pic = { MST_PIC }; /* Master PIC port number */
extern char __SLV_pic = { SLV_PIC }; /* Slave PIC port number */
#endif