home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / nec98.zip / FPEINT.C < prev    next >
C/C++ Source or Header  |  1993-09-02  |  4KB  |  112 lines

  1. /*
  2.  *%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  3.  *%  Copyright (C) 1992, by WATCOM International Corp. All rights   %
  4.  *%  reserved. No part of this software may be reproduced in any    %
  5.  *%  form or by any means - graphic, electronic or mechanical,        %
  6.  *%  including photocopying, recording, taping or information        %
  7.  *%  storage and retrieval systems - except with the written        %
  8.  *%  permission of WATCOM International Corp.                %
  9.  *%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  10.  
  11.   Modified:    By:        Reason:
  12.   ---------    ---        -------
  13.   92/12/04    J.B.Schueler    changed __NEC__ to __NEC98__ to avoid confusion
  14.                 with NEC AT compatibles
  15.  */
  16. /*
  17.  * This file can be used to customize numeric coprocessor interrupt
  18.  * handling in the math libraries (MATH387R.LIB, MATH387S.LIB) for
  19.  * NEC PC9800 series, Fujitsu, or IBM AT compatible PCs.
  20.  *
  21.  * Compile FPEINT.C as follows:
  22.  *    To replace FPEINT in MATH387R.LIB
  23.  *         wcc386p/r/ez fpeint /ox/w3/zq/zc/zl/d__NEC__/ms/3r/7
  24.  *         wlib math387r -+fpeint
  25.  *    To replace FPEINT in MATH387S.LIB
  26.  *         wcc386p/r/ez fpeint /ox/w3/zq/zc/zl/d__NEC__/ms/3s/7
  27.  *         wlib math387s -+fpeint
  28.  */
  29.  
  30. /*
  31.  * -------------------------------------------------------------------
  32.  *
  33.  * For the IBM PC, we use IRQ13 (math coprocessor exception)
  34.  * Level     Function
  35.  * -----     --------
  36.  * NMI         Parity, Watchdog Timer,
  37.  *         Arbitration time-out,
  38.  *         Channel Check
  39.  * IRQ 0     Timer
  40.  * IRQ 1     Keyboard
  41.  * IRQ 2     Cascaded Interrupt Control -- IRQ    8 Real Time Clock
  42.  *                       IRQ    9 Redirect Cascade
  43.  *                       IRQ 10 Reserved
  44.  *                       IRQ 11 Reserved
  45.  *                       IRQ 12 Mouse
  46.  *                       IRQ 13 Math Coprocessor Exception
  47.  *                       IRQ 14 Fixed Disk
  48.  *                       IRQ 15 Reserved
  49.  * IRQ 3     Serial Alternate
  50.  * IRQ 4     Serial Primary
  51.  * IRQ 5     Reserved
  52.  * IRQ 6     Diskette
  53.  * IRQ 7     Parallel Port
  54.  * IRQ 8 through 15 are cascaded through IRQ 2
  55.  *
  56.  * IRQ 0 through  7 map to INT 0x08 through INT 0x0F
  57.  * IRQ 8 through 15 map to INT 0x70 through INT 0x77
  58.  *
  59.  * -------------------------------------------------------------------
  60.  *
  61.  * For the NEC PC98 (286, 386), we use IRQ 8 (math coprocessor exception)
  62.  * Level     Function                     Vector Number
  63.  * -----     --------
  64.  * IRQ    0     Timer                     08
  65.  * IRQ    1     Keyboard                     09
  66.  * IRQ    2     CTRV                     0A
  67.  * IRQ    3     Expansion bus INT0             0B
  68.  * IRQ    4     Serial Primary (RS-232C ch0)         0C
  69.  * IRQ    5     Expansion bus INT1             0D
  70.  * IRQ    6     Expansion bus INT2             0E
  71.  * IRQ    7     Slave                     0F
  72.  * IRQ    8     Math coprocessor (286, 386, ...)         10
  73.  * IRQ    9     Expansion bus INT3 (HD, HDLC)         11
  74.  * IRQ 10     Expansion bus INT41 (640KB FD)         12
  75.  * IRQ 11     Expansion bus INT42 (1MB FD)         13
  76.  * IRQ 12     Expansion bus INT5 (RS-232C ch1, ch2)  14
  77.  * IRQ 13     Expansion bus INT6 (mouse)         15
  78.  * IRQ 14     Reserved (math coprocessor in 70116)   16
  79.  * IRQ 15     Reserved                     17
  80.  *
  81.  * IRQ 0 through  7 map to INT 0x08 through INT 0x0F
  82.  * IRQ 8 through 15 map to INT 0x10 through INT 0x17
  83.  */
  84.  
  85. /*
  86.  * If IRQ_NUM is less than 8, we have a problem in the code (contact WATCOM)
  87.  */
  88.  
  89. #if defined(__NEC98__)
  90.   #define FPE_INT 0x10        /* INT 0x10 */
  91.   #define IRQ_NUM 0x08        /* IRQ 8 */
  92.   #define IRQ_INT 0x10        /* IRQ 8 vectored thru INT 0x10 */
  93.   #define MST_PIC 0x00        /* Master PIC port number */
  94.   #define SLV_PIC 0x08        /* Slave PIC port number */
  95. #else    /* __IBMPC__ */
  96.   #define FPE_INT 0x02        /* INT 0x02 */
  97.   #define IRQ_NUM 0x0D        /* IRQ 13 */
  98.   #define IRQ_INT 0x75        /* IRQ 13 vectored thru INT 0x75 */
  99.   #define MST_PIC 0x20        /* Master PIC port number */
  100.   #define SLV_PIC 0xA0        /* Slave PIC port number */
  101. #endif
  102.  
  103.  
  104. extern char __FPE_int = { FPE_INT };    /* Used for Rational Systems and Intel */
  105. #if defined(__386__)
  106. extern char __IRQ_num = { IRQ_NUM };    /* Used for PharLap DOS Extender */
  107. extern char __IRQ_int = { IRQ_INT };    /* Used for Ergo DOS Extender */
  108. extern char __MST_pic = { MST_PIC };    /* Master PIC port number */
  109. extern char __SLV_pic = { SLV_PIC };    /* Slave PIC port number */
  110. #endif
  111.  
  112.