diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2015-07-08 20:46:52 -0400 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2015-07-08 20:46:52 -0400 |
commit | fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 (patch) | |
tree | bdda434976bc09c864f2e4fa6f16ba1952b1e555 /sys/osb/zzdebug.x | |
download | iraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz |
Initial commit
Diffstat (limited to 'sys/osb/zzdebug.x')
-rw-r--r-- | sys/osb/zzdebug.x | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/sys/osb/zzdebug.x b/sys/osb/zzdebug.x new file mode 100644 index 00000000..f15f3fd4 --- /dev/null +++ b/sys/osb/zzdebug.x @@ -0,0 +1,45 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +include <mach.h> + +task sbit, tbit + +define NWORDS 1 # limited to 1 longword at present + + +# SBIT, TBIT -- Test the bitpak and bitupk primitives. + +procedure sbit() + +int b[NWORDS] +int offset, nbits, value, i +int bitupk(), clgeti() + +begin + offset = clgeti ("offset") + nbits = clgeti ("nbits") + value = clgeti ("value") + + if (offset < 1 || offset > NWORDS * NBITS_INT) + call error (1, "bit offset out of range") + + call bitpak (value, b, offset, nbits) + + call printf ("\n") + call printf ("\t21098765432109876543210987654321\n") + call printf ("\t 3 2 1 0\n") + do i = 1, NWORDS { + call printf ("%4d\t%032r2 (%011oB)\n") + call pargi ((i-1) * 32 + 1) + call pargi (b[i]) + call pargi (b[i]) + } + return + +entry tbit() + offset = clgeti ("offset") + nbits = clgeti ("nbits") + + call printf ("bitfield=%d\n") + call pargi (bitupk (b, offset, nbits)) +end |