aboutsummaryrefslogtreecommitdiff
path: root/sys/osb/nmipakd.x
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2015-07-08 20:46:52 -0400
committerJoseph Hunkeler <jhunkeler@gmail.com>2015-07-08 20:46:52 -0400
commitfa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 (patch)
treebdda434976bc09c864f2e4fa6f16ba1952b1e555 /sys/osb/nmipakd.x
downloadiraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz
Initial commit
Diffstat (limited to 'sys/osb/nmipakd.x')
-rw-r--r--sys/osb/nmipakd.x42
1 files changed, 42 insertions, 0 deletions
diff --git a/sys/osb/nmipakd.x b/sys/osb/nmipakd.x
new file mode 100644
index 00000000..b1cb8ad3
--- /dev/null
+++ b/sys/osb/nmipakd.x
@@ -0,0 +1,42 @@
+# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.
+
+include <mach.h>
+
+# NMIPAKD -- Pack an SPP array of the indicated datatype into an 64 bit
+# IEEE floating format.
+
+procedure nmipakd (spp, nmi, nelems, spp_datatype)
+
+int spp[ARB] #I input array of SPP integers
+double nmi[ARB] #O output NMI format array
+int nelems #I number of integers to be converted
+int spp_datatype #I SPP datatype code
+
+begin
+ if (spp_datatype == TY_DOUBLE)
+ call ieevpakd (spp, nmi, nelems)
+ else {
+ switch (spp_datatype) {
+ case TY_UBYTE:
+ call achtbd (spp, nmi, nelems)
+ case TY_USHORT:
+ call achtud (spp, nmi, nelems)
+ case TY_CHAR:
+ call achtcd (spp, nmi, nelems)
+ case TY_SHORT:
+ call achtsd (spp, nmi, nelems)
+ case TY_INT, TY_POINTER, TY_STRUCT:
+ call achtid (spp, nmi, nelems)
+ case TY_LONG:
+ call achtld (spp, nmi, nelems)
+ case TY_REAL:
+ call achtrd (spp, nmi, nelems)
+ case TY_COMPLEX:
+ call achtxd (spp, nmi, nelems)
+ default:
+ call amovd (spp, nmi, nelems)
+ }
+
+ call ieevpakd (nmi, nmi, nelems)
+ }
+end