diff options
author | Joe Hunkeler <jhunkeler@gmail.com> | 2015-08-11 16:51:37 -0400 |
---|---|---|
committer | Joe Hunkeler <jhunkeler@gmail.com> | 2015-08-11 16:51:37 -0400 |
commit | 40e5a5811c6ffce9b0974e93cdd927cbcf60c157 (patch) | |
tree | 4464880c571602d54f6ae114729bf62a89518057 /unix/mc68000 | |
download | iraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz |
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'unix/mc68000')
-rw-r--r-- | unix/mc68000/README | 71 | ||||
-rw-r--r-- | unix/mc68000/ishift.SUN | 44 | ||||
-rw-r--r-- | unix/mc68000/zsvjmp.FX | 49 | ||||
-rw-r--r-- | unix/mc68000/zsvjmp.ISI | 52 | ||||
-rw-r--r-- | unix/mc68000/zsvjmp.SUN | 49 |
5 files changed, 265 insertions, 0 deletions
diff --git a/unix/mc68000/README b/unix/mc68000/README new file mode 100644 index 00000000..e23f067d --- /dev/null +++ b/unix/mc68000/README @@ -0,0 +1,71 @@ +MC68000/IRAF Installation Notes. +18 January 1986 (dct) +------------------------------------------- + +The 4.2BSD VAX version of UNIX/IRAF will run almost without change on a MC68000 +based workstation. In particular, the kernel should not have to be changed. +The changes which are required are due to machine differences, e.g., in the +assemblers and machine constants. The affected files are summarized below. +This documents only the source changes required for a MC68000, not the full +installation procedure required before the system can be compiled and run. + +host/as/*.s + All of the assembler sources are of course different for a VAX and + a 68000 based machine. The various UNIX assemblers for the MC68000 + UNIX implementations are also different, e.g., in the comment + convention, use of $ or # to denote a numeric constant, etc. + Despite the differences there are many similarities, and the + translation is usually not difficult. Note that only a couple of + assembler sources are required, although half a dozen or so should + eventually be implemented for efficiency reasons. + + To modify the AS directory for a MC68000, replace ZSVJMP.S, AMOV.S, + etc. with their MC68xxx versions, and remove all other VAX assembler + sources which you do not plan to implement (e.g., rename the original + AS directory as "vaxas"). Note that only the MC68020 has the bitfield + instructions needed for BITUPK.S and BITPAK.S. + +host/boot/* + No changes should be required. + +host/gdev/* + No changes should be required, unless new graphics devices have to be + interfaced. + +host/hlib/clpackage.cl + Change the default device names. + +host/hlib/mach.h +host/hlib/[dir]mach.f +host/hlib/libc/spp.h (EPSILON) + Change the machine constants to those for the MC68000. If the machine + has IEEE floating point, these constants are independent of the host + operating system (e.g., SUN or ISI). In <mach.h> only the machine + epsilon usually needs to be changed; the values for INDEF, MAX_LONG, + etc. the are the same for most modern minicomputers. + + The utility osb$zzeps.f may be used to determine the machine epsilon. + The values determined for a SUN/MC68010 with software floating point + were the following: + + EPSILONR (1.192e-7) + EPSILOND (2.220d-16) + + For a MC68xxx, the bytes are not swapped: + + BYTE_SWAP2 NO + BYTE_SWAP4 NO + + PORTLIB/[DIR]MACH.F contants: + + (to be determined) + +host/hlib/libc/iraf.h +host/hlib/mkiraf.csh +host/hlib/irafuser.csh + Change the pathnames in these files. + +When installing a new version of UNIX/IRAF it is usually best to install the +new UNIX directories as well, and then modify or replace the above files as +necessary for the 68000. All revisions are thus automatically picked up, and +the modifications required for the 68000 are minor. diff --git a/unix/mc68000/ishift.SUN b/unix/mc68000/ishift.SUN new file mode 100644 index 00000000..cfd6d7e9 --- /dev/null +++ b/unix/mc68000/ishift.SUN @@ -0,0 +1,44 @@ +|# IAND, IOR, ISHIFT -- Bitwise boolean integer functions for the NCAR +|# package. The shift function must rotate the bits left and around +|# if the nbits to shift argument is positive, and zero fill at the left +|# if the shift is negative (right shift). +|# +|# (SUN/UNIX MC68xxx version) + +|# AND -- Bitwise boolean AND: C = AND (A, B) + .text + .globl _iand_ +_iand_: + movl sp@(4),a0 + movl a0@,d0 + movl sp@(8),a0 + andl a0@,d0 + rts + + +|# OR -- Bitwise boolean OR: C = OR (A, B) + .text + .globl _ior_ +_ior_: + movl sp@(4),a0 + movl a0@,d0 + movl sp@(8),a0 + orl a0@,d0 + rts + + +|# ISHIFT -- Bitwise shift: C = ISHIFT (A, NBITS), +=left + .text + .globl _ishift_ +_ishift_: + movl sp@(4),a0 + movl a0@,d0 + movl sp@(8),a0 + movl a0@,d1 + blt L1 + roll d1,d0 |# left rotate (high bits come in at right) + rts +L1: + negl d1 + lsrl d1,d0 |# logical shift right (zero at left) + rts diff --git a/unix/mc68000/zsvjmp.FX b/unix/mc68000/zsvjmp.FX new file mode 100644 index 00000000..1f15102e --- /dev/null +++ b/unix/mc68000/zsvjmp.FX @@ -0,0 +1,49 @@ +|# ZSVJMP, ZDOJMP -- Set up a jump (non-local goto) by saving the processor +|# registers in the buffer jmpbuf. A subsequent call to ZDOJMP restores +|# the registers, effecting a call in the context of the procedure which +|# originally called ZSVJMP, but with the new status code. These are Fortran +|# callable procedures. +|# +|# (Alliant/UNIX MC68xxx version) + + .text + .globl _zsvjmp_ + .globl _zdojmp_ + + |# The following has nothing to do with ZSVJMP, and is included here + |# only because this assembler module is loaded with every process. + |# This code sets the value of the symbol MEM (the Mem common) to zero, + |# setting the origin for IRAF pointers to zero rather than some + |# arbitrary value, and ensuring that the MEM common is aligned for + |# all datatypes as well as page aligned. A further advantage is that + |# references to NULL pointers will cause a memory violation. + + .globl _mem_ + _mem_ = 0 + +_zsvjmp_: |# call zsvjmp (jmpbuf, status) + movl a0@(4), sp@- |# save pointer to status variable + movl a0@, sp@- |# save pointer to jmpbuf + + movl a0@, sp@- |# call alliant setcontext proc + movl sp, a0 + pea 1 + jsr _setcontext + addql #8, sp + + movl sp@+, a0 |# A0 = &jmpbuf + movl sp@+, a1 |# A1 = &status + + movl a1, a0@(2240) |# save &status in jmpbuf + clrl a1@ |# set status to zero + lea sp@(4), a1 + movl a1, a0@(68) + movl sp@, a0@(74) + rts + +_zdojmp_: + movl a0@, a1 |# A1 = &jmpbuf + movl a1@(2240), a2 |# A2 = &status + movl a0@(4), a3 |# pointer to status value + movl a3@, a2@ |# set status value + jsr _resetcontext diff --git a/unix/mc68000/zsvjmp.ISI b/unix/mc68000/zsvjmp.ISI new file mode 100644 index 00000000..0e7de609 --- /dev/null +++ b/unix/mc68000/zsvjmp.ISI @@ -0,0 +1,52 @@ +/* + * ZSVJMP, ZDOJMP -- Set up a jump (non-local goto) by saving the processor + * registers in the buffer jmpbuf. A subsequent call to ZDOJMP restores + * the registers, effecting a call in the context of the procedure which + * originally called ZSVJMP, but with the new status code. These are Fortran + * callable procedures. + * + * (ISI/UNIX version for the MC68000) + */ + + .text + .globl _zsvjmp_ + .globl _zdojmp_ + + /* The following has nothing to do with ZSVJMP, and is included here + * only because this assembler module is loaded with every process. + * This code sets the value of the symbol MEM (the Mem common) to zero, + * setting the origin for IRAF pointers to zero rather than some + * arbitrary value, and ensuring that the MEM common is aligned for + * all datatypes as well as page aligned. A further advantage is that + * references to NULL pointers will cause a memory violation. + */ + + .globl _mem_ + .set _mem_, 0 + + .set JMPBUF, 4 + .set STATUS, 8 + .set REGMASK, 0xfcfc /* D2-D7,A2-A5,A6,A7=sp */ + +_zsvjmp_: + movl sp@(JMPBUF),a0 /* set A0 to point to jmpbuf */ + movl sp@(STATUS),a1 /* A1 = status variable */ + movl a1,a0@ /* JB[1] = addr of status variable */ + clrl a1@ /* status = 0 */ + movl sp@+,a1 /* A1 = return address */ + movl a1,a0@(4) /* JB[3] = return address for longjmp */ + moveml #REGMASK,a0@(8) /* save register */ + jmp a1@ /* return from subroutine */ + +_zdojmp_: + movl sp@(STATUS),a0 + movl a0@,d0 /* D0 = status value */ + bne L1 /* branch if not equal to zero */ + moveq #1,d0 /* status must be nonzero */ +L1: + movl sp@(JMPBUF),a0 /* set A0 to point to jmpbuf */ + movl a0@,a1 /* get addr of zsvjmp status variable */ + movl d0,a1@ /* set the status value */ + moveml a0@(8),#REGMASK /* restore registers */ + movl a0@(4),a1 /* get return address of zsvjmp */ + jmp a1@ /* return from zsvjmp */ diff --git a/unix/mc68000/zsvjmp.SUN b/unix/mc68000/zsvjmp.SUN new file mode 100644 index 00000000..4789d053 --- /dev/null +++ b/unix/mc68000/zsvjmp.SUN @@ -0,0 +1,49 @@ +|# ZSVJMP, ZDOJMP -- Set up a jump (non-local goto) by saving the processor +|# registers in the buffer jmpbuf. A subsequent call to ZDOJMP restores +|# the registers, effecting a call in the context of the procedure which +|# originally called ZSVJMP, but with the new status code. These are Fortran +|# callable procedures. +|# +|# (SUN/UNIX MC68xxx version) + + .text + .globl _zsvjmp_ + .globl _zdojmp_ + + |# The following has nothing to do with ZSVJMP, and is included here + |# only because this assembler module is loaded with every process. + |# This code sets the value of the symbol MEM (the Mem common) to zero, + |# setting the origin for IRAF pointers to zero rather than some + |# arbitrary value, and ensuring that the MEM common is aligned for + |# all datatypes as well as page aligned. A further advantage is that + |# references to NULL pointers will cause a memory violation. + + .globl _mem_ + _mem_ = 0 + + JMPBUF = 4 + STATUS = 8 + REGMASK = 0xfcfc |# D2-D7,A2-A5,A6,A7=sp + +_zsvjmp_: + movl sp@(JMPBUF),a0 |# set A0 to point to jmpbuf + movl sp@(STATUS),a1 |# A1 = status variable + movl a1,a0@ |# JB[1] = addr of status variable + clrl a1@ |# status = 0 + movl sp@+,a1 |# A1 = return address + movl a1,a0@(4) |# JB[2] = return address for longjmp + moveml #REGMASK,a0@(8) |# save register + jmp a1@ |# return from subroutine + +_zdojmp_: + movl sp@(STATUS),a0 + movl a0@,d0 |# D0 = status value + bne L1 |# branch if not equal to zero + moveq #1,d0 |# status must be nonzero +L1: + movl sp@(JMPBUF),a0 |# set A0 to point to jmpbuf + movl a0@,a1 |# get addr of zsvjmp status variable + movl d0,a1@ |# set the status value + moveml a0@(8),#REGMASK |# restore registers + movl a0@(4),a1 |# get return address of zsvjmp + jmp a1@ |# return from zsvjmp |