source: trunk/minix/lib/ack/libm2/EM.e@ 12

Last change on this file since 12 was 9, checked in by Mattia Monga, 14 years ago

Minix 3.1.2a

File size: 1.8 KB
Line 
1#
2;
3; (c) copyright 1988 by the Vrije Universiteit, Amsterdam, The Netherlands.
4; See the copyright notice in the ACK home directory, in the file "Copyright".
5;
6;
7; Module: Interface to some EM instructions and data
8; Author: Ceriel J.H. Jacobs
9; Version: $Header: /cvsup/minix/src/lib/ack/libm2/EM.e,v 1.1 2005/10/10 15:27:46 beng Exp $
10;
11 mes 2,_EM_WSIZE,_EM_PSIZE
12
13#define ARG1 0
14#define ARG2 _EM_DSIZE
15#define IRES 2*_EM_DSIZE
16
17; FIF is called with three parameters:
18; - address of integer part result (IRES)
19; - float two (ARG2)
20; - float one (ARG1)
21; and returns an _EM_DSIZE-byte floating point number
22; Definition:
23; PROCEDURE FIF(ARG1, ARG2: LONGREAL; VAR IRES: LONGREAL) : LONGREAL;
24
25 exp $FIF
26 pro $FIF,0
27 lal 0
28 loi 2*_EM_DSIZE
29 fif _EM_DSIZE
30 lal IRES
31 loi _EM_PSIZE
32 sti _EM_DSIZE
33 ret _EM_DSIZE
34 end ?
35
36#define FARG 0
37#define ERES _EM_DSIZE
38
39; FEF is called with two parameters:
40; - address of base 2 exponent result (ERES)
41; - floating point number to be split (FARG)
42; and returns an _EM_DSIZE-byte floating point number (the mantissa)
43; Definition:
44; PROCEDURE FEF(FARG: LONGREAL; VAR ERES: integer): LONGREAL;
45
46 exp $FEF
47 pro $FEF,0
48 lal FARG
49 loi _EM_DSIZE
50 fef _EM_DSIZE
51 lal ERES
52 loi _EM_PSIZE
53 sti _EM_WSIZE
54 ret _EM_DSIZE
55 end ?
56
57#define TRAP 0
58
59; TRP is called with one parameter:
60; - trap number (TRAP)
61; Definition:
62; PROCEDURE TRP(trapno: INTEGER);
63
64 exp $TRP
65 pro $TRP, 0
66 lol TRAP
67 trp
68 ret 0
69 end ?
70
71#define PROC 0
72
73; SIG is called with one parameter:
74; - procedure instance identifier (PROC)
75; and returns the old traphandler.
76
77 exa handler
78 exp $SIG
79 pro $SIG, 0
80 lae handler
81 loi _EM_PSIZE
82 lal PROC
83 loi _EM_PSIZE
84 lae handler
85 sti _EM_PSIZE
86 ret _EM_PSIZE
87 end ?
88
89 exp $LINO
90 pro $LINO,0
91 loe 0
92 ret _EM_WSIZE
93 end ?
94
95 exp $FILN
96 pro $FILN,0
97 lae 4
98 loi _EM_PSIZE
99 ret _EM_PSIZE
100 end ?
Note: See TracBrowser for help on using the repository browser.