aboutsummaryrefslogtreecommitdiff
path: root/sys/plio/pllnext.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/plio/pllnext.x
downloadiraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz
Initial commit
Diffstat (limited to 'sys/plio/pllnext.x')
-rw-r--r--sys/plio/pllnext.x61
1 files changed, 61 insertions, 0 deletions
diff --git a/sys/plio/pllnext.x b/sys/plio/pllnext.x
new file mode 100644
index 00000000..43d87c01
--- /dev/null
+++ b/sys/plio/pllnext.x
@@ -0,0 +1,61 @@
+# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.
+
+include <plio.h>
+include "pllseg.h"
+
+# PLL_NEXTSEG -- Internal routine called by the PLLSEG.H routines to get the
+# next segment of a line list.
+
+procedure pll_nextseg (ll, ld)
+
+short ll[ARB] #I input line list
+int ld[LEN_PLLDES] #I list list i/o descriptor
+
+int ip
+int opcode, data
+
+begin
+ for (ip = ld_ip(ld); ip <= LL_LEN(ll); ip = ld_ip(ld)) {
+ ld_ip(ld) = ip + 1
+ opcode = I_OPCODE(ll[ip])
+ data = I_DATA(ll[ip])
+
+ switch (opcode) {
+ case I_ZN:
+ ld_nleft(ld) = data
+ ld_value(ld) = 0
+ return
+ case I_HN:
+ ld_nleft(ld) = data
+ ld_value(ld) = ld_hi(ld)
+ return
+ case I_PN:
+ ld_nleft(ld) = data - 1
+ ld_value(ld) = 0
+ ld_next_nleft(ld) = 1
+ ld_next_value(ld) = ld_hi(ld)
+ return
+
+ case I_SH:
+ ip = ip + 1
+ ld_ip(ld) = ip + 1
+ ld_hi(ld) = (int(ll[ip]) * I_SHIFT) + data
+ case I_IH:
+ ld_hi(ld) = ld_hi(ld) + data
+ case I_DH:
+ ld_hi(ld) = ld_hi(ld) - data
+
+ case I_IS, I_DS:
+ if (opcode == I_IS)
+ ld_hi(ld) = ld_hi(ld) + data
+ else
+ ld_hi(ld) = ld_hi(ld) - data
+
+ ld_nleft(ld) = 1
+ ld_value(ld) = ld_hi(ld)
+ return
+ }
+ }
+
+ ld_value(ld) = 0
+end