aboutsummaryrefslogtreecommitdiff
path: root/sys/osb/miipakr.x
blob: e6d0a5beb5a86aaab6f698af979a1a2b1b353b44 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.

include	<mach.h>

# MIIPAKR -- Pack an SPP array of the indicated datatype into an 32 bit
# IEEE floating format.

procedure miipakr (spp, mii, nelems, spp_datatype)

int	spp[ARB]		#I input array of SPP integers
real	mii[ARB]		#O output MII format array
int	nelems			#I number of integers to be converted
int	spp_datatype		#I SPP datatype code

begin
	if (spp_datatype == TY_REAL)
	    call ieevpakr (spp, mii, nelems)
	else {
	    switch (spp_datatype) {
	    case TY_UBYTE:
		call achtbr (spp, mii, nelems)
	    case TY_USHORT:
		call achtur (spp, mii, nelems)
	    case TY_CHAR:
		call achtcr (spp, mii, nelems)
	    case TY_SHORT:
		call achtsr (spp, mii, nelems)
	    case TY_INT, TY_POINTER, TY_STRUCT:
		call achtir (spp, mii, nelems)
	    case TY_LONG:
		call achtlr (spp, mii, nelems)
	    case TY_DOUBLE:
		call achtdr (spp, mii, nelems)
	    case TY_COMPLEX:
		call achtxr (spp, mii, nelems)
	    default:
		call amovr (spp, mii, nelems)
	    }

	    call ieevpakr (mii, mii, nelems)
	}
end