C     .TITLE HYSAT
C
C  24 AUG 73 (PDH) CHANGE MAX CHANNEL FOR A-D & D-A (#1690 & #1710)
C  16 MAY 72 - MOD BY PAUL HENDERSON FOR UOW
C
C       HYBRID STATIC ANALOG TEST
C       NOVEMBER, 1968
C       C.L. CROSS
C       CARNEGIE-MELLON UNIVERSITY
C       HYBRID COMPUTATION LABORATORY
C
        INTEGER ANSWER,COL,ERROR,OU,S,TOLER,TYPE,VALUE
        LOGICAL ERRORS,ERRSW,REPSW,SAVESW,SKIP,STATE,SWITCH,Z
        LOGICAL RSAC,RSCS,TGPI,TRSL
        REAL IFIELD(8),ILCODE(8),INAME(2),IREP(8),LMODE(3),INVARG(8)
        REAL IERROR(8,5),MODES(3,3),MESS1(5,3),MESS2(3,3)
        REAL MFIELD,NFIELD,ATOD
        DIMENSION ONAME(2),AMODE(3),TCON(3),UFIELD(8),TYPES(8)
        DIMENSION COMP(5),SLINE(5),GPI(5),WSTATE(3),OCCURI(3),FOCCUR(3)
        EXTERNAL HANDLE
        COMMON/A/CHAR(72)
        COMMON/B/VALUE
        COMMON/C/COL,TYPE
        COMMON/D/ANSWER
        COMMON/E/Z
        COMMON/F/INPUT
        EQUIVALENCE (IERROR(1,1),UFIELD(1))
        EQUIVALENCE (IERROR(1,2),ILCODE(1))
        EQUIVALENCE (IERROR(1,3),IFIELD(1))
        EQUIVALENCE (IERROR(1,4),IREP(1))
        EQUIVALENCE (IERROR(1,5),INVARG(1))
        EQUIVALENCE (MODES(1,1),AMODE(1))
        EQUIVALENCE (MODES(1,2),TCON(1))
        EQUIVALENCE (MODES(1,3),LMODE(1))
        EQUIVALENCE (MESS1(1,1),COMP(1))
        EQUIVALENCE (MESS1(1,2),SLINE(1))
        EQUIVALENCE (MESS1(1,3),GPI(1))
        EQUIVALENCE (MESS2(1,1),WSTATE(1))
        EQUIVALENCE (MESS2(1,2),OCCURI(1))
        EQUIVALENCE (MESS2(1,3),FOCCUR(1))
        DATA AMODE(1)/5H ANAL/
        DATA AMODE(2)/5HOG MO/
        DATA AMODE(3)/5HDE   /
        DATA ATOD/2HAD/
        DATA COMP(1)/5HCOMPA/
        DATA COMP(2)/5HRATOR/
        DATA COMP(3)/5H     /
        DATA COMP(4)/5H     /
        DATA COMP(5)/5H     /
        DATA FOCCUR(1)/5HFAILE/
        DATA FOCCUR(2)/5HD TO /
        DATA FOCCUR(3)/5HOCCUR/
        DATA GPI(1)/5HGENER/
        DATA GPI(2)/5HAL PU/
        DATA GPI(3)/5HRPOSE/
        DATA GPI(4)/5H INTE/
        DATA GPI(5)/5HRRUPT/
        DATA IFIELD(1)/5HILLEG/
        DATA IFIELD(2)/5HAL FI/
        DATA IFIELD(3)/5HELD  /
        DATA IFIELD(4)/5H     /
        DATA IFIELD(5)/5H     /
        DATA IFIELD(6)/5H     /
        DATA IFIELD(7)/5H     /
        DATA IFIELD(8)/5H     /
        DATA ILCODE(1)/5HILLEG/
        DATA ILCODE(2)/5HAL CO/
        DATA ILCODE(3)/5HMMAND/
        DATA ILCODE(4)/5H CODE/
        DATA ILCODE(5)/5H     /
        DATA ILCODE(6)/5H     /
        DATA ILCODE(7)/5H     /
        DATA ILCODE(8)/5H     /
        DATA INVARG(1)/5HINVAL/
        DATA INVARG(2)/5HID AR/
        DATA INVARG(3)/5HGUMEN/
        DATA INVARG(4)/5HT IN /
        DATA INVARG(6)/5HLD   /
        DATA INVARG(7)/5H     /
        DATA INVARG(8)/5H     /
        DATA IREP(1)/5HINCON/
        DATA IREP(2)/5HSISTE/
        DATA IREP(3)/5HNT RE/
        DATA IREP(4)/5HPETIT/
        DATA IREP(5)/5HION S/
        DATA IREP(6)/5HPECIF/
        DATA IREP(7)/5HICATI/
        DATA IREP(8)/5HON   /
        DATA LMODE(1)/5H LOGI/
        DATA LMODE(2)/5HC MOD/
        DATA LMODE(3)/5HE    /
        DATA MFIELD/5HM FIE/
        DATA NFIELD/5HN FIE/
        DATA OCCURI(1)/5HOCCUR/
        DATA OCCURI(2)/5HRED  /
        DATA OCCURI(3)/5H     /
        DATA SLINE(1)/5HSENSE/
        DATA SLINE(2)/5H LINE/
        DATA SLINE(3)/5H     /
        DATA SLINE(4)/5H     /
        DATA SLINE(5)/5H     /
        DATA TCON(1)/5H TIME/
        DATA TCON(2)/5H CONS/
        DATA TCON(3)/5HTANT /
        DATA TYPES(1)/2HA /
        DATA TYPES(2)/2HD /
        DATA TYPES(3)/2HF /
        DATA TYPES(4)/2HT /
        DATA TYPES(5)/2HP /
        DATA TYPES(6)/2HPP/
        DATA TYPES(7)/2HD /
        DATA TYPES(8)/2HQ /
        DATA UFIELD(1)/5HUNREC/
        DATA UFIELD(2)/5HOGNIZ/
        DATA UFIELD(3)/5HABLE /
      DATA UFIELD(4)/5HFIELD/
        DATA UFIELD(5)/5H     /
        DATA UFIELD(6)/5H     /
        DATA UFIELD(7)/5H     /
        DATA UFIELD(8)/5H     /
        DATA WSTATE(1)/5HIN WR/
        DATA WSTATE(2)/5HONG S/
        DATA WSTATE(3)/5HTATE /
C       CONSOLE INITIALIATION
        CALL INIT(ERROR)
        IF (ERROR.EQ.0) GO TO 10
        WRITE (4,99999)
        STOP 1
C       PROGRAM INITIALIZATION
10      TOLER=5
        ERRSW=.TRUE.
        SAVESW=.FALSE.
        WRITE(4,10010)
C       INPUT UNIT SPECIFICATION
20      IF (RSAC(0)) GO TO 21
        WRITE (4,10020)
        GO TO 22
21      WRITE(4,10021)
22      WRITE(4,10000)
        READ (4,11000) IU
        IF (IU.LT.1) GO TO 60
        IF (IU-3) 70,30,60
C       DECTAPE INPUT
30      IF (.NOT.RSAC(0)) WRITE(4,10030)
40      IF (RSAC(0)) GO TO 41
        WRITE(4,10040)
        GO TO 42
41      WRITE(4,10041)
42      WRITE(4,10000)
        READ(4,11010) IU,INAME
        IF (IU.GT.0.AND.IU.LT.4) GO TO 50
        WRITE(4,12000)
        GO TO 40
50      CALL SEEK(IU,INAME)
        GO TO 100
C       ILLEGAL IU
60      WRITE(4,12000)
        GO TO 20
C       TELETYPE OR CARD READER INPUT
70      IU=IU+3
C
C       OUTPUT UNIT SPECIFICATION
100     IF (RSAC(0)) GO TO 101
        WRITE(4,10050)
        GO TO 102
101     WRITE(4,10051)
102     WRITE(4,10000)
        READ(4,11000) OU
        IF (OU-1) 120,110,130
C       TELETYPE OUTPUT
110     OU=4
        GO TO 200
C       ILLEGAL OU
120     WRITE(4,12010)
        GO TO 100
C
130   IF (OU.EQ.3) GO TO 150
C  LINE PRINTER OR PRECISION DISPLAY OUTPUT
140     OU=OU+4
        GO TO 200
C       DECTAPE OUTPUT
150     IF (.NOT.RSAC(0)) WRITE(4,10060)
160     IF (RSAC(0)) GO TO 161
        WRITE(4,10040)
        GO TO 162
161     WRITE(4,10041)
162     WRITE(4,10000)
        READ(4,11010) OU,ONAME
        IF (OU.GT.0.AND.OU.LT.4) GO TO 170
        WRITE(4,12010)
        GO TO 160
170     CALL ENTER(OU,ONAME)
        GO TO 200
C
C       TEST INITIALIZATION
200     INPUT=IU
        S=1
        IF (.NOT.RSAC(0)) WRITE(4,10070)
210     IF (RSAC(0)) GO TO 211
        WRITE(4,10080)
        GO TO 212
211     WRITE(4,10081)
212     WRITE(4,10000)
        READ(4,11000) L
C
C       DATA STATEMENT INTERPRETER
C
C       READ NEXT EXECUTABLE RECORD
1000    IF (SKIP) GO TO 1001
        IF (ERRORS) GO TO 1010
        GO TO 1020
1001    IF (ERRORS) GO TO 1020
1010    S=1
1020    IF (RSAC(7).OR.RSAC(8).OR.RSAC(9)) GO TO 9990
        IF (RSAC(10)) GO TO 2140
        JINPUT=INPUT
        IF ( RSAC(11)) JINPUT=4
        DO 1030 L=1,S
        IF (JINPUT.EQ.4) WRITE(4,10000)
1030    READ(JINPUT,11020) CHAR
C       GET COMMAND CODE
1040    COL=1
        CALL DECODE
        IF (TYPE) 2500,1050,1060
1050    IF (VALUE.NE.0) GO TO 2520
C       BLANK STATEMENT - RESTORE IU
        INPUT=IU
        GO TO 1010
C
1060    IF (TYPE-3) 2520,1070,1150
1070    IF (VALUE+5) 1080,1090,1100
C       YES STATEMENT
1080    ERRSW=.TRUE.
        GO TO 1010
C       NO STATEMENT
1090    ERRSW=.FALSE.
        GO TO 1010
C
1100    IF (VALUE+3) 1110,1120,1130
C       ON STATEMENT
1110    SAVESW=.TRUE.
        GO TO 1010
C       OFF STATEMENT
1120    SAVESW=.FALSE.
        GO TO 1010
C       END,COMMENT,OTHER
1130    IF (VALUE+1) 2140,1140,1150
C       COMMENT
1140    WRITE(OU,11030) CHAR
        GO TO 1010
C       SAVE COMMAND CODE AND INITIALIZE ALL VALUES
1150    IVALUE=VALUE
        ITYPE=TYPE
        I=-1
        J=0
        M=0
        N=0
        S=1
        STATE=.TRUE.
        SWITCH=.FALSE.
        ERRORS=.FALSE.
        IF (ITYPE.NE.3) GO TO 1380
C       GET (N)
        CALL DECODE
        IF (TYPE) 2500,1200,1160
1160    IF (TYPE-2) 1170,1410,2540
1170    N=VALUE
        IF (IVALUE-25) 1210,1180,1190
C       ERROR TOLERANCE STATEMENT
1180    TOLER=N
        GO TO 1020
C       SKIP STATEMENT
1190    S=N+1
1195    INPUT=IU
        GO TO 1020
C
1200    IF (VALUE.NE.0) GO TO 1230
        IF (IVALUE-25) 1210,1180,1195
C      GET (SIGN)
1210    CALL DECODE
        IF (TYPE) 2500,1220,1260
1220    IF (VALUE.EQ.0) GO TO 1240
1230    IF (IVALUE.GE.25) GO TO 2540
        IF (VALUE.EQ.1) GO TO 1240
C       MINUS SIGN
        STATE=.FALSE.
C       PLUS SIGN
1240    IF (IVALUE.GE.15) GO TO 1290
C       GET (M)
        CALL DECODE
        IF (TYPE) 2500,1250,1270
1250    IF (VALUE) 2540,1290,2540
1260    IF (IVALUE.GE.15) GO TO 1310
1270    IF (TYPE-2) 1280,1410,2540
1280    M=VALUE
C       GET (I)
1290    CALL DECODE
        IF (TYPE) 2500,1300,1310
1300    IF (VALUE) 2540,1330,2540
1310    IF (TYPE-2) 1320,1410,2540
1320    I=VALUE
C       GET (J)
1330    CALL DECODE
        IF (TYPE) 2500,1340,1350
1340    IF (VALUE) 2540,1370,2540
1350    IF (TYPE-2) 1360,1410,2540
1360    J=VALUE
1370    IF (IVALUE.EQ.11.OR.IVALUE.GE.20) GO TO 1600
C       GET (ERROR SWITCH)
1380    CALL DECODE
        IF (TYPE) 2500,1390,1400
1390    IF (VALUE) 2540,1600,2540
1400    IF (TYPE-2) 2540,1420,2540
1410    IF (IVALUE.EQ.11.OR .IVALUE.GE.20) GO TO 2540
1420    IF (VALUE) 1430,1440,1450
C       E ERROR SWITCH
1430    SKIP=.TRUE.
        GO TO 1460
C       H ERROR SWITCH
1440    SWITCH=.TRUE.
        GO TO 1600
C       S ERROR SWITCH
1450    SKIP=.FALSE.
C       GET (S)
1460    CALL DECODE
        IF (TYPE) 2500,1470,1480
1470    IF (VALUE) 2540,1600,2540
1480    IF (TYPE-2) 1490,2540,2540
1490    S=VALUE+1
C       END OF DATA STATEMENT INTERPRETER
C
C       DATA STATEMENT EXECUTION
1600    IF (ITYPE.EQ.3) GO TO 1650
1605    IF (ITYPE-5) 1610,1630,1640
C       ANALOG MODE STATEMENT
1610    CALL SAMO(IVALUE,ERROR)
C       15 MILLISECOND PAUSE
        DO 1620 L=1,1100
1620    CONTINUE
        GO TO 1642
C       TIME CONSTANT STATEMENT
1630    CALL STCO(IVALUE,ERROR)
        GO TO 1642
C       LOGIC MODE STATEMENT
1640    CALL SLMO(IVALUE,ERROR)
C       ERRORX SECTION
1642    IF (ERROR.EQ.0) GO TO 1000
        ERRORS=.TRUE.
        IF (SWITCH.OR.RSAC(4).OR.RSAC(6)) GO TO 1644
        IF (ERRSW.AND..NOT.RSAC(5)) GO TO 1644
        IF (RSAC(1)) GO TO 1605
        GO TO 1000
1644    WRITE(OU,12040) (MODES(J,I),J=1,3)
        IF (SWITCH.OR.RSAC(1).OR.RSAC(6)) GO TO 1645
        GO TO 1000
1645    IF (OU.NE.4) WRITE(4,12040) (MODES(J,I),J=1,3)
        ANSWER=0
        CALL DECIDE
        IF (ANSWER) 1605,1000,1040
C       TRANSLATE COMPONENT INDEX TO ALPHANUMERIC CODE
1650    IF (IVALUE-10) 1652,1654,1656
1652    CTYPE=TYPES(IVALUE+1)
        GO TO 1656
1654    CTYPE=ATOD
C       ANALYZE ADDRESS (N) AND VALUE (M)
1656    IF (IVALUE-10) 1680,1690,1660
1660    IF (IVALUE-15) 1710,1730,1670
1670    IF (IVALUE-17) 1730,1740,1740
C       ANALOG COMPONENT
1680    NMAX=119
        GO TO 1700
C       A-TO-D
1690    NMAX=63
1700    IF (RSAC(2)) GO TO 1725
        IF (RSAC(3)) GO TO 1701
        IF (SAVESW) GO TO 1725
1701    IF (IVALUE.EQ.10) GO TO 1720
        IF (M.GT.11999) GO TO 2600
        IF (IVALUE.NE.4) GO TO 1725
        CALL RAMO(MODE)
        IF (MODE.NE.7) GO TO 1725
        IF (.NOT.STATE) GO TO 2600
        GO TO 1720
C       D-TO-A
1710    NMAX=5
1720    IF (M.GT.9999) GO TO 2600
1725    IF (N.GT.NMAX) GO TO 2610
        IF (IVALUE.EQ.11) M=FLOAT(M)*13.1072
        IF (.NOT.STATE) M=-M
        GO TO 1770
C       SL OR GP
1730    NMAX=7
        GO TO 1750
C       CS, FR, OR CL
1740    NMAX=15
1750    IF (N-NMAX-1) 1770,1760,2610
C       ALL COMPONENTS
1760    IF (I.GE.0) GO TO 2560
        N=0
        J=NMAX+1
        GO TO 1790
C       ANALYZE REPETITION SPECFICATIONS
1770    IF (I) 1780,1800,1810
C       (I) IS BLANK - NO REPETITIONS
1780    J=N+1
1790    I=1
        GO TO 1820
C       (I) IS ZERO - J REPETITIONS OF N
1800    L=N
        N=1
        I=1
        REPSW=.FALSE.
        GO TO 1830
C       (I) IS GREATER THAN ZERO - INCREMENT N BY I TO J
1810    IF (N.GT.J.OR.J.GT.NMAX) GO TO 2560
        J=J+1
1820    N=N+1
        REPSW=.TRUE.
C       MAIN EXECUTION LOOP
1830    DO 2130 K=N,J,I
        IF (REPSW) L=K-1
        IF (IVALUE-10) 1870,1900,1840
1840    IF (IVALUE-15) 1910,1920,1850
1850    IF (IVALUE-17) 1930,2060,1860
1860    IF (IVALUE-21) 2070,2110,2540
C       ANALOG COMPONENT SELECTION STATEMENT
1870    IF (RSAC(2)) GO TO 1880
        IF (RSAC(3)) GO TO 1871
        IF (SAVESW) GO TO 1880
1871    IF (IVALUE.EQ.4.AND.MODE.EQ.7) GO TO 1890
1880    CALL RAVA(IVALUE,L,VALUE,ERROR)
        TYPE=-1
        GO TO 1901
C       SET A POT
1890    CALL SPOT(L,M,TOLER,ERROR)
        IF (ERROR.EQ.0) GO TO 2130
        TYPE=0
        GO TO 1905
C       A-TO-D STATEMENT
1900    CALL CRAC(L,VALUE,ERROR)
        VALUE=FLOAT(VALUE)/13.1072
        TYPE=1
C       ERRORZ SECTION
1901    IF (ERROR.NE.0) GO TO 1905
        IF (RSAC(2)) GO TO 1904
        IF (RSAC(3)) GO TO 1902
        IF (SAVESW) GO TO 1904
1902    VALUE=VALUE-M
        IF (TOLER-IABS(VALUE).GE.0) GO TO 2130
        ERRORS=.TRUE.
        IF (SWITCH.OR.RSAC(4).OR.RSAC(6)) GO TO 1903
        IF (ERRSW.AND..NOT.RSAC(5)) GO TO 1903
        IF (RSAC(1)) GO TO 1908
        GO TO 2130
1903    WRITE(OU,12050) CTYPE,L,VALUE
        IF (SWITCH.OR.RSAC(1).OR.RSAC(6)) GO TO 19031
        GO TO 2130
19031   IF (OU.NE.4) WRITE(4,12050) CTYPE,L,VALUE
        GO TO 1907
C       STATUS READOUT MODE
1904    WRITE(OU,11060) CTYPE,L,VALUE
        GO TO 2130
C       ERRORY SECTION
1905    ERRORS=.TRUE.
        IF (SWITCH.OR.RSAC(4).OR.RSAC(6)) GO TO 1906
        IF (ERRSW.AND..NOT.RSAC(5)) GO TO 1906
        IF (RSAC(1)) GO TO 1908
        GO TO 2130
1906    WRITE(OU,12060) CTYPE,L,ERROR
        IF (SWITCH.OR.RSAC(1).OR.RSAC(6)) GO TO 19061
        GO TO 2130
19061   IF (OU.NE.4) WRITE(4,12060) CTYPE,L,ERROR
1907    ANSWER=0
        CALL DECIDE
        IF (ANSWER) 1908,2130,1040
1908    IF (TYPE) 1880,1890,1900
C       D-TO-A STATEMENT
1910    CALL LTDA(L,M,ERROR)
        GO TO 2130
C       SENSE LINE STATEMENT
1920    Z=TRSL(L)
        IF (STATE) GO TO 1921
        IF (Z) GO TO 1922
        GO TO 2130
1921    IF (Z) GO TO 2130
1922    TYPE=2
        GO TO 2064
C       GENERAL PURPOSE INTERRUPT STATEMENT
1930    Z=TGPI(L)
        IF (STATE) GO TO 1931
        IF (Z) GO TO 1932
        GO TO 1940
1931    IF (Z) GO TO 1940
1932    VALUE=1
        GO TO 2050
1940    Z=.FALSE.
        CALL IGPI(L,HANDLE,ERROR)
        CALL DGPI(L,ERROR)
        IF (Z) GO TO 2031
        IF (STATE) GO TO 2040
        GO TO 2130
2031    IF (STATE) GO TO 2130
        VALUE=2
        GO TO 2050
2040    VALUE=3
2050    TYPE=3
        GO TO 2065
C       COMPARATOR STATUS STATEMENT
2060    Z=RSCS(L)
        IF (STATE) GO TO 2061
        IF (Z) GO TO 2062
        GO TO 2130
2061    IF (Z) GO TO 2130
2062    TYPE=1
2064    VALUE=1
C       ERRORT SECTION
2065    ERRORS=.TRUE.
        IF (SWITCH.OR.RSAC(4).OR.RSAC(6)) GO TO 2066
        IF (ERRSW.AND..NOT.RSAC(5)) GO TO 2066
        IF (RSAC(1)) GO TO 2067
        GO TO 2068
2066  WRITE(OU,12070) (MESS1(COL,TYPE),COL=1,5),L,(MESS2(COL,VALUE),
     1 COL=1,3)
        IF (SWITCH.OR.RSAC(1).OR.RSAC(6)) GO TO 20661
        GO TO 2068
20661 IF (OU.NE.4) WRITE(4,12070) (MESS1(COL,TYPE),COL=1,5),L,
     1 (MESS2(COL,VALUE),COL=1,3)
        ANSWER=0
        CALL DECIDE
        IF (ANSWER) 2067,2068,1040
2067    IF (IVALUE-16) 1920,1930,2060
2068    IF (IVALUE.EQ.16.AND.VALUE.EQ.1) GO TO 1940
        GO TO 2130
C       FUNCTION RELAY STATEMENT
2070    IF (STATE) GO TO 2080
        CALL SSRM(L,ERROR)
        GO TO 2090
2080    CALL SSRP(L,ERROR)
C       2 MILLISECOND PAUSE
2090    DO 2100 M=1,150
2100    CONTINUE
        GO TO 2130
C       CONTROL LINE STATEMENT
2110    IF (STATE) GO TO 2120
        CALL RSCL(L,ERROR)
        GO TO 2130
2120    CALL SSCL(L,ERROR)
2130    CONTINUE
        GO TO 1000
C       END OF DATA STATEMENT EXECUTION
C
C       END STATEMENT
2140    WRITE(4,10090)
        IF (OU.NE.4) WRITE(OU,10090)
        IF (IU.LT.4) CALL CLOSE(IU)
        IF (OU.LT.4) CALL CLOSE(OU)
C       CONTINUATION DIRECTIVE
2150    IF (RSAC(0)) GO TO 2151
        WRITE(4,10100)
        GO TO 2152
2151    WRITE(4,10101)
2152    WRITE(4,10000)
        READ(4,11000) I
        IF (I-1) 2160,2170,2180
C       CONTINUE
2160    IF (IU.LT.4) CALL SEEK(IU,INAME)
        IF (OU-4) 150,210,210
C       TERMINATE
2170    STOP 2
C       RESTART, CHANGE IU AND OU, ILLEGAL CONTINUATION DIRECTIVE
2180    IF (I-3) 10,20,2190
2190    WRITE(4,12020)
        GO TO 2150
C
C       INPUT ERRORS CONTROL
2500    I=1
        GO TO 2700
2520    I=2
        GO TO 2700
2540    I=3
        GO TO 2700
2560    I=4
        GO TO 2700
2600    INVARG(5)=MFIELD
        GO TO 2620
2610    INVARG(5)=NFIELD
2620    I=5
C       ERRORA SECTION
2700    WRITE(4,11040) (IERROR(J,I),J=1,8)
        IF (INPUT.NE.4) WRITE(4,11030) (CHAR(J),J=1,40)
        IF (OU.EQ.4) GO TO 2710
        WRITE(OU,11040) (IERROR(J,I),J=1,8)
        WRITE(OU,11050) (CHAR(J),J=1,40)
2710    INPUT=4
        IF (RSAC(0)) GO TO 2711
        WRITE(4,10110)
        GO TO 1010
2711    WRITE(4,10111)
        GO TO 1010
C       ABORTS
9990    IF (IU.LT.4) CALL CLOSE(IU)
        IF (OU.LT.4) CALL CLOSE(OU)
        IF (RSAC(7)) GO TO 2170
        IF (RSAC(8)) GO TO 10
        IF (RSAC(9)) GO TO 20
        GO TO 2150
C       END OF INPUT ERROR CONTROL
C
C       OUTPUT FORMATS (HYSAT DIRECTIVES)
10000 FORMAT(1H ,1H$)
10010 FORMAT(1H1,5HHYSAT)
10020 FORMAT (57H0TYPE INPUT DIRECTIVE- 1-TTY,2-CARD READER,
     *3-DISK/DECTAPE)
10021 FORMAT(1H0,3HIU-)
10030 FORMAT(1H ,16HMOUNT INPUT TAPE)
10040 FORMAT(1H ,38HTYPE UNIT NUMBER,FILE NAME- NFILENMEXT)
10041 FORMAT (1H ,11HNFILENMEXT-)
10050 FORMAT (69H0TYPE OUTPUT DIRECTIVE- 1-TTY,2-LINE PRINTER,
     *3-DISK/DECTAPE,4-DISPLAY)
10051 FORMAT(1H0,3HOU-)
10060 FORMAT(1H ,17HMOUNT OUTPUT TAPE)
10070 FORMAT(1H0,27HENGAGE PATCH PANEL FOR TEST)
10080 FORMAT(1H ,18HTYPE CR WHEN READY)
10081 FORMAT (1H ,3HCR-)
10090 FORMAT(1H0,11HEND OF TEST)
10100 FORMAT(1H0,28HTYPE CONTINUATION DIRECTIVE-/1H ,47H0-CONTINUE,1-TER
     1MINATE,2-RESTART,3-CHANGE IU/OU)
10101 FORMAT(1H0,13HCONTINUATION-)
10110 FORMAT(1H ,21HCORRECT STATEMENT(S)-)
10111 FORMAT(1H ,8HCORRECT-)
C
C       INPUT FORMATS
11000 FORMAT(I1)
11010 FORMAT(I1,A5,A4)
11020 FORMAT(72A1)
11030 FORMAT(1H ,72A1)
11040 FORMAT(1H ,5HCO **,8A5)
11050 FORMAT(1H ,3HCO ,40A1)
11060 FORMAT(1H ,A2,I3,I6)
C
C       OUTPUT FORMATS (ERROR MESSAGES)
12000 FORMAT(1H ,12H**ILLEGAL IU)
12010 FORMAT(1H ,12H**ILLEGAL OU)
12020 FORMAT(1H ,32H**ILLEGAL CONTINUATION DIRECTIVE)
12040 FORMAT(1H ,2HCO,3A5,22HFAILED TO SET PROPERLY)
12050 FORMAT(1H ,13HCO COMPONENT ,A2,1X,I3,10H WRONG BY ,I6,11H MILLIVOL
     1TS)
12060 FORMAT(1H ,13HCO COMPONENT ,A2,1X,I3,16H GAVE ERROR NO. ,I1)
12070 FORMAT(1H ,3HCO ,5A5,1H ,I2,1H ,3A5)
C
99999 FORMAT (1H ,24HCONSOLE FAILED TO SELECT)
        END
