1: /*
2: char id_traper[] = "@(#)traper_.c 1.1";
3: * Arrange to trap integer overflow & floating underflow.
4: * Full of Magic! DON'T CHANGE ANYTHING !!
5: *
6: * To use from f77:
7: * integer oldmsk, traper
8: * oldmsk = traper (mask)
9: * where:
10: * mask = 1 to trap integer overflow
11: * mask = 2 to trap floating underflow
12: * mask = 3 to trap both
13: * These 2 bits will be set into the PSW.
14: * The old state will be returned.
15: */
16:
17: long traper_(msk)
18: long *msk;
19: {
20: int old = 0;
21: #if vax
22: #define IOV_MASK 0140
23: int **s = &msk;
24: int psw;
25:
26: s -= 5;
27: psw = (int)*s;
28: old = (psw & IOV_MASK) >> 5;
29: psw = (psw & ~IOV_MASK) | ((*msk << 5) & IOV_MASK);
30: *s = (int *)psw;
31: #endif vax
32: return((long)old);
33: }
Defined functions
Defined macros