C***********************************************************************00000010
C*                                                                     *00000020
C*      PRODUCT  062-1474-02  PLOT 10/TERMINAL CONTROL SYSTEM          *00000030
C*                            RELEASE 3.0                              *00000040
C*                                                                     *00000050
C*             C  COPYRIGHT 1974 TEKTRONIX, INC.                       *00000060
C*                ALL RIGHTS RESERVED                                  *00000070
C*                                                                     *00000080
C*                TEKTRONIX, INC.                                      *00000090
C*                P. O. BOX 500                                        *00000100
C*                BEAVERTON, OREGON 97005                              *00000110
C*                                                                     *00000120
C***********************************************************************00000130
C                                                                       00000140
C----------SUBROUTINE--ANMODE------------------------TEKTRONIX, INC.----00000150
C                                                                       00000160
      SUBROUTINE ANMODE                                                 00000170
C * ENTER ALPHA-NUMERIC MODE                                            00000180
      CALL ALFMOD                                                       00000190
C * DUMP THE OUTPUT BUFFER                                              00000200
      CALL TSEND                                                        00000210
      RETURN                                                            00000220
      END                                                               00000230
C                                                                       00000240

C----------SUBROUTINE--SEEMRG------------------------TEKTRONIX, INC.----00000250
C                                                                       00000260
      SUBROUTINE SEEMRG(MLEFT,MRIGHT)                                   00000270
      COMMON /TKTRNX/ TMINVX,TMINVY,TMAXVX,TMAXVY,TREALX,TREALY,        00000280
     1 TIMAGX,TIMAGY,TRCOSF,TRSINF,TRSCAL,TRFACX,TRFACY,                00000290
     2 TRPAR1,TRPAR2,TRPAR3,TRPAR4,TRPAR5,TRPAR6,KMOFLG(8),KPAD2,       00000300
     3 KBAUDR,KGNFLG,KGRAFL,KHOMEY,KKMODE,KHORSZ,KVERSZ,KTBLSZ,         00000310
     4 KSIZEF,KLMRGN,KRMRGN,KFACTR,KTERM,KLINE,KZAXIS,KBEAMX,KBEAMY,    00000320
     5 KMOVEF,KPCHAR(5),KDASHT,KMINSX,KMINSY,KMAXSX,KMAXSY,KEYCON,      00000330
     6 KINLFT,KOTLFT,KUNIT                                              00000340
      MLEFT=KLMRGN                                                      00000350
      MRIGHT=KRMRGN                                                     00000360
      RETURN                                                            00000370
      END                                                               00000380
C                                                                       00000390

C----------SUBROUTINE--SEETRM------------------------TEKTRONIX, INC.----00000400
C                                                                       00000410
      SUBROUTINE SEETRM(IBAUDR,ITERM,ICSIZE,MAXSCR)                     00000420
      COMMON /TKTRNX/ TMINVX,TMINVY,TMAXVX,TMAXVY,TREALX,TREALY,        00000430
     1 TIMAGX,TIMAGY,TRCOSF,TRSINF,TRSCAL,TRFACX,TRFACY,                00000440
     2 TRPAR1,TRPAR2,TRPAR3,TRPAR4,TRPAR5,TRPAR6,KMOFLG(8),KPAD2,       00000450
     3 KBAUDR,KGNFLG,KGRAFL,KHOMEY,KKMODE,KHORSZ,KVERSZ,KTBLSZ,         00000460
     4 KSIZEF,KLMRGN,KRMRGN,KFACTR,KTERM,KLINE,KZAXIS,KBEAMX,KBEAMY,    00000470
     5 KMOVEF,KPCHAR(5),KDASHT,KMINSX,KMINSY,KMAXSX,KMAXSY,KEYCON,      00000480
     6 KINLFT,KOTLFT,KUNIT                                              00000490
      IBAUDR=KBAUDR                                                     00000500
      ITERM=KTERM                                                       00000510
      ICSIZE=KSIZEF                                                     00000520
      MAXSCR=4095/KFACTR                                                00000530
      RETURN                                                            00000540
      END                                                               00000550
C                                                         0             00000560

C----------SUBROUTINE--SEETW-------------------------TEKTRONIX, INC.----00000570
C                                                                       00000580
      SUBROUTINE SEETW(MINX,MAXX,MINY,MAXY)                             00000590

      COMMON /TKTRNX/ TMINVX,TMINVY,TMAXVX,TMAXVY,TREALX,TREALY,        00000600
     1 TIMAGX,TIMAGY,TRCOSF,TRSINF,TRSCAL,TRFACX,TRFACY,                00000610
     2 TRPAR1,TRPAR2,TRPAR3,TRPAR4,TRPAR5,TRPAR6,KMOFLG(8),KPAD2,       00000620
     3 KBAUDR,KGNFLG,KGRAFL,KHOMEY,KKMODE,KHORSZ,KVERSZ,KTBLSZ,         00000630
     4 KSIZEF,KLMRGN,KRMRGN,KFACTR,KTERM,KLINE,KZAXIS,KBEAMX,KBEAMY,    00000640
     5 KMOVEF,KPCHAR(5),KDASHT,KMINSX,KMINSY,KMAXSX,KMAXSY,KEYCON,      00000650
     6 KINLFT,KOTLFT,KUNIT                                              00000660
      MINX=KMINSX                                                       00000670
      MAXX=KMAXSX                                                       00000680
      MINY=KMINSY                                                       00000690
      MAXY=KMAXSY                                                       00000700
      RETURN                                                            00000710
      END                                                               00000720
C                                                                       00000730

C----------SUBROUTINE--SEEDW-------------------------TEKTRONIX, INC.----00000740
C                                                                       00000750
      SUBROUTINE SEEDW(XMIN,XMAX,YMIN,YMAX)                             00000760
      COMMON /TKTRNX/ TMINVX,TMINVY,TMAXVX,TMAXVY,TREALX,TREALY,        00000770
     1 TIMAGX,TIMAGY,TRCOSF,TRSINF,TRSCAL,TRFACX,TRFACY,                00000780
     2 TRPAR1,TRPAR2,TRPAR3,TRPAR4,TRPAR5,TRPAR6,KMOFLG(8),KPAD2,       00000790
     3 KBAUDR,KGNFLG,KGRAFL,KHOMEY,KKMODE,KHORSZ,KVERSZ,KTBLSZ,         00000800
     4 KSIZEF,KLMRGN,KRMRGN,KFACTR,KTERM,KLINE,KZAXIS,KBEAMX,KBEAMY,    00000810
     5 KMOVEF,KPCHAR(5),KDASHT,KMINSX,KMINSY,KMAXSX,KMAXSY,KEYCON,      00000820
     6 KINLFT,KOTLFT,KUNIT                                              00000830
      XMIN=TMINVX                                                       00000840
      XMAX=TMAXVX                                                       00000850
      YMIN=TMINVY                                                       00000860
      YMAX=TMAXVY                                                       00000870
      RETURN                                                            00000880
      END                                                               00000890
C                                                                       00000900

C----------SUBROUTINE--SEEMOD------------------------TEKTRONIX, INC.----00000910
C                                                                       00000920
      SUBROUTINE SEEMOD(LINE,IZAXIS,MODE)                               00000930
      COMMON /TKTRNX/ TMINVX,TMINVY,TMAXVX,TMAXVY,TREALX,TREALY,        00000940
     1 TIMAGX,TIMAGY,TRCOSF,TRSINF,TRSCAL,TRFACX,TRFACY,                00000950
     2 TRPAR1,TRPAR2,TRPAR3,TRPAR4,TRPAR5,TRPAR6,KMOFLG(8),KPAD2,       00000960
     3 KBAUDR,KGNFLG,KGRAFL,KHOMEY,KKMODE,KHORSZ,KVERSZ,KTBLSZ,         00000970
     4 KSIZEF,KLMRGN,KRMRGN,KFACTR,KTERM,KLINE,KZAXIS,KBEAMX,KBEAMY,    00000980
     5 KMOVEF,KPCHAR(5),KDASHT,KMINSX,KMINSY,KMAXSX,KMAXSY,KEYCON,      00000990
     6 KINLFT,KOTLFT,KUNIT                                              00001000
      LINE=KLINE                                                        00001010
      IZAXIS=KZAXIS                                                     00001020
      MODE=KKMODE                                                       00001030
      RETURN                                                            00001040
      END                                                               00001050
C                                                                       00001060

C----------SUBROUTINE--SEETRN------------------------TEKTRONIX, INC.----00001070
C                                                                       00001080
      SUBROUTINE SEETRN(XFAC,YFAC,KEY)                                  00001090
      COMMON /TKTRNX/ TMINVX,TMINVY,TMAXVX,TMAXVY,TREALX,TREA Y,        00001100
     1 TIMAGX,TIMAGY,TRCOSF,TRSINF,TRSCAL,TRFACX,TRFACY,                00001110
     2 TRPAR1,TRPAR2,TRPAR3,TRPAR4,TRPAR5,TRPAR6,KMOFLG(8),KPAD2,       00001120
     3 KBAUDR,KGNFLG,KGRAFL,KHOMEY,KKMODE,KHORSZ,KVERSZ,KTBLSZ,         00001130
     4 KSIZEF,KLMRGN,KRMRGN,KFACTR,KTERM,KLINE,KZAXIS,KBEAMX,KBEAMY,    00001140
     5 KMOVEF,KPCHAR(5),KDASHT,KMINSX,KMINSY,KMAXSX,KMAXSY,KEYCON,      00001150
     6 KINLFT,KOTLFT,KUNIT                                              00001160
      XFAC=TRFACX                                                       00001170
      YFAC=TRFACY                                                       00001180

      KEY=KEYCON                                                        00001190
      RETURN                                                            00001200
      END                                                               00001210
C                                                                       00001220

C----------SUBROUTINE--SEEREL------------------------TEKTRONIX, INC.----00001230
C                                                                       00001240
      SUBROUTINE SEEREL(RCOS,RSIN,SCALE)                                00001250
      COMMON /TKTRNX/ TMINVX,TMINVY,TMAXVX,TMAXVY,TREALX,TREALY,        00001260
     1 TIMAGX,TIMAGY,TRCOSF,TRSINF,TRSCAL,TRFACX,TRFACY,                00001270
     2 TRPAR1,TRPAR2,TRPAR3,TRPAR4,TRPAR5,TRPAR6,KMOFLG(8),KPAD2,       00001280
     3 KBAUDR,KGNFLG,KGRAFL,KHOMEY,KKMODE,KHORSZ,KVERSZ,KTBLSZ,         00001290
     4 KSIZEF,KLMRGN,KRMRGN,KFACTR,KTERM,KLINE,KZAXIS,KBEAMX,KBEAMY,    00001300
     5 KMOVEF,KPCHAR(5),KDASHT,KMINSX,KMINSY,KMAXSX,KMAXSY,KEYCON,      00001310
     6 KINLFT,KOTLFT,KUNIT                                              00001320
      RCOS=TRCOSF                                                       00001330
      RSIN=TRSINF                                                       00001340
      SCALE=TRSCAL                                                      00001350
      RETURN                                                            00001360
      END                                                               00001370
C                                                                       00001380

C----------SUBROUTINE--TTBLSZ------------------------TEKTRONIX, INC.----00001390
C                                                                       00001400
      SUBROUTINE TTBLSZ(ITBLSZ)                                         00001410
      COMMON /TKTRNX/ TMINVX,TMINVY,TMAXVX,TMAXVY,TREALX,TREALY,        00001420
     1 TIMAGX,TIMAGY,TRCOSF,TRSINF,TRSCAL,TRFACX,TRFACY,                00001430
     2 TRPAR1,TRPAR2,TRPAR3,TRPAR4,TRPAR5,TRPAR6,KMOFLG(8),KPAD2,       00001440
     3 KBAUDR,KGNFLG,KGRAFL,KHOMEY,KKMODE,KHORSZ,KVERSZ,KTBLSZ,         00001450
     4 KSIZEF,KLMRGN,KRMRGN,KFACTR,KTERM,KLINE,KZAXIS,KBEAMX,KBEAMY,    00001460
     5 KMOVEF,KPCHAR(5),KDASHT,KMINSX,KMINSY,KMAXSX,KMAXSY,KEYCON,      00001470
     6 KINLFT,KOTLFT,KUNIT                                              00001480
      KTBLSZ=ITBLSZ                                                     00001490
      RETURN                                                            00001500
      END                                                               00001510
C                                                                       00001520

C----------SUBROUTINE--TERM--------------------------TEKTRONIX, INC.----00001530
C                                                                       00001540
      SUBROUTINE TERM(ITERM,ISCAL)                                      00001550
      COMMON /TKTRNX/ TMINVX,TMINVY,TMAXVX,TMAXVY,TREALX,TREALY,        00001560
     1 TIMAGX,TIMAGY,TRCOSF,TRSINF,TRSCAL,TRFACX,TRFACY,                00001570
     2 TRPAR1,TRPAR2,TRPAR3,TRPAR4,TRPAR5,TRPAR6,KMOFLG(8),KPAD2,       00001580
     3 KBAUDR,KGNFLG,KGRAFL,KHOMEY,KKMODE,KHORSZ,KVERSZ,KTBLSZ,         00001590
     4 KSIZEF,KLMRGN,KRMRGN,KFACTR,KTERM,KLINE,KZAXIS,KBEAMX,KBEAMY,    00001600
     5 KMOVEF,KPCHAR(5),KDASHT,KMINSX,KMINSY,KMAXSX,KMAXSY,KEYCON,      00001610
     6 KINLFT,KOTLFT,KUNIT                                              00001620
      KTERM=ITERM                                                       00001630
      KFACTR=4                                                          00001640
      IF(ISCAL .GT. 1025)KFACTR=1                                       00001650
      CALL RESET                                                        00001660
      RETURN                                                            00001670
      END                                                               00001680
C                                                                       00001690

C----------SUBROUTINE--DASHSR------------------------TEKTRONIX, INC.----00001700
C                                                                       00001710
      SUBROUTINE DASHSR(X,Y,L)                                          00001720
      CALL REL2AB(X,Y,RX,RY)                                            00001730
      CALL DASHSA(RX,RY,L)                                              00001740
      RETURN                                                            00001750
      END                                                               00001760

C----------SUBROUTINE--DASHSA------------------------TEKTRONIX, INC.----00001780
C                                                                       00001790
      SUBROUTINE DASHSA(X,Y,L)                                          00001800
      COMMON /TKTRNX/ TMINVX,TMINVY,TMAXVX,TMAXVY,TREALX,TREALY,        00001810
     1 TIMAGX,TIMAGY,TRCOSF,TRSINF,TRSCAL,TRFACX,TRFACY,                00001820
     2 TRPAR1,TRPAR2,TRPAR3,TRPAR4,TRPAR5,TRPAR6,KMOFLG(8),KPAD2,       00001830
     3 KBAUDR,KGNFLG,KGRAFL,KHOMEY,KKMODE,KHORSZ,KVERSZ,KTBLSZ,         00001840
     4 KSIZEF,KLMRGN,KRMRGN,KFACTR,KTERM,KLINE,KZAXIS,KBEAMX,KBEAMY,    00001850
     5 KMOVEF,KPCHAR(5),KDASHT,KMINSX,KMINSY,KMAXSX,KMAXSY,KEYCON,      00001860
     6 KINLFT,KOTLFT,KUNIT                                              00001870
      CALL LVLCHT                                                       00001880
      XOLD=TIMAGX                                                       00001890
      YOLD=TIMAGY                                                       00001900
      KEY=KEYCON                                                        00001910
      IF(KEYCON .LT. 1)KEY=5                                            00001920
      IF(KEYCON .GT. 4)KEY=4                                            00001930
C * LINEAR LOG POLAR USER ERROR                                         00001940
      GO TO (100, 100, 200, 400, 100),KEY                               00001950
C * ERROR LINEAR LOG                                                    00001960
100   CALL DASHA(X,Y,L)                                                 00001970
      XOLD=X                                                            00001980
      YOLD=Y                                                            00001990
      RETURN                                                            00002000
C * POLAR                                                               00002010
200   DX=X-XOLD                                                         00002020
      DY=Y-YOLD                                                         00002030
      YSTEP=SIGN(5.0/TRFACY,DY)                                         00002040
      IF(ABS(DY*.75) .LT. ABS(YSTEP)) GO TO 100                         00002050
      FRAC=DX/DY                                                        00002060
      NSEG=(DY/YSTEP)+.9999                                             00002070
      YOUT=YOLD                                                         00002080
300   IF(NSEG .LT. 2) GO TO 100                                         00002090
      YOUT=YOUT+YSTEP                                                   00002100
      XOUT=XOLD+(YOUT-YOLD)*FRAC                                        00002110
      CALL DASHA(XOUT,YOUT,L)                                           00002120
      NSEG=NSEG-1                                                       00002130
      GO TO 300                                                         00002140
C * USER SEGMENTATION                                                   00002150
400   CONTINUE                                                          00002160
C      CALL USDASH(X,Y,L)                                               00002170
      GO TO 100                                                         00002180
      END                                                               00002190
C                                                                       00002200

C----------SUBROUTINE--DRAWSR------------------------TEKTRONIX, INC.----00002210
C                                                                       00002220
      SUBROUTINE DRAWSR(X,Y)                                            00002230
      CALL REL2AB(X,Y,RX,RY)                                            00002240
      CALL DRAWSA(RX,RY)                                                00002250
      RETURN                                                            00002260
      END                                                               00002270
C                                                                       00002280

C----------SUBROUTINE--DRAWSA------------------------TEKTRONIX, INC.----00002290
C                                                                       00002300
      SUBROUTINE DRAWSA(X,Y)                                            00002310
      COMMON /TKTRNX/ TMINVX,TMINVY,TMAXVX,TMAXVY,TREALX,TREALY,        00002320
     1 TIMAGX,TIMAGY,TRCOSF,TRSINF,TRSCAL,TRFACX,TRFACY,                00002330
     2 TRPAR1,TRPAR2,TRPAR3,TRPAR4,TRPAR5,TRPAR6,KMOFLG(8),KPAD2,       00002340
     3 KBAUDR,KGNFLG,KGRAFL,KHOMEY,KKMODE,KHORSZ,KVERSZ,KTBLSZ,         00002350
     4 KSIZEF,KLMRGN,KRMRGN,KFACTR,KTERM,KLINE,KZAXIS,KBEAMX,KBEAMY,    00002360
     5 KMOVEF,KPCHAR(5),KDASHT,KMINSX,KMINSY,KMAXSX,KMAXSY,KEYCON,      00002370
     6 KINLFT,KOTLFT,KUNIT                                              00002380
      CALL LVLCHT                                                       00002390
      XOLD=TIMAGX                                                       00002400
      YOLD=TIMAGY                                                       00002410
      KEY=KEYCON                                                        00002420
      IF(KEYCON .LT. 1)KEY=5                                            00002430
      IF(KEYCON .GT. 4)KEY=4                                            00002440
C * LINEAR LOG POLAR USER ERROR                                         00002450
      GO TO (100, 100, 200, 400, 100),KEY                               00002460
C * ERROR LINEAR LOG                                                    00002470
100   CALL DRAWA(X,Y)                                                   00002480
      XOLD=X                                                            00002490
      YOLD=Y                                                            00002500
      RETURN                                                            00002510
C * POLAR                                                               00002520
200   DX=X-XOLD                                                         00002530
      DY=Y-YOLD                                                         00002540
      YSTEP=SIGN(5.0/TRFACY,DY)                                         00002550
      IF(ABS(DY*.75) .LT. ABS(YSTEP)) GO TO 100                         00002560
      FRAC=DX/DY                                                        00002570
      NSEG=(DY/YSTEP)+.9999                                             00002580
      YOUT=YOLD                                                         00002590
300   IF(NSEG .LT. 2) GO TO 100                                         00002600
      YOUT=YOUT+YSTEP                                                   00002610
      XOUT=XOLD+(YOUT-YOLD)*FRAC                                        00002620
      CALL DRAWA(XOUT,YOUT)                                             00002630
      NSEG=NSEG-1                                                       00002640
      GO TO 300                                                         00002650
C * USER SEGMENTATION                                                   00002660
400   CONTINUE                                                          00002670
C      CALL USDRAW(X,Y)                                                 00002680
      GO TO 100                                                         00002690
      END                                                               00002700
C                                                                       00002710

C----------SUBROUTINE--INCPLT------------------------TEKTRONIX, INC.----00002720
C                                                                       00002730
      SUBROUTINE INCPLT(IONOFF,IDIR,NO)                                 00002740
      DIMENSION IPLTBL(8),KBMUP(10)                                     00002750
      COMMON /TKTRNX/ TMINVX,TMINVY,TMAXVX,TMAXVY,TREALX,TREALY,        00002760
     1 TIMAGX,TIMAGY,TRCOSF,TRSINF,TRSCAL,TRFACX,TRFACY,                00002770
     2 TRPAR1,TRPAR2,TRPAR3,TRPAR4,TRPAR5,TRPAR6,KMOFLG(8),KPAD2,       00002780
     3 KBAUDR,KGNFLG,KGRAFL,KHOMEY,KKMODE,KHORSZ,KVERSZ,KTBLSZ,         00002790
     4 KSIZEF,KLMRGN,KRMRGN,KFACTR,KTERM,KLINE,KZAXIS,KBEAMX,KBEAMY,    00002800
     5 KMOVEF,KPCHAR(5),KDASHT,KMINSX,KMINSY,KMAXSX,KMAXSY,KEYCON,      00002810
     6 KINLFT,KOTLFT,KUNIT                                              00002820
      DATA IPLTBL(1),IPLTBL(2),IPLTBL(3),IPLTBL(4)/4,5,1,9/             00002830
      DATA IPLTBL(5),IPLTBL(6),IPLTBL(7),IPLTBL(8)/8,10,2,6/            00002840
      DATA KBMUP(1),KBMUP(2),KBMUP(3),KBMUP(4),KBMUP(5)/0,1,1,1,0/      00002850
      DATA KBMUP(6),KBMUP(7),KBMUP(8),KBMUP(9),KBMUP(10)/-1,-1,-1,0,1/  00002860
      IF(KKMODE .NE. 3)CALL IPMOD                                       00002870
      IPEN=32+IONOFF*48                                                 00002880
C * THIS SECTION TO ACCOMMODATE PLOTTERS REQUIRING A SEPARATE PEN       00002890
C * CHARACTER -- IT MAY BE OMITTED IF NOT NEEDED ***********************00002900
      CALL TOUTPT(IPEN)                                                 00002910
      IPEN=64                                                           00002920
C **********************************************************************00002930
      KMOVEF=IABS(IONOFF-1)                                             00002940
      NDXPLT=MOD(IDIR,8)+1                                              00002950
      IPLTCH=IPLTBL(NDXPLT)+IPEN                                        00002960
      KBMUPX=KBMUP(NDXPLT)                                              00002970
      KBMUPY=KBMUP(NDXPLT+2)                                            00002980
      DO 10 I=1,NO                                                      00002990
      CALL TOUTPT(IPLTCH)                                               00003000
      KBEAMX=KBEAMX+KBMUPX                                              00003010
10    KBEAMY=KBEAMY+KBMUPY                                              00003020
      RETURN                                                            00003030
      END                                                               00003040
C                                                                       00003050

C----------SUBROUTINE--RROTAT------------------------TEKTRONIX, INC.----00003060
C                                                                       00003070
      SUBROUTINE RROTAT(DEG)                                            00003080
      COMMON /TKTRNX/ TMINVX,TMINVY,TMAXVX,TMAXVY,TREALX,TREALY,        00003090
     1 TIMAGX,TIMAGY,TRCOSF,TRSINF,TRSCAL,TRFACX,TRFACY,                00003100
     2 TRPAR1,TRPAR2,TRPAR3,TRPAR4,TRPAR5,TRPAR6,KMOFLG(8),KPAD2,       00003110
     3 KBAUDR,KGNFLG,KGRAFL,KHOMEY,KKMODE,KHORSZ,KVERSZ,KTBLSZ,         00003120
     4 KSIZEF,KLMRGN,KRMRGN,KFACTR,KTERM,KLINE,KZAXIS,KBEAMX,KBEAMY,    00003130
     5 KMOVEF,KPCHAR(5),KDASHT,KMINSX,KMINSY,KMAXSX,KMAXSY,KEYCON,      00003140
     6 KINLFT,KOTLFT,KUNIT                                              00003150
      TRSINF=SIN(DEG/57.29578)                                          00003160
      TRCOSF=COS(DEG/57.29578)                                          00003170
      RETURN                                                            00003180
      END                                                               00003190
C                                                                       00003200

C----------SUBROUTINE--RSCALE------------------------TEKTRONIX, INC.----00003210
C                                                                       00003220
      SUBROUTINE RSCALE(FACTOR)                                         00003230
      COMMON /TKTRNX/ TMINVX,TMINVY,TMAXVX,TMAXVY,TREALX,TREALY,        00003240
     1 TIMAGX,TIMAGY,TRCOSF,TRSINF,TRSCAL,TRFACX,TRFACY,                00003250
     2 TRPAR1,TRPAR2,TRPAR3,TRPAR4,TRPAR5,TRPAR6,KMOFLG(8),KPAD2,       00003260
     3 KBAUDR,KGNFLG,KGRAFL,KHOMEY,KKMODE,KHORSZ,KVERSZ,KTBLSZ,         00003270
     4 KSIZEF,KLMRGN,KRMRGN,KFACTR,KTERM,KLINE,KZAXIS,KBEAMX,KBEAMY,    00003280
     5 KMOVEF,KPCHAR(5),KDASHT,KMINSX,KMINSY,KMAXSX,KMAXSY,KEYCON,      00003290
     6 KINLFT,KOTLFT,KUNIT                                              00003300
      TRSCAL=FACTOR                                                     00003310
      RETURN                                                            00003320
      END                                                               00003330
C                                                                       00003340

C----------SUBROUTINE--FINITT------------------------TEKTRONIX, INC.----00003350
C                                                                       00003360
      SUBROUTINE FINITT(IX,IY)                                          00003370
      CALL MOVABS(IX,IY)                                                00003380
      CALL ALFMOD                                                       00003390
      CALL TSEND                                                        00003400
      STOP                                                              00003410
      END                                                               00003420
C                                                                       00003430

C----------SUBROUTINE--BELL--------------------------TEKTRONIX, INC.----00003440
C                                                                       00003450
      SUBROUTINE BELL                                                   00003460
      COMMON /TKTRNX/ TMINVX,TMINVY,TMAXVX,TMAXVY,TREALX,TREALY,        00003470
     1 TIMAGX,TIMAGY,TRCOSF,TRSINF,TRSCAL,TRFACX,TRFACY,                00003480
     2 TRPAR1,TRPAR2,TRPAR3,TRPAR4,TRPAR5,TRPAR6,KMOFLG(8),KPAD2,       00003490
     3 KBAUDR,KGNFLG,KGRAFL,KHOMEY,KKMODE,KHORSZ,KVERSZ,KTBLSZ,         00003500
     4 KSIZEF,KLMRGN,KRMRGN,KFACTR,KTERM,KLINE,KZAXIS,KBEAMX,KBEAMY,    00003510
     5 KMOVEF,KPCHAR(5),KDASHT,KMINSX,KMINSY,KMAXSX,KMAXSY,KEYCON,      00003520
     6 KINLFT,KOTLFT,KUNIT                                              00003530
C *  OUTPUT (BEL)                                                       00003540
      CALL TOUTPT(7)                                                    00003550
C * BELL NULLIFIES MOVE AT TERMINAL                                     00003560
      KMOVEF=0                                                          00003570
      RETURN                                                            00003580
      END                                                               00003590
C                                                                       00003600

C----------SUBROUTINE--VWINDO------------------------TEKTRONIX, INC.----00003610
C                                                                       00003620
      SUBROUTINE VWINDO(XMIN,XRANGE,YMIN,YRANGE)                        00003630
      COMMON /TKTRNX/ TMINVX,TMINVY,TMAXVX,TMAXVY,TREALX,TREALY,        00003640
     1 TIMAGX,TIMAGY,TRCOSF,TRSINF,TRSCAL,TRFACX,TRFACY,                00003650
     2 TRPAR1,TRPAR2,TRPAR3,TRPAR4,TRPAR5,TRPAR6,KMOFLG(8),KPAD2,       00003660
     3 KBAUDR,KGNFLG,KGRAFL,KHOMEY,KKMODE,KHORSZ,KVERSZ,KTBLSZ,         00003670
     4 KSIZEF,KLMRGN,KRMRGN,KFACTR,KTERM,KLINE,KZAXIS,KBEAMX,KBEAMY,    00003680
     5 KMOVEF,KPCHAR(5),KDASHT,KMINSX,KMINSY,KMAXSX,KMAXSY,KEYCON,      00003690
     6 KINLFT,KOTLFT,KUNIT                                              00003700
C * DEFINE VIRTUAL WINDOW IN TERMINAL COMMON AREA                       00003710
      TMINVX=XMIN                                                       00003720
      TMAXVX=XMIN+XRANGE                                                00003730
      TMINVY=YMIN                                                       00003740
      TMAXVY=YMIN+YRANGE                                                00003750
      CALL RESCAL                                                       00003760
      RETURN                                                            00003770
      END                                                               00003780
C                                                                       00003790

C----------SUBROUTINE--SWINDO------------------------TEKTRONIX, INC.----00003800
C                                                                       00003810
      SUBROUTINE SWINDO(MINX,LENX,MINY,LENY)                            00003820
      COMMON /TKTRNX/ TMINVX,TMINVY,TMAXVX,TMAXVY,TREALX,TREALY,        00003830
     1 TIMAGX,TIMAGY,TRCOSF,TRSINF,TRSCAL,TRFACX,TRFACY,                00003840
     2 TRPAR1,TRPAR2,TRPAR3,TRPAR4,TRPAR5,TRPAR6,KMOFLG(8),KPAD2,       00003850
     3 KBAUDR,KGNFLG,KGRAFL,KHOMEY,KKMODE,KHORSZ,KVERSZ,KTBLSZ,         00003860
     4 KSIZEF,KLMRGN,KRMRGN,KFACTR,KTERM,KLINE,KZAXIS,KBEAMX,KBEAMY,    00003870
     5 KMOVEF,KPCHAR(5),KDASHT,KMINSX,KMINSY,KMAXSX,KMAXSY,KEYCON,      00003880
     6 KINLFT,KOTLFT,KUNIT                                              00003890
C * DEFINE SCREEN WINDOW IN TERMINAL COMMON AREA                        00003900
      KMINSX=MINX                                                       00003910
      KMAXSX=MINX+LENX                                                  00003920
      KMINSY=MINY                                                       00003930
      KMAXSY=MINY+LENY                                                  00003940
      CALL RESCAL                                                       00003950
      RETURN                                                            00003960
      END                                                               00003970
C                                                                       00003980

C----------SUBROUTINE--TWINDO------------------------TEKTRONIX, INC.----00003990
C                                                                       00004000
      SUBROUTINE TWINDO(MINX,MAXX,MINY,MAXY)                            00004010
      COMMON /TKTRNX/ TMINVX,TMINVY,TMAXVX,TMAXVY,TREALX,TREALY,        00004020
     1 TIMAGX,TIMAGY,TRCOSF,TRSINF,TRSCAL,TRFACX,TRFACY,                00004030
     2 TRPAR1,TRPAR2,TRPAR3,TRPAR4,TRPAR5,TRPAR6,KMOFLG(8),KPAD2,       00004040
     3 KBAUDR,KGNFLG,KGRAFL,KHOMEY,KKMODE,KHORSZ,KVERSZ,KTBLSZ,         00004050
     4 KSIZEF,KLMRGN,KRMRGN,KFACTR,KTERM,KLINE,KZAXIS,KBEAMX,KBEAMY,    00004060
     5 KMOVEF,KPCHAR(5),KDASHT,KMINSX,KMINSY,KMAXSX,KMAXSY,KEYCON,      00004070
     6 KINLFT,KOTLFT,KUNIT                                              00004080
C * DEFINE TERMINAL WINDOW IN TERMINAL COMMON AREA                      00004090
      KMINSX=MINX                                                       00004100
      KMAXSX=MAXX                                                       00004110
      KMINSY=MINY                                                       00004120
      KMAXSY=MAXY                                                       00004130
      CALL RESCAL                                                       00004140
      RETURN                                                            00004150
      END                                                               00004160
C                                                                       00004170

C----------SUBROUTINE--DWINDO------------------------TEKTRONIX, INC.----00004180
C                                                                       00004190
      SUBROUTINE DWINDO(XMIN,XMAX,YMIN,YMAX)                            00004200
      COMMON /TKTRNX/ TMINVX,TMINVY,TMAXVX,TMAXVY,TREALX,TREALY,        00004210
     1 TIMAGX,TIMAGY,TRCOSF,TRSINF,TRSCAL,TRFACX,TRFACY,                00004220
     2 TRPAR1,TRPAR2,TRPAR3,TRPAR4,TRPAR5,TRPAR6,KMOFLG(8),KPAD2,       00004230
     3 KBAUDR,KGNFLG,KGRAFL,KHOMEY,KKMODE,KHORSZ,KVERSZ,KTBLSZ,         00004240
     4 KSIZEF,KLMRGN,KRMRGN,KFACTR,KTERM,KLINE,KZAXIS,KBEAMX,KBEAMY,    00004250
     5 KMOVEF,KPCHAR(5),KDASHT,KMINSX,KMINSY,KMAXSX,KMAXSY,KEYCON,      00004260
     6 KINLFT,KOTLFT,KUNIT                                              00004270
C * DEFINE DATA WINDOW IN TERMINAL COMMON AREA                          00004280
      TMINVX=XMIN                                                       00004290
      TMAXVX=XMAX                                                       00004300
      TMINVY=YMIN                                                       00004310
      TMAXVY=YMAX                                                       00004320
      CALL RESCAL                                                       00004330
      RETURN                                                            00004340
      END                                                               00004350
C                                                                       00004360

C----------SUBROUTINE--POINTR------------------------TEKTRONIX, INC.----00004370
C                                                                       00004380
      SUBROUTINE POINTR(X,Y)                                            00004390
      CALL REL2AB(X,Y,RX,RY)                                            00004400
      CALL POINTA(RX,RY)                                                00004410
      RETURN                                                            00004420
      END                                                               00004430
C                                                                       00004440

C----------SUBROUTINE--DASHR-------------------------TEKTRONIX, INC.----00004450
C                                                                       00004460
      SUBROUTINE DASHR(X,Y,L)                                           00004470
      CALL REL2AB(X,Y,XL,YL)                                            00004480
      CALL DASHA(XL,YL,L)                                               00004490
      RETURN                                                            00004500
      END                                                               00004510
C                                                                       00004520

C----------SUBROUTINE--DASHA-------------------------TEKTRONIX, INC.----00004530
C                                                                       00004540
      SUBROUTINE DASHA(X,Y,L)                                           00004550
      COMMON /TKTRNX/ TMINVX,TMINVY,TMAXVX,TMAXVY,TREALX,TREALY,        00004560
     1 TIMAGX,TIMAGY,TRCOSF,TRSINF,TRSCAL,TRFACX,TRFACY,                00004570
     2 TRPAR1,TRPAR2,TRPAR3,TRPAR4,TRPAR5,TRPAR6,KMOFLG(8),KPAD2,       00004580
     3 KBAUDR,KGNFLG,KGRAFL,KHOMEY,KKMODE,KHORSZ,KVERSZ,KTBLSZ,         00004590
     4 KSIZEF,KLMRGN,KRMRGN,KFACTR,KTERM,KLINE,KZAXIS,KBEAMX,KBEAMY,    00004600
     5 KMOVEF,KPCHAR(5),KDASHT,KMINSX,KMINSY,KMAXSX,KMAXSY,KEYCON,      00004610
     6 KINLFT,KOTLFT,KUNIT                                              00004620
      CALL LVLCHT                                                       00004630
C * CONVERT TO SCREEN CO-ORDINATES                                      00004640
      CALL V2ST(1,X,Y,IX,IY)                                            00004650
C * SKIP IF LINE COMPLETELY OUTSIDE WINDOW                              00004660
      IF(KGNFLG .EQ. 1)GO TO 10                                         00004670
      CALL DSHMOD(L)                                                    00004680
      CALL TKDASH(IX,IY)                                                00004690
10    RETURN                                                            00004700
      END                                                               00004710

C----------SUBROUTINE--DSHREL------------------------TEKTRONIX, INC.----00004730
C                                                                       00004740
      SUBROUTINE DSHREL(IX,IY,L)                                        00004750
      COMMON /TKTRNX/ TMINVX,TMINVY,TMAXVX,TMAXVY,TREALX,TREALY,        00004760
     1 TIMAGX,TIMAGY,TRCOSF,TRSINF,TRSCAL,TRFACX,TRFACY,                00004770
     2 TRPAR1,TRPAR2,TRPAR3,TRPAR4,TRPAR5,TRPAR6,KMOFLG(8),KPAD2,       00004780
     3 KBAUDR,KGNFLG,KGRAFL,KHOMEY,KKMODE,KHORSZ,KVERSZ,KTBLSZ,         00004790
     4 KSIZEF,KLMRGN,KRMRGN,KFACTR,KTERM,KLINE,KZAXIS,KBEAMX,KBEAMY,    00004800
     5 KMOVEF,KPCHAR(5),KDASHT,KMINSX,KMINSY,KMAXSX,KMAXSY,KEYCON,      00004810
     6 KINLFT,KOTLFT,KUNIT                                              00004820
      JX=IX+KBEAMX                                                      00004830
      JY=IY+KBEAMY                                                      00004840
      CALL DSHABS(JX,JY,L)                                              00004850
      RETURN                                                            00004860
      END                                                               00004870
C                                                                       00004880

C----------SUBROUTINE--DSHABS------------------------TEKTRONIX, INC.----00004890
C                                                                       00004900
      SUBROUTINE DSHABS(IX,IY,L)                                        00004910
      COMMON /TKTRNX/ TMINVX,TMINVY,TMAXVX,TMAXVY,TREALX,TREALY,        00004920
     1 TIMAGX,TIMAGY,TRCOSF,TRSINF,TRSCAL,TRFACX,TRFACY,                00004930
     2 TRPAR1,TRPAR2,TRPAR3,TRPAR4,TRPAR5,TRPAR6,KMOFLG(8),KPAD2,       00004940
     3 KBAUDR,KGNFLG,KGRAFL,KHOMEY,KKMODE,KHORSZ,KVERSZ,KTBLSZ,         00004950
     4 KSIZEF,KLMRGN,KRMRGN,KFACTR,KTERM,KLINE,KZAXIS,KBEAMX,KBEAMY,    00004960
     5 KMOVEF,KPCHAR(5),KDASHT,KMINSX,KMINSY,KMAXSX,KMAXSY,KEYCON,      00004970
     6 KINLFT,KOTLFT,KUNIT                                              00004980
      CALL DSHMOD(L)                                                    00004990
      CALL TKDASH(IX,IY)                                                00005000
C * SET THE GRAPHIC LEVEL FLAG TO SCREEN
	KGRAFL=0
      RETURN                                                            00005010
      END                                                               00005020
C                                                                       00005030

C----------SUBROUTINE--DRAWR-------------------------TEKTRONIX, INC.----00005040
C                                                                       00005050
      SUBROUTINE DRAWR(X,Y)                                             00005060
      CALL REL2AB(X,Y,RX,RY)                                            00005070
      CALL DRAWA(RX,RY)                                                 00005080
      RETURN                                                            00005090
      END                                                               00005100
C                                                                       00005110

C----------SUBROUTINE--POINTA------------------------TEKTRONIX, INC.----00005120
C                                                                       00005130
      SUBROUTINE POINTA(X,Y)                                            00005140
      COMMON /TKTRNX/ TMINVX,TMINVY,TMAXVX,TMAXVY,TREALX,TREALY,        00005150
     1 TIMAGX,TIMAGY,TRCOSF,TRSINF,TRSCAL,TRFACX,TRFACY,                00005160
     2 TRPAR1,TRPAR2,TRPAR3,TRPAR4,TRPAR5,TRPAR6,KMOFLG(8),KPAD2,       00005170
     3 KBAUDR,KGNFLG,KGRAFL,KHOMEY,KKMODE,KHORSZ,KVERSZ,KTBLSZ,         00005180
     4 KSIZEF,KLMRGN,KRMRGN,KFACTR,KTERM,KLINE,KZAXIS,KBEAMX,KBEAMY,    00005190
     5 KMOVEF,KPCHAR(5),KDASHT,KMINSX,KMINSY,KMAXSX,KMAXSY,KEYCON,      00005200
     6 KINLFT,KOTLFT,KUNIT                                              00005210
      CALL LVLCHT                                                       00005220
C * CONVERT TO SCREEN CO-ORDINATES                                      00005230
      CALL V2ST(0,X,Y,IX,IY)                                            00005240
C * SKIP IF LINE COMPLETELY OUTSIDE WINDOW                              00005250
      IF(KGNFLG .EQ. 1)GO TO 10                                         00005260
      IF(KKMODE .NE. 2)CALL PNTMOD                                      00005270
      CALL TKPNT(IX,IY)                                                 00005280
10    RETURN                                                            00005290
      END                                                               00005300

C----------SUBROUTINE--DRAWA-------------------------TEKTRONIX, INC.----00005320
C                                                                       00005330
      SUBROUTINE DRAWA(X,Y)                                             00005340
      COMMON /TKTRNX/ TMINVX,TMINVY,TMAXVX,TMAXVY,TREALX,TREALY,        00005350
     1 TIMAGX,TIMAGY,TRCOSF,TRSINF,TRSCAL,TRFACX,TRFACY,                00005360
     2 TRPAR1,TRPAR2,TRPAR3,TRPAR4,TRPAR5,TRPAR6,KMOFLG(8),KPAD2,       00005370
     3 KBAUDR,KGNFLG,KGRAFL,KHOMEY,KKMODE,KHORSZ,KVERSZ,KTBLSZ,         00005380
     4 KSIZEF,KLMRGN,KRMRGN,KFACTR,KTERM,KLINE,KZAXIS,KBEAMX,KBEAMY,    00005390
     5 KMOVEF,KPCHAR(5),KDASHT,KMINSX,KMINSY,KMAXSX,KMAXSY,KEYCON,      00005400
     6 KINLFT,KOTLFT,KUNIT                                              00005410
C * SET TERMINAL TO DRAW SOLID LINES IF NEEDED                          00005420
C * THIS SECTION IS NEEDED FOR 4014 ENHANCED ***************************00005430
      IF(KLINE .EQ. 0)GO TO 5                                           00005440
      KLINE=0                                                           00005450
      CALL CWSEND                                                       00005460
5     CONTINUE                                                          00005470
C **********************************************************************00005480
      CALL LVLCHT                                                       00005490
C * CONVERT TO SCREEN CO-ORDINATES                                      00005500
      CALL V2ST(1,X,Y,IX,IY)                                            00005510
C * SKIP IF LINE COMPLETELY OUTSIDE WINDOW                              00005520
      IF(KGNFLG .EQ. 1)GO TO 10                                         00005530
      IF(KKMODE.NE.1)CALL VECMOD                                        00005540
      IF(KMOVEF.EQ.1)CALL XYCNVT(KBEAMX,KBEAMY)                         00005550
      CALL XYCNVT(IX,IY)                                                00005560
10    RETURN                                                            00005570
      END                                                               00005580
C                                                                       00005590

C----------SUBROUTINE--MOVER-------------------------TEKTRONIX, INC.----00005600
C                                                                       00005610
      SUBROUTINE MOVER(X,Y)                                             00005620
      CALL REL2AB(X,Y,RX,RY)                                            00005630
      CALL MOVEA(RX,RY)                                                 00005640
      RETURN                                                            00005650
      END                                                               00005660
C                                                                       00005670

C----------SUBROUTINE--REL2AB------------------------TEKTRONIX, INC.----00005680
C                                                                       00005690
      SUBROUTINE REL2AB(XIN,YIN,XOUT,YOUT)                              00005700
      COMMON /TKTRNX/ TMINVX,TMINVY,TMAXVX,TMAXVY,TREALX,TREALY,        00005710
     1 TIMAGX,TIMAGY,TRCOSF,TRSINF,TRSCAL,TRFACX,TRFACY,                00005720
     2 TRPAR1,TRPAR2,TRPAR3,TRPAR4,TRPAR5,TRPAR6,KMOFLG(8),KPAD2,       00005730
     3 KBAUDR,KGNFLG,KGRAFL,KHOMEY,KKMODE,KHORSZ,KVERSZ,KTBLSZ,         00005740
     4 KSIZEF,KLMRGN,KRMRGN,KFACTR,KTERM,KLINE,KZAXIS,KBEAMX,KBEAMY,    00005750
     5 KMOVEF,KPCHAR(5),KDASHT,KMINSX,KMINSY,KMAXSX,KMAXSY,KEYCON,      00005760
     6 KINLFT,KOTLFT,KUNIT                                              00005770
      CALL LVLCHT                                                       00005780
      XOUT=(((XIN*TRCOSF)-(YIN*TRSINF))*TRSCAL)+TIMAGX                  00005790
      YOUT=(((XIN*TRSINF)+(YIN*TRCOSF))*TRSCAL)+TIMAGY                  00005800
      RETURN                                                            00005810
      END                                                               00005820
C                                                                       00005830

C----------SUBROUTINE--MOVEA-------------------------TEKTRONIX, INC.----00005840
C                                                                       00005850
      SUBROUTINE MOVEA(X,Y)                                             00005860
      COMMON /TKTRNX/ TMINVX,TMINVY,TMAXVX,TMAXVY,TREALX,TREALY,        00005870
     1 TIMAGX,TIMAGY,TRCOSF,TRSINF,TRSCAL,TRFACX,TRFACY,                00005880
     2 TRPAR1,TRPAR2,TRPAR3,TRPAR4,TRPAR5,TRPAR6,KMOFLG(8),KPAD2,       00005890
     3 KBAUDR,KGNFLG,KGRAFL,KHOMEY,KKMODE,KHORSZ,KVERSZ,KTBLSZ,         00005900
     4 KSIZEF,KLMRGN,KRMRGN,KFACTR,KTERM,KLINE,KZAXIS,KBEAMX,KBEAMY,    00005910
     5 KMOVEF,KPCHAR(5),KDASHT,KMINSX,KMINSY,KMAXSX,KMAXSY,KEYCON,      00005920
     6 KINLFT,KOTLFT,KUNIT                                              00005930
      CALL LVLCHT                                                       00005940
C * CONVERT TO SCREEN CO-ORDINATES                                      00005950
      CALL V2ST(0,X,Y,IX,IY)                                            00005960
C * SKIP IF LINE COMPLETELY OUTSIDE WINDOW                              00005970
      IF(KGNFLG .EQ. 1)GO TO 10                                         00005980
      CALL VECMOD                                                       00005990
      CALL XYCNVT(IX,IY)                                                00006000
10    RETURN                                                            00006010
      END                                                               00006020
C                                                                       00006030

C----------SUBROUTINE--VCURSR------------------------TEKTRONIX, INC.----00006040
C                                                                       00006050
      SUBROUTINE VCURSR(ICHAR,X,Y)                                      00006060
      CALL SCURSR(ICHAR,IXA,IYA)                                        00006070
      CALL REVCOT(IXA,IYA,X,Y)                                          00006080
      RETURN                                                            00006090
      END                                                               00006100
C                                                                       00006110

C----------SUBROUTINE--V2ST--------------------------TEKTRONIX, INC.----00006120
C                                                                       00006130
      SUBROUTINE V2ST(I,X,Y,IX,IY)                                      00006140
      DIMENSION BUFIN(4),BFOUT(4)                                       00006150
      COMMON /TKTRNX/ TMINVX,TMINVY,TMAXVX,TMAXVY,TREALX,TREALY,        00006160
     1 TIMAGX,TIMAGY,TRCOSF,TRSINF,TRSCAL,TRFACX,TRFACY,                00006170
     2 TRPAR1,TRPAR2,TRPAR3,TRPAR4,TRPAR5,TRPAR6,KMOFLG(8),KPAD2,       00006180
     3 KBAUDR,KGNFLG,KGRAFL,KHOMEY,KKMODE,KHORSZ,KVERSZ,KTBLSZ,         00006190
     4 KSIZEF,KLMRGN,KRMRGN,KFACTR,KTERM,KLINE,KZAXIS,KBEAMX,KBEAMY,    00006200
     5 KMOVEF,KPCHAR(5),KDASHT,KMINSX,KMINSY,KMAXSX,KMAXSY,KEYCON,      00006210
     6 KINLFT,KOTLFT,KUNIT                                              00006220
      EQUIVALENCE (BUFIN(1),XS),(BUFIN(2),YS),(BUFIN(3),XE),            00006230
     1(BUFIN(4),YE)                                                     00006240
      EQUIVALENCE (BFOUT(1),CXS),(BFOUT(2),CYS),(BFOUT(3),CXE),         00006250
     1            (BFOUT(4),CYE)                                        00006260
      XE=X                                                              00006270
      YE=Y                                                              00006280
C * POINT OR MOVE                                                       00006290
      IF(I .EQ. 0) GO TO 10                                             00006300
C * BRIGHT VECTOR                                                       00006310
      XS=TIMAGX                                                         00006320
      YS=TIMAGY                                                         00006330
C * CLIP VECTOR                                                         00006340
      CALL CLIPT(BUFIN,BFOUT)                                           00006350
C * ON SCREEN{                                                          00006360
      IF(KGNFLG .EQ. 1) GO TO 110                                       00006370
C * ARE WE AT START POINT?                                              00006380
      IF(CXS .EQ. TREALX .AND. CYS .EQ. TREALY) GO TO 120               00006390
C * MOVE BEAM TO START POINT                                            00006400
      MODE=KKMODE                                                       00006410
      CALL VECMOD                                                       00006420
      CALL WINCOT(CXS,CYS,IX,IY)                                        00006430
      CALL XYCNVT(IX,IY)                                                00006440
      KKMODE=MODE                                                       00006450
      GO TO 120                                                         00006460
C * POINT OR MOVE                                                       00006470
10    CALL PCLIPT(XE,YE)                                                00006480
C * OFF SCREEN{                                                         00006490
      IF(KGNFLG .EQ. 1) GO TO 110                                       00006500
      CXE=XE                                                            00006510
      CYE=YE                                                            00006520
C * CONVERT TO SCREEN COORDINATES                                       00006530
120   CALL WINCOT(CXE,CYE,IX,IY)                                        00006540
C * SAVE POSITION  ABS AND IMAGINARY                                    00006550
      TREALX=CXE                                                        00006560
      TREALY=CYE                                                        00006570
110   TIMAGX=X                                                          00006580
      TIMAGY=Y                                                          00006590
      RETURN                                                            00006600
      END                                                               00006610
C                                                                       00006620

C----------SUBROUTINE--CLIPT-------------------------TEKTRONIX, INC.----00006630
C                                                                       00006640
      SUBROUTINE CLIPT(BUFIN,OUTBF)                                     00006650
      DIMENSION  BUFIN(1),OUTBF(1)                                      00006660
      COMMON /TKTRNX/ TMINVX,TMINVY,TMAXVX,TMAXVY,TREALX,TREALY,        00006670
     1 TIMAGX,TIMAGY,TRCOSF,TRSINF,TRSCAL,TRFACX,TRFACY,                00006680
     2 TRPAR1,TRPAR2,TRPAR3,TRPAR4,TRPAR5,TRPAR6,KMOFLG(8),KPAD2,       00006690
     3 KBAUDR,KGNFLG,KGRAFL,KHOMEY,KKMODE,KHORSZ,KVERSZ,KTBLSZ,         00006700
     4 KSIZEF,KLMRGN,KRMRGN,KFACTR,KTERM,KLINE,KZAXIS,KBEAMX,KBEAMY,    00006710
     5 KMOVEF,KPCHAR(5),KDASHT,KMINSX,KMINSY,KMAXSX,KMAXSY,KEYCON,      00006720
     6 KINLFT,KOTLFT,KUNIT                                              00006730
      GSTAX=BUFIN(1)                                                    00006740
      GSTAY=BUFIN(2)                                                    00006750
      GENDX=BUFIN(3)                                                    00006760
      GENDY=BUFIN(4)                                                    00006770
      IF(GSTAX.GE.TMINVX)GO TO 10                                       00006780
      IF(GENDX.GE.TMINVX)GO TO 20                                       00006790
      GO TO 110                                                         00006800
10    IF(GSTAX.LE.TMAXVX)GO TO 20                                       00006810
      IF(GENDX.LE.TMAXVX)GO TO 20                                       00006820
      GO TO 110                                                         00006830
20    IF(GSTAY.GE.TMINVY)GO TO 21                                       00006840
      IF(GENDY.GE.TMINVY)GO TO 30                                       00006850
      GO TO 110                                                         00006860
21    IF(GSTAY.LE.TMAXVY)GO TO 30                                       00006870
      IF(GENDY.LE.TMAXVY)GO TO 30                                       00006880
      GO TO 110                                                         00006890
30    IF(GSTAX.NE.GENDX)GO TO 31                                        00006900
      DSTAX=GSTAX                                                       00006910
      DENDX=GSTAX                                                       00006920
      CALL PARCLT(GSTAY,GENDY,TMINVY,TMAXVY,DSTAY,DENDY)                00006930
      GO TO 120                                                         00006940
31    IF(GSTAY.NE.GENDY)GO TO 40                                        00006950
      DSTAY=GSTAY                                                       00006960
      DENDY=GSTAY                                                       00006970
      CALL PARCLT(GSTAX,GENDX,TMINVX,TMAXVX,DSTAX,DENDX)                00006980
      GO TO 120                                                         00006990
40    A=GENDX-GSTAX                                                     00007000
      B=GENDY-GSTAY                                                     00007010
      IF(GSTAX.LT.TMINVX)GO TO 41                                       00007020
      IF(GSTAX.LE.TMAXVX)GO TO 43                                       00007030
      Q=TMAXVX                                                          00007040
      GO TO 42                                                          00007050
43    IF(GSTAY.GT.TMAXVY)GO TO 140                                      00007060
      IF(GSTAY.LT.TMINVY)GO TO 44                                       00007070
      DSTAX=GSTAX                                                       00007080
      DSTAY=GSTAY                                                       00007090
      GO TO 150
41    Q=TMINVX                                                          00007110
42    DSTAY=GSTAY+((Q-GSTAX)*B/A)                                       00007120
      IF(DSTAY.GT.TMAXVY)GO TO 140                                      00007130
      IF(DSTAY.LT.TMINVY)GO TO 44                                       00007140
      DSTAX=Q                                                           00007150
      GO TO 150                                                         00007160
44    R=TMINVY                                                          00007170
      GO TO 45                                                          00007180
140   R=TMAXVY                                                          00007190
45    DSTAX=GSTAX+((R-GSTAY)*A/B)                                       00007200
      IF(DSTAX.GT.TMAXVX)GO TO 110
      IF(DSTAX.LT.TMINVX)GO TO 110
      DSTAY=R                                                           00007230
150   IF(GENDX.LT.TMINVX)GO TO 50                                       00007240
      IF(GENDX.GT.TMAXVX)GO TO 51                                       00007250
      IF(GENDY.GT.TMAXVY)GO TO 160                                      00007260
      IF(GENDY.LT.TMINVY)GO TO 52                                       00007270
      DENDX=GENDX                                                       00007280
      DENDY=GENDY                                                       00007290
      GO TO 120                                                         00007300
51    Q=TMAXVX                                                          00007310
      GO TO 53                                                          00007320
50    Q=TMINVX                                                          00007330
53    DENDY=GSTAY+((Q-GSTAX)*B/A)                                       00007340
      IF(DENDY.GT.TMAXVY)GO TO 160                                      00007350
      IF(DENDY.LT.TMINVY)GO TO 52                                       00007360
      DENDX=Q                                                           00007370
      GO TO 120                                                         00007380
52    R=TMINVY                                                          00007390
      GO TO 60                                                          00007400
160   R=TMAXVY                                                          00007410
60    DENDX=GSTAX+((R-GSTAY)*A/B)                                       00007420
      DENDY=R                                                           00007430
120   OUTBF(1)=DSTAX                                                    00007440
      OUTBF(2)=DSTAY                                                    00007450
      OUTBF(3)=DENDX                                                    00007460
      OUTBF(4)=DENDY                                                    00007470
      KGNFLG=0                                                          00007480
      GO TO 70                                                          00007490
C * SET FLAG IF LINE OUTSIDE WINDOW                                     00007500
110   KGNFLG=1                                                          00007510
70    RETURN                                                            00007520
      END                                                               00007530
C                                                                       00007540

C----------SUBROUTINE--PARCLT------------------------TEKTRONIX, INC.----00007550
C                                                                       00007560
      SUBROUTINE PARCLT(RL1,RL2,RM1,RM2,RN1,RN2)                        00007570
      IF(RL1.LT.RM1)GO TO 10                                            00007580
      IF(RL1.GT.RM2)GO TO 20                                            00007590
      RN1=RL1                                                           00007600
      IF(RL2-RM1)30,40,40                                               00007610
10    RN1=RM1                                                           00007620
40    IF(RL2.LE.RM2)GO TO 50                                            00007630
      RN2=RM2                                                           00007640
      GO TO 60                                                          00007650
50    RN2=RL2                                                           00007660
      GO TO 60                                                          00007670
20    RN1=RM2                                                           00007680
      IF(RL2.GE.RM1)GO TO 50                                            00007690
30    RN2=RM1                                                           00007700
60    RETURN                                                            00007710
      END                                                               00007720
C                                                                       00007730

C----------SUBROUTINE--LINTRN------------------------TEKTRONIX, INC.----00007740
C                                                                       00007750
      SUBROUTINE LINTRN                                                 00007760
      COMMON /TKTRNX/ TMINVX,TMINVY,TMAXVX,TMAXVY,TREALX,TREALY,        00007770
     1 TIMAGX,TIMAGY,TRCOSF,TRSINF,TRSCAL,TRFACX,TRFACY,                00007780
     2 TRPAR1,TRPAR2,TRPAR3,TRPAR4,TRPAR5,TRPAR6,KMOFLG(8),KPAD2,       00007790
     3 KBAUDR,KGNFLG,KGRAFL,KHOMEY,KKMODE,KHORSZ,KVERSZ,KTBLSZ,         00007800
     4 KSIZEF,KLMRGN,KRMRGN,KFACTR,KTERM,KLINE,KZAXIS,KBEAMX,KBEAMY,    00007810
     5 KMOVEF,KPCHAR(5),KDASHT,KMINSX,KMINSY,KMAXSX,KMAXSY,KEYCON,      00007820
     6 KINLFT,KOTLFT,KUNIT                                              00007830
      KEYCON=1                                                          00007840
      CALL RESCAL                                                       00007850
      RETURN                                                            00007860
      END                                                               00007870
C                                                                       00007880

C----------SUBROUTINE--LOGTRN------------------------TEKTRONIX, INC.----00007890
C                                                                       00007900
      SUBROUTINE LOGTRN(ITYPE)                                          00007910
      COMMON /TKTRNX/ TMINVX,TMINVY,TMAXVX,TMAXVY,TREALX,TREALY,        00007920
     1 TIMAGX,TIMAGY,TRCOSF,TRSINF,TRSCAL,TRFACX,TRFACY,                00007930
     2 TRPAR1,TRPAR2,TRPAR3,TRPAR4,TRPAR5,TRPAR6,KMOFLG(8),KPAD2,       00007940
     3 KBAUDR,KGNFLG,KGRAFL,KHOMEY,KKMODE,KHORSZ,KVERSZ,KTBLSZ,         00007950
     4 KSIZEF,KLMRGN,KRMRGN,KFACTR,KTERM,KLINE,KZAXIS,KBEAMX,KBEAMY,    00007960
     5 KMOVEF,KPCHAR(5),KDASHT,KMINSX,KMINSY,KMAXSX,KMAXSY,KEYCON,      00007970
     6 KINLFT,KOTLFT,KUNIT                                              00007980
      KEYCON=2                                                          00007990
      TRPAR1=ITYPE                                                      00008000
      CALL RESCAL                                                       00008010
      RETURN                                                            00008020
      END                                                               00008030
C                                                                       00008040

C----------SUBROUTINE--POLTRN------------------------TEKTRONIX, INC.----00008050
C                                                                       00008060
      SUBROUTINE POLTRN(ANGMIN,ANGMAX,RSUPRS)                           00008070
      COMMON /TKTRNX/ TMINVX,TMINVY,TMAXVX,TMAXVY,TREALX,TREALY,        00008080
     1 TIMAGX,TIMAGY,TRCOSF,TRSINF,TRSCAL,TRFACX,TRFACY,                00008090
     2 TRPAR1,TRPAR2,TRPAR3,TRPAR4,TRPAR5,TRPAR6,KMOFLG(8),KPAD2,       00008100
     3 KBAUDR,KGNFLG,KGRAFL,KHOMEY,KKMODE,KHORSZ,KVERSZ,KTBLSZ,         00008110
     4 KSIZEF,KLMRGN,KRMRGN,KFACTR,KTERM,KLINE,KZAXIS,KBEAMX,KBEAMY,    00008120
     5 KMOVEF,KPCHAR(5),KDASHT,KMINSX,KMINSY,KMAXSX,KMAXSY,KEYCON,      00008130
     6 KINLFT,KOTLFT,KUNIT                                              00008140
      KEYCON=3                                                          00008150
      TRPAR1=ANGMIN                                                     00008160
      TRPAR2=ANGMAX                                                     00008170
      TRPAR5=RSUPRS                                                     00008180
      CALL PSCAL                                                        00008190
      RETURN                                                            00008200
      END                                                               00008210
C                                                                       00008220

C----------SUBROUTINE--RESCAL------------------------TEKTRONIX, INC.----00008230
C                                                                       00008240
      SUBROUTINE RESCAL                                                 00008250
      COMMON /TKTRNX/ TMINVX,TMINVY,TMAXVX,TMAXVY,TREALX,TREALY,        00008260
     1 TIMAGX,TIMAGY,TRCOSF,TRSINF,TRSCAL,TRFACX,TRFACY,                00008270
     2 TRPAR1,TRPAR2,TRPAR3,TRPAR4,TRPAR5,TRPAR6,KMOFLG(8),KPAD2,       00008280
     3 KBAUDR,KGNFLG,KGRAFL,KHOMEY,KKMODE,KHORSZ,KVERSZ,KTBLSZ,         00008290
     4 KSIZEF,KLMRGN,KRMRGN,KFACTR,KTERM,KLINE,KZAXIS,KBEAMX,KBEAMY,    00008300
     5 KMOVEF,KPCHAR(5),KDASHT,KMINSX,KMINSY,KMAXSX,KMAXSY,KEYCON,      00008310
     6 KINLFT,KOTLFT,KUNIT                                              00008320
C * FLAG OLD VIRTUAL COORDINATES AS INCORRECT
	KGRAFL=0
	KGNFLG=0
      KEY=KEYCON                                                        00008330
      IF(KEYCON .LT. 1)KEY=5                                            00008340
      IF(KEYCON .GT. 4)KEY=4                                            00008350
C * BRANCH TO PROPER SECTION AND RETURN                                 00008360
C * LINEAR LOG POLAR USER ERROR                                         00008370
      GO TO (100,200,300,400,500),KEY                                   00008380
C * BOTH AXES LINEAR                                                    00008390
100   TRPAR1=0.                                                         00008400
C * SEMI LOG OR LOG LOG                                                 00008410
200   KEYL=TRPAR1+1.001                                                 00008420
C * X AXIS -- LINEAR OR LOG                                             00008430
      GO TO (210,215,210,215),KEYL                                      00008440
C * LINEAR                                                              00008450
210   TRFACX=FLOAT(KMAXSX-KMINSX)/(TMAXVX-TMINVX)                       00008460
      GO TO 250                                                         00008470
C * PREVENT INVALID TRANSFORMATION
215	IF(TMINVX.GT.0.0.AND.TMAXVX.GT.0.0)GO TO 220
	KGNFLG=1
	TRPAR1=TRPAR1-1.0
	GO TO 210
C * SEMI LOG X AXIS                                                     00008480
220   TRPAR2=ALOG(TMINVX)                                               00008490
      TRFACX=FLOAT(KMAXSX-KMINSX)/(ALOG(TMAXVX)-TRPAR2)                 00008500
C * Y AXIS -- LINEAR OR LOG                                             00008510
250   GO TO (260,260,270,270),KEYL                                      00008520
C * LINEAR                                                              00008530
260   TRFACY=FLOAT(KMAXSY-KMINSY)/(TMAXVY-TMINVY)                       00008540
      GO TO 600                                                         00008550
C *PREVENT INVALID TRANSFORMATION
270	IF(TMINVY.GT.0.0.AND.TMAXVY.GT.0.0)GO TO 280
	KGNFLG=1
	TRPAR1=TRPAR1-2.0
	GO TO 260
C * SEMI LOG Y AXIS                                                     00008560
280   TRPAR3=ALOG(TMINVY)                                               00008570
      TRFACY=FLOAT(KMAXSY-KMINSY)/(ALOG(TMAXVY)-TRPAR3)                 00008580
      GO TO 600                                                         00008590
C * POLAR SCALING                                                       00008600
300   CALL PSCAL                                                        00008610
      GO TO 600                                                         00008620
C * USER FUNCTION                                                       00008630
400   CONTINUE                                                          00008640
C      CALL URSCAL                                                      00008650
      GO TO 600                                                         00008660
C * NO SCALE                                                            00008670
500   TRFACX=1.                                                         00008680
      TRFACY=1.                                                         00008690
600   RETURN                                                            00008700
      END                                                               00008710
C                                                                       00008720

C----------SUBROUTINE--PSCAL-------------------------TEKTRONIX, INC.----00008730
C                                                                       00008740
      SUBROUTINE PSCAL                                                  00008750
      COMMON /TKTRNX/ TMINVX,TMINVY,TMAXVX,TMAXVY,TREALX,TREALY,        00008760
     1 TIMAGX,TIMAGY,TRCOSF,TRSINF,TRSCAL,TRFACX,TRFACY,                00008770
     2 TRPAR1,TRPAR2,TRPAR3,TRPAR4,TRPAR5,TRPAR6,KMOFLG(8),KPAD2,       00008780
     3 KBAUDR,KGNFLG,KGRAFL,KHOMEY,KKMODE,KHORSZ,KVERSZ,KTBLSZ,         00008790
     4 KSIZEF,KLMRGN,KRMRGN,KFACTR,KTERM,KLINE,KZAXIS,KBEAMX,KBEAMY,    00008800
     5 KMOVEF,KPCHAR(5),KDASHT,KMINSX,KMINSY,KMAXSX,KMAXSY,KEYCON,      00008810
     6 KINLFT,KOTLFT,KUNIT                                              00008820
      LOGICAL ANEG                                                      00008830
      ANEG=TRPAR1 .GT. TRPAR2                                           00008840
C * FLAG THE OLD VIRTUAL COORDINATES AS INCORRECT
	KGRAFL=0
      PIDV2=90.00                                                       00008850
C * SET UP UNTRANSLATED TRIAL POLAR WINDOW                              00008860
      TRPAR3=0.                                                         00008870
      TRPAR4=0.                                                         00008880
      TRFACY=1.                                                         00008890
      TRPAR6=0.                                                         00008900
      R1=TMINVX                                                         00008910
      R2=TMAXVX                                                         00008920
      RMAX=AMAX1(ABS(R1),ABS(R2))                                       00008930
      TRFACX=1000./RMAX                                                 00008940
      THMIN=AMIN1(TRPAR1,TRPAR2)                                        00008950
      THMAX=AMAX1(TRPAR2,TRPAR1)                                        00008960
C * FIND EXTREMES OF THE TRIAL POLAR WINDOW                             00008970
      CALL WINCOT(R1,THMIN,IX1,IY1)                                     00008980
      CALL WINCOT(R1,THMAX,IX2,IY2)                                     00008990
      CALL WINCOT(R2,THMIN,IX3,IY3)                                     00009000
      CALL WINCOT(R2,THMAX,IX4,IY4)                                     00009010
      IXMIN=MIN0(IX1,IX2,IX3,IX4)                                       00009020
      IXMAX=MAX0(IX1,IX2,IX3,IX4)                                       00009030
      IYMIN=MIN0(IY1,IY2,IY3,IY4)                                       00009040
      IYMAX=MAX0(IY1,IY2,IY3,IY4)                                       00009050
      X=THMIN/PIDV2                                                     00009060
      IF(THMIN.GT.0.)X=X+.999                                           00009070
      QUAD=FLOAT(IFIX(X))*PIDV2                                         00009080
      NQUAD=0                                                           00009090
C * CHECK EXTREMES OF TRIAL WINDOW AT 90 DEGREE INTERVALS               00009100
200   IF(QUAD.GE.THMAX)GO TO 300                                        00009110
      NQUAD=NQUAD+1                                                     00009120
      CALL WINCOT(R1,QUAD,IX1,IY1)                                      00009130
      CALL WINCOT(R2,QUAD,IX2,IY2)                                      00009140
      IXMIN=MIN0(IX1,IX2,IXMIN)                                         00009150
      IXMAX=MAX0(IX1,IX2,IXMAX)                                         00009160
      IYMIN=MIN0(IY1,IY2,IYMIN)                                         00009170
      IYMAX=MAX0(IY1,IY2,IYMAX)                                         00009180
      QUAD=QUAD+PIDV2                                                   00009190
      IF(NQUAD.LT.4)GO TO 200                                           00009200
C * COMPUTE SCREEN AND VIRTUAL RANGES                                   00009210
300   TSRANX=KMAXSX-KMINSX                                              00009220
      TSRANY=KMAXSY-KMINSY                                              00009230
      XRANGE=IXMAX-IXMIN                                                00009240
      YRANGE=IYMAX-IYMIN                                                00009250
C * COMPUTE RELATIVE RADIUS SCALE FACTOR                                00009260
      FACTOR=AMIN1(ABS(TSRANX)/XRANGE,ABS(TSRANY)/YRANGE)               00009270
C * COMPUTE SCREEN OFFSETS                                              00009280
      TRPAR3=FLOAT(KMINSX)-FACTOR*FLOAT(IXMIN)                          00009290
      TRPAR4=FLOAT(KMINSY)-FACTOR*FLOAT(IYMIN)                          00009300
C * COMPUTE FINAL RADIUS SCALE FACTOR                                   00009310
      TRFACX=TRFACX*FACTOR                                              00009320
C * COMPUTE ANGLE SCALE FACTOR                                          00009330
      TRFACY=(TRPAR2-TRPAR1)/(TMAXVY-TMINVY)                            00009340
C * APPLY CORRECT SIGN TO ANGLE SCALE FACTOR                            00009350
      TRFACY=SIGN(1.,TSRANX*TSRANY)*TRFACY                              00009360
      AANG=0.                                                           00009370
C * APPLY CORRECTION FOR @REVERSED@ WINDOWS                             00009380
      IF(ANEG.AND.TSRANY.LT.0..OR.TSRANX.LT.0..AND..NOT.ANEG)AANG=180.  00009390
C * COMPUTE ANGLE OFFSET                                                00009400
      TRPAR6=TMINVY-(TRPAR1+AANG)/TRFACY                                00009410
      RETURN                                                            00009420
      END                                                               00009430

C----------SUBROUTINE--WINCOT------------------------TEKTRONIX, INC.----00009450
C                                                                       00009460
      SUBROUTINE WINCOT(X,Y,IX,IY)                                      00009470
      COMMON /TKTRNX/ TMINVX,TMINVY,TMAXVX,TMAXVY,TREALX,TREALY,        00009480
     1 TIMAGX,TIMAGY,TRCOSF,TRSINF,TRSCAL,TRFACX,TRFACY,                00009490
     2 TRPAR1,TRPAR2,TRPAR3,TRPAR4,TRPAR5,TRPAR6,KMOFLG(8),KPAD2,       00009500
     3 KBAUDR,KGNFLG,KGRAFL,KHOMEY,KKMODE,KHORSZ,KVERSZ,KTBLSZ,         00009510
     4 KSIZEF,KLMRGN,KRMRGN,KFACTR,KTERM,KLINE,KZAXIS,KBEAMX,KBEAMY,    00009520
     5 KMOVEF,KPCHAR(5),KDASHT,KMINSX,KMINSY,KMAXSX,KMAXSY,KEYCON,      00009530
     6 KINLFT,KOTLFT,KUNIT                                              00009540
      DATA DE2RAD/0.01745/                                              00009550
C * CHECK FOR PERMITTED VALUE OF CONVERSION KEY                         00009560
C * DEFAULT IS LINEAR,ERROR IS NONE                                     00009570
      DX=X-TMINVX                                                       00009580
      DY=Y-TMINVY                                                       00009590
      KEY=KEYCON                                                        00009600
      IF(KEYCON .LT. 1)KEY=5                                            00009610
      IF(KEYCON .GT. 4)KEY=4                                            00009620
C * BRANCH TO PROPER SECTION                                            00009630
C * LINEAR LOG POLAR USER ERROR                                         00009640
      GO TO(500,300,600,700,100),KEY                                    00009650
C       ERROR                                                           00009660
100   IX=X                                                              00009670
      IY=Y                                                              00009680
      GO TO 800                                                         00009690
C * LOG TRANSFORM                                                       00009700
300   KEYL=TRPAR1+.001                                                  00009710
      IF(KEYL .EQ. 2) GO TO 400                                         00009720
C * SETUP X LOG TRANSFORM                                               00009730
      DX=ALOG(X)-TRPAR2                                                 00009740
400   IF(KEYL .EQ. 1) GO TO 500                                         00009750
C * SETUP Y LOG TRANSFORM                                               00009760
      DY=ALOG(Y)-TRPAR3                                                 00009770
C * CONVERT LINIER                                                      00009780
500   IX=IFIX(DX*TRFACX+.5)+KMINSX                                      00009790
      IY=IFIX(DY*TRFACY+.5)+KMINSY                                      00009800
C * GO TO EXIT                                                          00009810
      GO TO 800                                                         00009820
C * POLAR TRANSFORMATION                                                00009830
600   A=(Y-TRPAR6)*TRFACY                                               00009840
      R=(X-TRPAR5)*TRFACX                                               00009850
      IX=R*COS(A*DE2RAD)+TRPAR3                                         00009860
      IY=R*SIN(A*DE2RAD)+TRPAR4                                         00009870
C * GO TO EXIT                                                          00009880
      GO TO 800                                                         00009890
C * USER TRANSFORMATION IN USE                                          00009900
700   CONTINUE                                                          00009910
C      CALL USECOT(X,Y,IX,IY)                                           00009920
C * EXIT POINT                                                          00009930
800   RETURN                                                            00009940
      END                                                               00009950
C                                                                       00009960

C----------SUBROUTINE--LVLCHT------------------------TEKTRONIX, INC.----00009970
C                                                                       00009980
      SUBROUTINE LVLCHT                                                 00009990
      COMMON /TKTRNX/ TMINVX,TMINVY,TMAXVX,TMAXVY,TREALX,TREALY,        00010000
     1 TIMAGX,TIMAGY,TRCOSF,TRSINF,TRSCAL,TRFACX,TRFACY,                00010010
     2 TRPAR1,TRPAR2,TRPAR3,TRPAR4,TRPAR5,TRPAR6,KMOFLG(8),KPAD2,       00010020
     3 KBAUDR,KGNFLG,KGRAFL,KHOMEY,KKMODE,KHORSZ,KVERSZ,KTBLSZ,         00010030
     4 KSIZEF,KLMRGN,KRMRGN,KFACTR,KTERM,KLINE,KZAXIS,KBEAMX,KBEAMY,    00010040
     5 KMOVEF,KPCHAR(5),KDASHT,KMINSX,KMINSY,KMAXSX,KMAXSY,KEYCON,      00010050
     6 KINLFT,KOTLFT,KUNIT                                              00010060
      IF(KGRAFL.NE.0)GO TO 10                                           00010070
      CALL REVCOT(KBEAMX,KBEAMY,TREALX,TREALY)                          00010080
      TIMAGX=TREALX                                                     00010090
      TIMAGY=TREALY                                                     00010100
      KGRAFL=1                                                          00010110
10    RETURN                                                            00010120
      END                                                               00010130
C                                                                       00010140

C----------SUBROUTINE--REVCOT------------------------TEKTRONIX, INC.----00010150
C                                                                       00010160
      SUBROUTINE REVCOT(IX,IY,X,Y)                                      00010170
      LOGICAL DEC                                                       00010180
      COMMON /TKTRNX/ TMINVX,TMINVY,TMAXVX,TMAXVY,TREALX,TREALY,        00010190
     1 TIMAGX,TIMAGY,TRCOSF,TRSINF,TRSCAL,TRFACX,TRFACY,                00010200
     2 TRPAR1,TRPAR2,TRPAR3,TRPAR4,TRPAR5,TRPAR6,KMOFLG(8),KPAD2,       00010210
     3 KBAUDR,KGNFLG,KGRAFL,KHOMEY,KKMODE,KHORSZ,KVERSZ,KTBLSZ,         00010220
     4 KSIZEF,KLMRGN,KRMRGN,KFACTR,KTERM,KLINE,KZAXIS,KBEAMX,KBEAMY,    00010230
     5 KMOVEF,KPCHAR(5),KDASHT,KMINSX,KMINSY,KMAXSX,KMAXSY,KEYCON,      00010240
     6 KINLFT,KOTLFT,KUNIT                                              00010250
      E=2.7182818284                                                    00010260
      DX=FLOAT(IX-KMINSX)/TRFACX                                        00010270
      DY=FLOAT(IY-KMINSY)/TRFACY                                        00010280
      KEY=KEYCON                                                        00010290
      IF(KEYCON .LT. 1)KEY=5                                            00010300
      IF(KEYCON .GT. 4)KEY=4                                            00010310
C *       LINEAR LOG POLAR USER ERROR                                   00010320
      GO TO(300, 400, 500, 600, 100  ),KEY                              00010330
C * ERROR                                                               00010340
100   X=IX                                                              00010350
      Y=IY                                                              00010360
      GO TO 700                                                         00010370
C * LINEAR                                                              00010380
300   X=DX+TMINVX                                                       00010390
      Y=DY+TMINVY                                                       00010400
      GO TO 700                                                         00010410
C * LOG SCALES                                                          00010420
400   KEYL=TRPAR1                                                       00010430
      X=DX+TMINVX                                                       00010440
      Y=DY+TMINVY                                                       00010450
      IF(KEYL .NE. 2)X=E**(DX+TRPAR2)                                   00010460
      IF(KEYL .NE. 1)Y=E**(DY+TRPAR3)                                   00010470
      GO TO 700                !                                        00010480
C * POLAR                                                               00010490
500   DX=FLOAT(IX)-TRPAR3                                               00010500
      DY=FLOAT(IY)-TRPAR4                                               00010510
      Y=ATAN2(DY,DX)*57.2957795131                                      00010520
      X=SQRT(DY*DY+DX*DX)/TRFACX+TRPAR5                                 00010530
C * ADJUST ANGLE MOD 2 PI TO VALUE WITHIN WINDOW                        00010540
      DEC=.FALSE.                                                       00010550
510   IF(Y .GT. TRPAR1) GO TO 530                                       00010560
C * INCREMENT ANGLE                                                     00010570
      Y=Y+360.0                                                         00010580
      GO TO 510                                                         00010590
530   IF(Y .LE. TRPAR2) GO TO 550                                       00010600
C * DECREMENT ANGLE                                                     00010610
      Y=Y-360.0                                                         00010620
      DEC=.TRUE.                                                        00010630
      GO TO 530                                                         00010640
550   IF(DEC .AND. Y .LT. TRPAR1)Y=Y+360.0                              00010650
      IF(TMINVX .GE. 0.)GO TO 560                                       00010660
      TR1A=AMOD(TRPAR1+180.,360.)                                       00010670
      TR2A=AMOD(TRPAR2+180.,360.)                                       00010680
      IF(Y.GT.AMAX1(TR1A,TR2A).OR.Y.LT.AMIN1(TR1A,TR2A))GO TO 560       00010690
      Y=AMOD(Y+180.,360.)                                               00010700
      X=-X                                                              00010710
560   Y=Y/TRFACY+TRPAR6                                                 00010720
      GO TO 700                                                         00010730
C * USER CONVERSION                                                     00010740
600   CONTINUE                                                          00010750
C      CALL UREVCT(IX,IY,X,Y)                                           00010760
C * EXIT POINT                                                          00010770
700   CALL PCLIPT(X,Y)                                                  00010780
      RETURN                                                            00010790
      END                                                               00010800

C----------SUBROUTINE--PCLIPT------------------------TEKTRONIX, INC.----00010820
      SUBROUTINE PCLIPT(X,Y)                                            00010840
      COMMON /TKTRNX/ TMINVX,TMINVY,TMAXVX,TMAXVY,TREALX,TREALY,        00010850
     1 TIMAGX,TIMAGY,TRCOSF,TRSINF,TRSCAL,TRFACX,TRFACY,                00010860
     2 TRPAR1,TRPAR2,TRPAR3,TRPAR4,TRPAR5,TRPAR6,KMOFLG(8),KPAD2,       00010870
     3 KBAUDR,KGNFLG,KGRAFL,KHOMEY,KKMODE,KHORSZ,KVERSZ,KTBLSZ,         00010880
     4 KSIZEF,KLMRGN,KRMRGN,KFACTR,KTERM,KLINE,KZAXIS,KBEAMX,KBEAMY,    00010890
     5 KMOVEF,KPCHAR(5),KDASHT,KMINSX,KMINSY,KMAXSX,KMAXSY,KEYCON,      00010900
     6 KINLFT,KOTLFT,KUNIT                                              00010910
      KGNFLG=0                                                          00010920
      IF(X.LT.TMINVX)GO TO 10                                           00010930
      IF(X.GT.TMAXVX)GO TO 10                                           00010940
      IF(Y.LT.TMINVY)GO TO 10                                           00010950
      IF(Y.LE.TMAXVY)GO TO 20                                           00010960
10    KGNFLG=1                                                          00010970
20    RETURN                                                            00010980
      END                                                               00010990

C----------SUBROUTINE--PNTREL------------------------TEKTRONIX, INC.----00011010
      SUBROUTINE PNTREL(IX,IY)                                          00011030
      COMMON /TKTRNX/ TMINVX,TMINVY,TMAXVX,TMAXVY,TREALX,TREALY,        00011040
     1 TIMAGX,TIMAGY,TRCOSF,TRSINF,TRSCAL,TRFACX,TRFACY,                00011050
     2 TRPAR1,TRPAR2,TRPAR3,TRPAR4,TRPAR5,TRPAR6,KMOFLG(8),KPAD2,       00011060
     3 KBAUDR,KGNFLG,KGRAFL,KHOMEY,KKMODE,KHORSZ,KVERSZ,KTBLSZ,         00011070
     4 KSIZEF,KLMRGN,KRMRGN,KFACTR,KTERM,KLINE,KZAXIS,KBEAMX,KBEAMY,    00011080
     5 KMOVEF,KPCHAR(5),KDASHT,KMINSX,KMINSY,KMAXSX,KMAXSY,KEYCON,      00011090
     6 KINLFT,KOTLFT,KUNIT                                              00011100
      JX=KBEAMX+IX                                                      00011110
      JY=KBEAMY+IY                                                      00011120
      CALL PNTABS(JX,JY)                                                00011130
      RETURN                                                            00011140
      END                                                               00011150

C----------SUBROUTINE--PNTABS------------------------TEKTRONIX, INC.----00011170
      SUBROUTINE PNTABS(IX,IY)                                          00011190
      COMMON /TKTRNX/ TMINVX,TMINVY,TMAXVX,TMAXVY,TREALX,TREALY,        00011200
     1 TIMAGX,TIMAGY,TRCOSF,TRSINF,TRSCAL,TRFACX,TRFACY,                00011210
     2 TRPAR1,TRPAR2,TRPAR3,TRPAR4,TRPAR5,TRPAR6,KMOFLG(8),KPAD2,       00011220
     3 KBAUDR,KGNFLG,KGRAFL,KHOMEY,KKMODE,KHORSZ,KVERSZ,KTBLSZ,         00011230
     4 KSIZEF,KLMRGN,KRMRGN,KFACTR,KTERM,KLINE,KZAXIS,KBEAMX,KBEAMY,    00011240
     5 KMOVEF,KPCHAR(5),KDASHT,KMINSX,KMINSY,KMAXSX,KMAXSY,KEYCON,      00011250
     6 KINLFT,KOTLFT,KUNIT                                              00011260
      IF(KKMODE .NE. 2)CALL PNTMOD                                      00011270
      CALL TKPNT(IX,IY)                                                 00011280
      KGRAFL=0                                                          00011290
      RETURN                                                            00011300
      END                                                               00011310

C----------SUBROUTINE--DRWREL------------------------TEKTRONIX, INC.----00011330
      SUBROUTINE DRWREL(IX,IY)                                          00011350
      COMMON /TKTRNX/ TMINVX,TMINVY,TMAXVX,TMAXVY,TREALX,TREALY,        00011360
     1 TIMAGX,TIMAGY,TRCOSF,TRSINF,TRSCAL,TRFACX,TRFACY,                00011370
     2 TRPAR1,TRPAR2,TRPAR3,TRPAR4,TRPAR5,TRPAR6,KMOFLG(8),KPAD2,       00011380
     3 KBAUDR,KGNFLG,KGRAFL,KHOMEY,KKMODE,KHORSZ,KVERSZ,KTBLSZ,         00011390
     4 KSIZEF,KLMRGN,KRMRGN,KFACTR,KTERM,KLINE,KZAXIS,KBEAMX,KBEAMY,    00011400
     5 KMOVEF,KPCHAR(5),KDASHT,KMINSX,KMINSY,KMAXSX,KMAXSY,KEYCON,      00011410
     6 KINLFT,KOTLFT,KUNIT                                              00011420
      JX=KBEAMX+IX                                                      00011430
      JY=KBEAMY+IY                                                      00011440
      CALL DRWABS(JX,JY)                                                00011450
      RETURN                                                            00011460
      END                                                               00011470

C----------SUBROUTINE--DRWABS------------------------TEKTRONIX, INC.----00011490
      SUBROUTINE DRWABS(IX,IY)                                          00011510
      COMMON /TKTRNX/ TMINVX,TMINVY,TMAXVX,TMAXVY,TREALX,TREALY,        00011520
     1 TIMAGX,TIMAGY,TRCOSF,TRSINF,TRSCAL,TRFACX,TRFACY,                00011530
     2 TRPAR1,TRPAR2,TRPAR3,TRPAR4,TRPAR5,TRPAR6,KMOFLG(8),KPAD2,       00011540
     3 KBAUDR,KGNFLG,KGRAFL,KHOMEY,KKMODE,KHORSZ,KVERSZ,KTBLSZ,         00011550
     4 KSIZEF,KLMRGN,KRMRGN,KFACTR,KTERM,KLINE,KZAXIS,KBEAMX,KBEAMY,    00011560
     5 KMOVEF,KPCHAR(5),KDASHT,KMINSX,KMINSY,KMAXSX,KMAXSY,KEYCON,      00011570
     6 KINLFT,KOTLFT,KUNIT                                              00011580
C * NON-4014/15 PRUNING BOUNDARY                                        00011590
C * SET TERMINAL TO DRAW SOLID LINES                                    00011600
C * THIS SECTION IS FOR 4014 ENHANCED **********************************00011610
      IF(KLINE .EQ. 0)GO TO 5                                           00011620
      KLINE=0                                                           00011630
      CALL CWSEND                                                       00011640
5     CONTINUE                                                          00011650
C **********************************************************************00011660
      IF(KKMODE.NE.1)CALL VECMOD                                        00011670
      IF(KMOVEF.EQ.1)CALL XYCNVT(KBEAMX,KBEAMY)                         00011680
      CALL XYCNVT(IX,IY)                                                00011690
      KGRAFL=0                                                          00011700
      RETURN                                                            00011710
      END                                                               00011720

C----------SUBROUTINE--SETMRG------------------------TEKTRONIX, INC.----00011740
      SUBROUTINE SETMRG(MLEFT,MRIGHT)                                   00011760
      COMMON /TKTRNX/ TMINVX,TMINVY,TMAXVX,TMAXVY,TREALX,TREALY,        00011770
     1 TIMAGX,TIMAGY,TRCOSF,TRSINF,TRSCAL,TRFACX,TRFACY,                00011780
     2 TRPAR1,TRPAR2,TRPAR3,TRPAR4,TRPAR5,TRPAR6,KMOFLG(8),KPAD2,       00011790
     3 KBAUDR,KGNFLG,KGRAFL,KHOMEY,KKMODE,KHORSZ,KVERSZ,KTBLSZ,         00011800
     4 KSIZEF,KLMRGN,KRMRGN,KFACTR,KTERM,KLINE,KZAXIS,KBEAMX,KBEAMY,    00011810
     5 KMOVEF,KPCHAR(5),KDASHT,KMINSX,KMINSY,KMAXSX,KMAXSY,KEYCON,      00011820
     6 KINLFT,KOTLFT,KUNIT                                              00011830
      KLMRGN=MLEFT                                                      00011840
      KRMRGN=MRIGHT                                                     00011850
      RETURN                                                            00011860
      END                                                               00011870

C----------SUBROUTINE--MOVREL------------------------TEKTRONIX, INC.----00011890
      SUBROUTINE MOVREL(IX,IY)                                          00011910
      COMMON /TKTRNX/ TMINVX,TMINVY,TMAXVX,TMAXVY,TREALX,TREALY,        00011920
     1 TIMAGX,TIMAGY,TRCOSF,TRSINF,TRSCAL,TRFACX,TRFACY,                00011930
     2 TRPAR1,TRPAR2,TRPAR3,TRPAR4,TRPAR5,TRPAR6,KMOFLG(8),KPAD2,       00011940
     3 KBAUDR,KGNFLG,KGRAFL,KHOMEY,KKMODE,KHORSZ,KVERSZ,KTBLSZ,         00011950
     4 KSIZEF,KLMRGN,KRMRGN,KFACTR,KTERM,KLINE,KZAXIS,KBEAMX,KBEAMY,    00011960
     5 KMOVEF,KPCHAR(5),KDASHT,KMINSX,KMINSY,KMAXSX,KMAXSY,KEYCON,      00011970
     6 KINLFT,KOTLFT,KUNIT                                              00011980
      JX=KBEAMX+IX                                                      00011990
      JY=KBEAMY+IY                                                      00012000
      CALL MOVABS(JX,JY)                                                00012010
      RETURN                                                            00012020
      END                                                               00012030

C----------SUBROUTINE--SETTAB------------------------TEKTRONIX, INC.----00012050
      SUBROUTINE SETTAB(ITAB,ITBTBL)                                    00012070
      DIMENSION ITBTBL(1)                                               00012080
      COMMON /TKTRNX/ TMINVX,TMINVY,TMAXVX,TMAXVY,TREALX,TREALY,        00012090
     1 TIMAGX,TIMAGY,TRCOSF,TRSINF,TRSCAL,TRFACX,TRFACY,                00012100
     2 TRPAR1,TRPAR2,TRPAR3,TRPAR4,TRPAR5,TRPAR6,KMOFLG(8),KPAD2,       00012110
     3 KBAUDR,KGNFLG,KGRAFL,KHOMEY,KKMODE,KHORSZ,KVERSZ,KTBLSZ,         00012120
     4 KSIZEF,KLMRGN,KRMRGN,KFACTR,KTERM,KLINE,KZAXIS,KBEAMX,KBEAMY,    00012130
     5 KMOVEF,KPCHAR(5),KDASHT,KMINSX,KMINSY,KMAXSX,KMAXSY,KEYCON,      00012140
     6 KINLFT,KOTLFT,KUNIT                                              00012150
      KGNFLG=0                                                          00012160
      IF(ITAB.LE.0)GO TO 10                                             00012170
      I=1                                                               00012180
20    IF(ITBTBL(I).EQ.ITAB)GO TO 10                                     00012190
      IF(ITAB.LT.ITBTBL(I))GO TO 60                                     00012200
      IF(ITBTBL(I).EQ.0)GO TO 60                                        00012210
      I=I+1                                                             00012220
      IF(I.LE.KTBLSZ)GO TO 20                                           00012230
30    KGNFLG=1                                                          00012240
10    RETURN                                                            00012250
60    ITEMP=ITBTBL(I)                                                   00012260
      ITBTBL(I)=ITAB                                                    00012270
70    IF(ITEMP.EQ.0)GO TO 10                                            00012280
      I=I+1                                                             00012290
      IF(I.GT.KTBLSZ)GO TO 30                                           00012300
      ITEMPA=ITBTBL(I)                                                  00012310
      ITBTBL(I)=ITEMP                                                   00012320
      ITEMP=ITEMPA                                                      00012330
      GO TO 70                                                          00012340
      END                                                               00012350

C----------SUBROUTINE--RSTTAB------------------------TEKTRONIX, INC.----00012370
      SUBROUTINE RSTTAB(ITAB,ITBTBL)                                    00012390
      DIMENSION ITBTBL(1)                                               00012400
      COMMON /TKTRNX/ TMINVX,TMINVY,TMAXVX,TMAXVY,TREALX,TREALY,        00012410
     1 TIMAGX,TIMAGY,TRCOSF,TRSINF,TRSCAL,TRFACX,TRFACY,                00012420
     2 TRPAR1,TRPAR2,TRPAR3,TRPAR4,TRPAR5,TRPAR6,KMOFLG(8),KPAD2,       00012430
     3 KBAUDR,KGNFLG,KGRAFL,KHOMEY,KKMODE,KHORSZ,KVERSZ,KTBLSZ,         00012440
     4 KSIZEF,KLMRGN,KRMRGN,KFACTR,KTERM,KLINE,KZAXIS,KBEAMX,KBEAMY,    00012450
     5 KMOVEF,KPCHAR(5),KDASHT,KMINSX,KMINSY,KMAXSX,KMAXSY,KEYCON,      00012460
     6 KINLFT,KOTLFT,KUNIT                                              00012470
      IF(ITAB)10,20,30                                                  00012480
30    DO 40 I=1,KTBLSZ                                                  00012490
      IF(ITAB.EQ.ITBTBL(I))GO TO 50                                     00012500
40    CONTINUE                                                          00012510
      GO TO 10                                                          00012520
50    J=KTBLSZ-1                                                        00012530
      DO 60 K=I,J                                                       00012540
60    ITBTBL(K)=ITBTBL(K+1)                                             00012550
      ITBTBL(KTBLSZ)=0                                                  00012560
      GO TO 10                                                          00012570
20    DO 21 II=1,KTBLSZ                                                 00012580
21    ITBTBL(II)=0                                                      00012590
10    RETURN                                                            00012600
      END                                                               00012610

C----------SUBROUTINE--TABHOR------------------------TEKTRONIX, INC.----00012630
      SUBROUTINE TABHOR(ITBTBL)                                         00012650
      DIMENSION ITBTBL(1)                                               00012660
      COMMON /TKTRNX/ TMINVX,TMINVY,TMAXVX,TMAXVY,TREALX,TREALY,        00012670
     1 TIMAGX,TIMAGY,TRCOSF,TRSINF,TRSCAL,TRFACX,TRFACY,                00012680
     2 TRPAR1,TRPAR2,TRPAR3,TRPAR4,TRPAR5,TRPAR6,KMOFLG(8),KPAD2,       00012690
     3 KBAUDR,KGNFLG,KGRAFL,KHOMEY,KKMODE,KHORSZ,KVERSZ,KTBLSZ,         00012700
     4 KSIZEF,KLMRGN,KRMRGN,KFACTR,KTERM,KLINE,KZAXIS,KBEAMX,KBEAMY,    00012710
     5 KMOVEF,KPCHAR(5),KDASHT,KMINSX,KMINSY,KMAXSX,KMAXSY,KEYCON,      00012720
     6 KINLFT,KOTLFT,KUNIT                                              00012730
      KFLG=0                                                            00012740
      DO 10 K=1,KTBLSZ                                                  00012750
      IF(ITBTBL(K).NE.0)KFLG=1                                          00012760
      IF(ITBTBL(K).GT.KBEAMX)GO TO 20                                   00012770
10    CONTINUE                                                          00012780
      IF(KFLG.EQ.0)GO TO 30                                             00012790
15    CALL NEWLIN                                                       00012800
      GO TO 30                                                          00012810
20    IF (ITBTBL(K).GE.KRMRGN) GO TO 15                                 00012820
      CALL MOVABS(ITBTBL(K),KBEAMY)                                     00012830
      CALL ALFMOD                                                       00012840
30    RETURN                                                            00012850
      END                                                               00012860
C                                                                       00012870

C----------SUBROUTINE--TABVER------------------------TEKTRONIX, INC.----00012880
      SUBROUTINE TABVER(ITBTBL)                                         00012900
      DIMENSION ITBTBL (1)                                              00012910
      COMMON /TKTRNX/ TMINVX,TMINVY,TMAXVX,TMAXVY,TREALX,TREALY,        00012920
     1 TIMAGX,TIMAGY,TRCOSF,TRSINF,TRSCAL,TRFACX,TRFACY,                00012930
     2 TRPAR1,TRPAR2,TRPAR3,TRPAR4,TRPAR5,TRPAR6,KMOFLG(8),KPAD2,       00012940
     3 KBAUDR,KGNFLG,KGRAFL,KHOMEY,KKMODE,KHORSZ,KVERSZ,KTBLSZ,         00012950
     4 KSIZEF,KLMRGN,KRMRGN,KFACTR,KTERM,KLINE,KZAXIS,KBEAMX,KBEAMY,    00012960
     5 KMOVEF,KPCHAR(5),KDASHT,KMINSX,KMINSY,KMAXSX,KMAXSY,KEYCON,      00012970
     6 KINLFT,KOTLFT,KUNIT                                              00012980
      DO 10 K=1,KTBLSZ                                                  00012990
      I=KTBLSZ-K+1                                                      00013000
      IF(ITBTBL(I) .LE. 0)GO TO 10                                      00013010
      IF(ITBTBL(I) .LT. KBEAMY)GO TO 30                                 00013020
      IF(ITBTBL(I) .LT. KBEAMY)GO TO 30                                 00013020
      IF(ITBTBL(I) .LT. KBEAMY)GO TO 30                                 00013020
10    CONTINUE                                                          00013030
      GO TO 20                                                          00013040
30    CALL MOVABS(KBEAMX,ITBTBL(I))                                     00013050
      CALL ALFMOD                                                       00013060
20    RETURN                                                            00013070
      END                                                               00013080

C----------SUBROUTINE--DSHMOD------------------------TEKTRONIX, INC.----00013100
      SUBROUTINE DSHMOD(L)                                              00013120
      COMMON /TKTRNX/ TMINVX,TMINVY,TMAXVX,TMAXVY,TREALX,TREA Y,        00013130
     1 TIMAGX,TIMAGY,TRCOSF,TRSINF,TRSCAL,TRFACX,TRFACY,                00013140
     2 TRPAR1,TRPAR2,TRPAR3,TRPAR4,TRPAR5,TRPAR6,KMOFLG(8),KPAD2,       00013150
     3 KBAUDR,KGNFLG,KGRAFL,KHOMEY,KKMODE,KHORSZ,KVERSZ,KTBLSZ,         00013160
     4 KSIZEF,KLMRGN,KRMRGN,KFACTR,KTERM,KLINE,KZAXIS,KBEAMX,KBEAMY,    00013170
     5 KMOVEF,KPCHAR(5),KDASHT,KMINSX,KMINSY,KMAXSX,KMAXSY,KEYCON,      00013180
     6 KINLFT,KOTLFT,KUNIT                                              00013190
      IF(KKMODE .EQ. 4) GO TO 10                                        00013200
      KKMODE=4                                                          00013210
C * OUTPUT (US) TO CANCEL PREVIOUS MODE                                 00013220
      CALL TOUTPT(31)                                                   00013230
C * CANCEL OPTIMIZATION AND INSERT MOVE TO CURRENT LOCATION             00013240
      CALL TOUTPT(29)                                                   00013250
      KMOVEF=1                                                          00013260
      DO 5 I=1,5                                                        00013270
5     KPCHAR(I)=-1                                                      00013280
      CALL XYCNVT(KBEAMX,KBEAMY)                                        00013290
10    KDASHT=L                                                          00013300
      RETURN                                                            00013310
      END                                                               00013320

C----------SUBROUTINE--TKDASH------------------------TEKTRONIX, INC.----00013340
      SUBROUTINE TKDASH(IX,IY)                                          00013360
      COMMON /TKTRNX/ TMINVX,TMINVY,TMAXVX,TMAXVY,TREALX,TREALY,        00013370
     1 TIMAGX,TIMAGY,TRCOSF,TRSINF,TRSCAL,TRFACX,TRFACY,                00013380
     2 TRPAR1,TRPAR2,TRPAR3,TRPAR4,TRPAR5,TRPAR6,KMOFLG(8),KPAD2,       00013390
     3 KBAUDR,KERROR,KGRAFL,KHOMEY,KKMODE,KHORSZ,KVERSZ,KTBLSZ,         00013400
     4 KSIZEF,KLMRGN,KRMRGN,KFACTR,KTERM,KLINE,KZAXIS,KBEAMX,KBEAMY,    00013410
     5 KMOVEF,KPCHAR(5),KDASHT,KMINSX,KMINSY,KMAXSX,KMAXSY,KEYCON,      00013420
     6 KINLFT,KOTLFT,KUNIT                                              00013430
      DIMENSION DTABL(10), U(9), WORK(10),ISIMHD(4)                     00013440
      DATA ISIMHD(1),ISIMHD(2),ISIMHD(3),ISIMHD(4)/12,31212,32,52/      00013450
      DATA IDTYPE/-1/                                                   00013460
      DATA U(1),U(2),U(3),U(4),U(5)/5.,-5.,10.,-10.,25./                00013470
      DATA U(6),U(7),U(8),U(9)/-25.,50.,-50.,0./                        00013480
      DATA LASTX,LASTY/-1,-1/                                           00013490
      IF(KDASHT .LT. 0)GO TO 320                                        00013500
C * SET TERMINAL FOR HARDWARE DASHED LINES                              00013510
C * THIS SECTION IS FOR 4014 ENHANCED **********************************00013520
      IF(KDASHT .GT. 4)GO TO 101                                        00013530
      IF(KTERM .GE. 3)GO TO 103                                         00013540
      IF(KDASHT .EQ. 0)GO TO 330                                        00013550
C * HARDWARE DASH SIMULATION FOR TYPE 1 + 2 TERMINALS                   00013560
      KDASHT=ISIMHD(KDASHT)                                             00013570
101   IF(KLINE .EQ. 0)GO TO 104                                         00013580
      KLINE=0                                                           00013590
      CALL CWSEND                                                       00013600
      GO TO 104                                                         00013610
C * SET AND TRANSMIT HARDWARE DASH CODE                                 00013620
103   IF(KLINE .EQ. KDASHT)GO TO 330                                    00013630
      KLINE=KDASHT                                                      00013640
      CALL CWSEND                                                       00013650
      GO TO 330                                                         00013660
104   CONTINUE                                                          00013670
C **********************************************************************00013680
      IF(KDASHT .EQ. 0)GO TO 330                                        00013690
      IF(KDASHT .EQ. IDTYPE)GO TO 170                                   00013700
C * BUILD NEW DASH TABLE                                                00013710
      ICHAR=KDASHT                                                      00013720
      DO 140 NO=1,10                                                    00013730
120   IF(ICHAR)130,150,130                                              00013740
130   I=ICHAR-((ICHAR/10)*10)                                           00013750
      ICHAR=ICHAR/10                                                    00013760
      IF(I)140,120,140                                                  00013770
140   WORK(NO)=U(I)                                                     00013780
      NO=11                                                             00013790
150   NO=NO-1                                                           00013800
C * INVERT TABLE AND STORE IN DTABLE                                    00013810
      DO 160 I=1,NO                                                     00013820
      ISUB=NO+1-I                                                       00013830
160   DTABL(I)=WORK(ISUB)                                               00013840
C * MODIFIY TABLE TO COMPENSATE FOR FLARE                               00013850
      D1=DTABL(1)                                                       00013860
      NUM=NO-1                                                          00013870
      DO 165 K=1,NUM                                                    00013880
      DCUR=DTABL(K)                                                     00013890
      IF(DCUR*DTABL(K+1).GT.0. .OR. DCUR*D1 .LT.0.)GO TO 165            00013900
      DTABL(K)=DTABL(K)-1.                                              00013910
      DTABL(K+1)=DTABL(K+1)-1.                                          00013920
165   CONTINUE                                                          00013930
      IDTYPE=KDASHT                                                     00013940
      I=0                                                               00013950
      SEGLEN=0                                                          00013960
C * BRANCH FOR ALTERNATING AND SOLID                                    00013970
170   IF(NO-1)320,330,180                                               00013980
180   IF(LASTX-KBEAMX)200,190,200                                       00013990
190   IF(LASTY-KBEAMY)200,210,200                                       00014000
C * SET START OF SEQUENCE IF NOT INTERRUPTED BY A MOVE                  00014010
200   SEGLEN=0                                                          00014020
      I=0                                                               00014030
C * COMPUTE NEXT SEGMENT LENGTH                                         00014040
210   X=FLOAT(KBEAMX)                                                   00014050
      Y=FLOAT(KBEAMY)                                                   00014060
      DX=FLOAT(IX-KBEAMX)                                               00014070
      DY=FLOAT(IY-KBEAMY)                                               00014080
      DIAG=SQRT(DX*DX+DY*DY)                                            00014090
      DIST=DIAG                                                         00014100
      IF (SEGLEN-1.5)220,220,230                                        00014110
220   I=MOD(I,NO)+1                                                     00014120
      SEGLEN=ABS(DTABL(I))                                              00014130
230   IF(SEGLEN-DIST)240,270,270                                        00014140
240   F=SEGLEN/DIAG                                                     00014150
      X=X+DX*F                                                          00014160
      Y=Y+DY*F                                                          00014170
      IF (DTABL(I))250,250,260                                          00014180
C * OUTPUT A GS FOR A DARK VECTOR                                       00014190
250   CALL TOUTPT(29)                                                   00014200
      KMOVEF=1                                                          00014210
260   CALL XYCNVT(IFIX(X),IFIX(Y))                                      00014220
C * CALCULATE REMAINING DISTANCE TO POINT                               00014230
      DIST=DIST-SEGLEN                                                  00014240
      SEGLEN=0                                                          00014250
      GO TO 220                                                         00014260
270   IF(DTABL(I))280,280,290                                           00014270
280   CALL TOUTPT(29)                                                   00014280
      KMOVEF=1                                                          00014290
C * THAT WAS A GS FOR AN INVISIBLE LINE                                 00014300
290   CALL XYCNVT(IX,IY)                                                00014310
      LASTX=IX                                                          00014320
      LASTY=IY                                                          00014330
C * CALCULATE SEGMENT FRAGMENT UNUSED                                   00014340
      SEGLEN=SEGLEN-DIST                                                00014350
      GO TO 340                                                         00014360
320   CALL TOUTPT(29)                                                   00014370
      KMOVEF=1                                                          00014380
330   CALL XYCNVT(IX,IY)                                                00014390
      NO=1-NO                                                           00014400
      IDTYPE=KDASHT                                                     00014410
340   RETURN                                                            00014420
      END                                                               00014430

C----------SUBROUTINE--HDCOPY------------------------TEKTRONIX, INC.----00014450
      SUBROUTINE HDCOPY                                                 00014470
      DIMENSION ICODE(2)                                                00014480
      DATA ICODE(1),ICODE(2)/27,23/                                     00014490
C *  OUTPUT (ESC) (ETB) TO START HARD COPY                              00014500
      CALL TOUTST(2,ICODE)                                              00014510
      CALL IOWAIT(180)                                                  00014520
      RETURN                                                            00014530
      END                                                               00014540
C----------FUNCTION----KIN---------------------------TEKTRONIX, INC.----00014560
      FUNCTION KIN(RI)                                                  00014580
      COMMON /TKTRNX/ TMINVX,TMINVY,TMAXVX,TMAXVY,TREALX,TREALY,        00014590
     1 TIMAGX,TIMAGY,TRCOSF,TRSINF,TRSCAL,TRFACX,TRFACY,                00014600
     2 TRPAR1,TRPAR2,TRPAR3,TRPAR4,TRPAR5,TRPAR6,KMOFLG(8),KPAD2,       00014610
     3 KBAUDR,KGNFLG,KGRAFL,KHOMEY,KKMODE,KHORSZ,KVERSZ,KTBLSZ,         00014620
     4 KSIZEF,KLMRGN,KRMRGN,KFACTR,KTERM,KLINE,KZAXIS,KBEAMX,KBEAMY,    00014630
     5 KMOVEF,KPCHAR(5),KDASHT,KMINSX,KMINSY,KMAXSX,KMAXSY,KEYCON,      00014640
     6 KINLFT,KOTLFT,KUNIT                                              00014650
      KIN=RI*546.0/FLOAT(KFACTR)                                        00014660
C * USE APPROPRIATE FACTOR FOR LARGE SCREEN TERMINALS                   00014670
      IF(KTERM .GT. 1)KIN=RI*285.7/FLOAT(KFACTR)                        00014680
      RETURN                                                            00014690
      END                                                               00014700
C----------FUNCTION----KCM---------------------------TEKTRONIX, INC.----00014720
      FUNCTION KCM(RC)                                                  00014740
      COMMON /TKTRNX/ TMINVX,TMINVY,TMAXVX,TMAXVY,TREALX,TREALY,        00014750
     1 TIMAGX,TIMAGY,TRCOSF,TRSINF,TRSCAL,TRFACX,TRFACY,                00014760
     2 TRPAR1,TRPAR2,TRPAR3,TRPAR4,TRPAR5,TRPAR6,KMOFLG(8),KPAD2,       00014770
     3 KBAUDR,KGNFLG,KGRAFL,KHOMEY,KKMODE,KHORSZ,KVERSZ,KTBLSZ,         00014780
     4 KSIZEF,KLMRGN,KRMRGN,KFACTR,KTERM,KLINE,KZAXIS,KBEAMX,KBEAMY,    00014790
     5 KMOVEF,KPCHAR(5),KDASHT,KMINSX,KMINSY,KMAXSX,KMAXSY,KEYCON,      00014800
     6 KINLFT,KOTLFT,KUNIT                                              00014810
      KCM=RC*215.2/FLOAT(KFACTR)                                        00014820
C * USE APPROPRIATE FACTOR FOR LARGE SCREEN TERMINALS                   00014830
      IF(KTERM .GT. 1)KCM=RC*112.48/FLOAT(KFACTR)                       00014840
      RETURN                                                            00014850
      END                                                               00014860

C----------SUBROUTINE--DCURSR------------------------TEKTRONIX, INC.----00014880
      SUBROUTINE DCURSR(ICHAR,IX,IY)                                    00014900
      CALL SCURSR(ICHAR,IX,IY)                                          00014910
      RETURN                                                            00014920
      END                                                               00014930

C----------SUBROUTINE--SCURSR------------------------TEKTRONIX, INC.----00014950
      SUBROUTINE SCURSR(ICHAR,IX,IY)                                    00014970
      COMMON /TKTRNX/ TMINVX,TMINVY,TMAXVX,TMAXVY,TREALX,TREALY,        00014980
     1 TIMAGX,TIMAGY,TRCOSF,TRSINF,TRSCAL,TRFACX,TRFACY,                00014990
     2 TRPAR1,TRPAR2,TRPAR3,TRPAR4,TRPAR5,TRPAR6,KMOFLG(8),KPAD2,       00015000
     3 KBAUDR,KGNFLG,KGRAFL,KHOMEY,KKMODE,KHORSZ,KVERSZ,KTBLSZ,         00015010
     4 KSIZEF,KLMRGN,KRMRGN,KFACTR,KTERM,KLINE,KZAXIS,KBEAMX,KBEAMY,    00015020
     5 KMOVEF,KPCHAR(5),KDASHT,KMINSX,KMINSY,KMAXSX,KMAXSY,KEYCON,      00015030
     6 KINLFT,KOTLFT,KUNIT                                              00015040
      DIMENSION ICODE(2),IN(5)                                          00015050
      DATA ICODE(1),ICODE(2)/27,26/                                     00015060
C * SET THE GRAPHIC INPUT FLAG
	KMOFLG(1)=1
C * OUTPUT (ESC) (SUB) TO TURN ON CURSOR                                00015070
      CALL TOUTST(2,ICODE)                                              00015080
C * CURSER SHOULD ALWAYS INPUT A NEW BUFFER                             00015090
      KINLFT=0                                                          00015100
      CALL TINSTR(5,IN)                                                 00015110
C * REMOVE THE GRAPHIC INPUT FLAG
	KMOFLG(1)=0
C * RESTORE THE TERMINAL STATUS                                         00015120
      CALL RECOVR                                                       00015130
      ICHAR=IN(1)                                                       00015140
C * DECODE SCREEN CO-ORDINATES                                          00015150
      IX=MOD(IN(2),32)*32+MOD(IN(3),32)                                 00015160
      IY=MOD(IN(4),32)*32+MOD(IN(5),32)                                 00015170
C * APPLY SCREEN SCALE FACTOR                                           00015180
      IX=IX*4/KFACTR                                                    00015190
      IY=IY*4/KFACTR                                                    00015200
      RETURN                                                            00015210
      END                                                               00015220

C----------SUBROUTINE--A1IN--------------------------TEKTRONIX, INC.----00015240
      SUBROUTINE A1IN(NCHAR,IA1)                                        00015260
      DIMENSION IADE(72),IA1(1)                                         00015270
	DATA MAXLEN/72/
	LEN=NCHAR
	IF(LEN.GT.MAXLEN)LEN=MAXLEN
      CALL TINSTR(LEN,IADE)                                           
      CALL KAS2A1(LEN,IADE,IA1)                                       
      RETURN                                                            00015300
      END                                                               00015310

C----------SUBROUTINE--AINST-------------------------TEKTRONIX, INC.----00015330
      SUBROUTINE AINST(NCHAR,IAM)                                       00015350
      DIMENSION IADE(72),IAM(1)                                         00015360
	DATA MAXLEN/72/
	LEN=NCHAR
	IF(LEN.GT.MAXLEN)LEN=MAXLEN
      CALL TINSTR(LEN,IADE)                                           
      CALL KAS2AM(LEN,IADE,IAM)                                       
      RETURN                                                            00015390
      END                                                               00015400

C----------SUBROUTINE--TINPUT------------------------TEKTRONIX, INC.----00015420
      SUBROUTINE TINPUT(IN)                                             00015440
      DIMENSION INT(1)                                                  00015450
      CALL TINSTR(1,INT)                                                00015460
      IN=INT(1)                                                         00015470
      RETURN                                                            00015480
      END                                                               00015490

C----------SUBROUTINE--TINSTR------------------------TEKTRONIX, INC.----00015510
      SUBROUTINE TINSTR(NCHAR,IADE)                                     00015530
      COMMON /TKTRNX/ TMINVX,TMINVY,TMAXVX,TMAXVY,TREALX,TREALY,        00015540
     1 TIMAGX,TIMAGY,TRCOSF,TRSINF,TRSCAL,TRFACX,TRFACY,                00015550
     2 TRPAR1,TRPAR2,TRPAR3,TRPAR4,TRPAR5,TRPAR6,KMOFLG(8),KPAD2,       00015560
     3 KBAUDR,KGNFLG,KGRAFL,KHOMEY,KKMODE,KHORSZ,KVERSZ,KTBLSZ,         00015570
     4 KSIZEF,KLMRGN,KRMRGN,KFACTR,KTERM,KLINE,KZAXIS,KBEAMX,KBEAMY,    00015580
     5 KMOVEF,KPCHAR(5),KDASHT,KMINSX,KMINSY,KMAXSX,KMAXSY,KEYCON,      00015590
     6 KINLFT,KOTLFT,KUNIT                                              00015600
      DIMENSION INBUFF(72),IADE(1)                                      00015610
      DATA ISENT,IGOT,IPAD/0,0,32/                                      00015620
      IF(KINLFT .GT. 0)GO TO 10                                         00015630
C * REQUEST A NEW INPUT BUFFER                                          00015640
C * PUT OUT THE OUTPUT BUFFER                                           00015650
      CALL TSEND                                                        00015660
      CALL ADEIN(IGOT,INBUFF)                                           00015670
      ISENT=0                                                           00015680
      KINLFT=IGOT                                                       00015690
10    LEN=NCHAR                                                         00015700
      IF(LEN .LE. 0)GO TO 50                                            00015720
      DO 20 I=1,LEN                                                     00015730
      ISENT=ISENT+1                                                     00015740
	ITMP=I
	IF(ISENT.GT.IGOT)GO TO 30
20    IADE(I)=INBUFF(ISENT)                                             00015750
      KINLFT=IGOT-ISENT                                                 00015760
	GO TO 50
C * PAD WITH BLANKS WHEN NEEDED                                         00015780
30	DO 40 I=ITMP,LEN
40	IADE(I)=IPAD
      KINLFT=0                                                          00015830
50    RETURN                                                            00015840
      END                                                               00015850

C----------SUBROUTINE--SVSTAT------------------------TEKTRONIX, INC.----00015870
      SUBROUTINE SVSTAT(RARRAY)                                         00015890
      COMMON /TKTRNX/ TMINVX,TMINVY,TMAXVX,TMAXVY,TREALX,TREALY,        00015900
     1 TIMAGX,TIMAGY,TRCOSF,TRSINF,TRSCAL,TRFACX,TRFACY,                00015910
     2 TRPAR1,TRPAR2,TRPAR3,TRPAR4,TRPAR5,TRPAR6,KMOFLG(8),KPAD2,       00015920
     3 KBAUDR,KGNFLG,KGRAFL,KHOMEY,KKMODE,KHORSZ,KVERSZ,KTBLSZ,         00015930
     4 KSIZEF,KLMRGN,KRMRGN,KFACTR,KTERM,KLINE,KZAXIS,KBEAMX,KBEAMY,    00015940
     5 KMOVEF,KPCHAR(5),KDASHT,KMINSX,KMINSY,KMAXSX,KMAXSY,KEYCON,      00015950
     6 KINLFT,KOTLFT,KUNIT                                              00015960
      DIMENSION RARRAY(60),IB(41),RB(19)                                00015970
      EQUIVALENCE (IB(1),KMOFLG(1)),(RB(1),TMINVX)                      00015980
C * COPY TERMINAL STATUS AREA INTO GIVEN SAVE ARRAY                     00015990
      DO 100 I=1,19                                                     00016000
100   RARRAY(I)=RB(I)                                                   00016010
      DO 101 I=1,41                                                     00016020
101   RARRAY(I+19)=IB(I)                                                00016030
      RETURN                                                            00016040
      END                                                               00016050

C----------SUBROUTINE--RESTAT------------------------TEKTRONIX, INC.----00016070
      SUBROUTINE RESTAT(RARRAY)                                         00016090
      COMMON /TKTRNX/ TMINVX,TMINVY,TMAXVX,TMAXVY,TREALX,TREALY,        00016100
     1 TIMAGX,TIMAGY,TRCOSF,TRSINF,TRSCAL,TRFACX,TRFACY,                00016110
     2 TRPAR1,TRPAR2,TRPAR3,TRPAR4,TRPAR5,TRPAR6,KMOFLG(8),KPAD2,       00016120
     3 KBAUDR,KGNFLG,KGRAFL,KHOMEY,KKMODE,KHORSZ,KVERSZ,KTBLSZ,         00016130
     4 KSIZEF,KLMRGN,KRMRGN,KFACTR,KTERM,KLINE,KZAXIS,KBEAMX,KBEAMY,    00016140
     5 KMOVEF,KPCHAR(5),KDASHT,KMINSX,KMINSY,KMAXSX,KMAXSY,KEYCON,      00016150
     6 KINLFT,KOTLFT,KUNIT                                              00016160
      DIMENSION RARRAY(60),IB(41),RB(19)                                00016170
      EQUIVALENCE (IB(1),KMOFLG(1)),(RB(1),TMINVX)                      00016180
C * COPY GIVEN STATUS INTO TCS COMMON                                   00016190
      DO 100 I=1,19                                                     00016200
100   RB(I)=RARRAY(I)                                                   00016210
      DO 101 I=1,41                                                     00016220
101   IB(I)=RARRAY(I+19)                                                00016230
C * RESTORE CHARACTER SIZE                                              00016240
      IF(KTERM .GT. 1)CALL CHRSIZ(KSIZEF)                               00016250
C * RESTORE ZAXIS AND DASH LINE                                         00016260
      IF(KTERM .GT. 2)CALL CWSEND                                       00016270
C * CALL TO RECOVER POSITION AND MODE                                   00016280
      CALL RECOVR                                                       00016290
      RETURN                                                            00016300
      END                                                               00016310

C----------SUBROUTINE--INITT-------------------------TEKTRONIX, INC.----00016330
      SUBROUTINE INITT(IBAUD)                                           00016350
      COMMON /TKTRNX/ TMINVX,TMINVY,TMAXVX,TMAXVY,TREALX,TREALY,        00016360
     1 TIMAGX,TIMAGY,TRCOSF,TRSINF,TRSCAL,TRFACX,TRFACY,                00016370
     2 TRPAR1,TRPAR2,TRPAR3,TRPAR4,TRPAR5,TRPAR6,KMOFLG(8),KPAD2,       00016380
     3 KBAUDR,KGNFLG,KGRAFL,KHOMEY,KKMODE,KHORSZ,KVERSZ,KTBLSZ,         00016390
     4 KSIZEF,KLMRGN,KRMRGN,KFACTR,KTERM,KLINE,KZAXIS,KBEAMX,KBEAMY,    00016400
     5 KMOVEF,KPCHAR(5),KDASHT,KMINSX,KMINSY,KMAXSX,KMAXSY,KEYCON,      00016410
     6 KINLFT,KOTLFT,KUNIT                                              00016420
      KKMODE=1
      KBAUDR=IBAUD                                                      00016430
      KPAD2=KBAUDR/220+1                                                00016440
	KMOFLG(1)=0
      KTERM=1                                                           00016450
      KFACTR=4                                                          00016460
C * SET THE OUTPUT BUFFER FORMAT                                        00016470
      KUNIT=1                                                           00016480
      KINLFT=0                                                          00016490
      KOTLFT=1                                                          00016500
      CALL RESET                                                        00016510
      CALL NEWPAG                                                       00016520
      RETURN                                                            00016530
      END                                                               00016540

C----------SUBROUTINE--SEELOC------------------------TEKTRONIX, INC.----00016560
      SUBROUTINE SEELOC(IX,IY)                                          00016580
      COMMON /TKTRNX/ TMINVX,TMINVY,TMAXVX,TMAXVY,TREALX,TREALY,        00016590
     1 TIMAGX,TIMAGY,TRCOSF,TRSINF,TRSCAL,TRFACX,TRFACY,                00016600
     2 TRPAR1,TRPAR2,TRPAR3,TRPAR4,TRPAR5,TRPAR6,KMOFLG(8),KPAD2,       00016610
     3 KBAUDR,KGNFLG,KGRAFL,KHOMEY,KKMODE,KHORSZ,KVERSZ,KTBLSZ,         00016620
     4 KSIZEF,KLMRGN,KRMRGN,KFACTR,KTERM,KLINE,KZAXIS,KBEAMX,KBEAMY,    00016630
     5 KMOVEF,KPCHAR(5),KDASHT,KMINSX,KMINSY,KMAXSX,KMAXSY,KEYCON,      00016640
     6 KINLFT,KOTLFT,KUNIT                                              00016650
      IX=KBEAMX                                                         00016660
      IY=KBEAMY                                                         00016670
      RETURN                                                            00016680
      END                                                               00016690

C----------SUBROUTINE--SEEBUF------------------------TEKTRONIX, INC.----00016710
      SUBROUTINE SEEBUF(KFORM)                                          00016730
      COMMON /TKTRNX/ TMINVX,TMINVY,TMAXVX,TMAXVY,TREALX,TREA Y,        00016740
     1 TIMAGX,TIMAGY,TRCOSF,TRSINF,TRSCAL,TRFACX,TRFACY,                00016750
     2 TRPAR1,TRPAR2,TRPAR3,TRPAR4,TRPAR5,TRPAR6,KMOFLG(8),KPAD2,       00016760
     3 KBAUDR,KGNFLG,KGRAFL,KHOMEY,KKMODE,KHORSZ,KVERSZ,KTBLSZ,         00016770
     4 KSIZEF,KLMRGN,KRMRGN,KFACTR,KTERM,KLINE,KZAXIS,KBEAMX,KBEAMY,    00016780
     5 KMOVEF,KPCHAR(5),KDASHT,KMINSX,KMINSY,KMAXSX,KMAXSY,KEYCON,      00016790
     6 KINLFT,KOTLFT,KUNIT                                              00016800
      KFORM=KUNIT                                                       00016810
      RETURN                                                            00016820
      END                                                               00016830

C----------SUBROUTINE--SETBUF------------------------TEKTRONIX, INC.----00016850
      SUBROUTINE SETBUF(KFORM)                                          00016870
      COMMON /TKTRNX/ TMINVX,TMINVY,TMAXVX,TMAXVY,TREALX,TREALY,        00016880
     1 TIMAGX,TIMAGY,TRCOSF,TRSINF,TRSCAL,TRFACX,TRFACY,                00016890
     2 TRPAR1,TRPAR2,TRPAR3,TRPAR4,TRPAR5,TRPAR6,KMOFLG(8),KPAD2,       00016900
     3 KBAUDR,KGNFLG,KGRAFL,KHOMEY,KKMODE,KHORSZ,KVERSZ,KTBLSZ,         00016910
     4 KSIZEF,KLMRGN,KRMRGN,KFACTR,KTERM,KLINE,KZAXIS,KBEAMX,KBEAMY,    00016920
     5 KMOVEF,KPCHAR(5),KDASHT,KMINSX,KMINSY,KMAXSX,KMAXSY,KEYCON,      00016930
     6 KINLFT,KOTLFT,KUNIT                                              00016940
      KUNIT=KFORM                                                       00016950
C * CHECK FOR OUT OF BOUNDS FORMAT TYPES                                00016960
      IF(KUNIT .LT. 1)KUNIT=1                                           00016970
      IF(KUNIT .GT. 4)KUNIT=4                                           00016980
      RETURN                                                            00016990
      END                                                               00017000
C----------FUNCTION----LEFTIO------------------------TEKTRONIX, INC.----00017020
      FUNCTION LEFTIO(IOBUF)                                            00017040
      COMMON /TKTRNX/ TMINVX,TMINVY,TMAXVX,TMAXVY,TREALX,TREALY,        00017050
     1 TIMAGX,TIMAGY,TRCOSF,TRSINF,TRSCAL,TRFACX,TRFACY,                00017060
     2 TRPAR1,TRPAR2,TRPAR3,TRPAR4,TRPAR5,TRPAR6,KMOFLG(8),KPAD2,       00017070
     3 KBAUDR,KGNFLG,KGRAFL,KHOMEY,KKMODE,KHORSZ,KVERSZ,KTBLSZ,         00017080
     4 KSIZEF,KLMRGN,KRMRGN,KFACTR,KTERM,KLINE,KZAXIS,KBEAMX,KBEAMY,    00017090
     5 KMOVEF,KPCHAR(5),KDASHT,KMINSX,KMINSY,KMAXSX,KMAXSY,KEYCON,      00017100
     6 KINLFT,KOTLFT,KUNIT                                              00017110
      ITEMP=KINLFT                                                      00017120
      IF(IOBUF .EQ. 0)ITEMP=KOTLFT                                      00017130
      LEFTIO=ITEMP                                                      00017140
      RETURN                                                            00017150
      END                                                               00017160

C----------SUBROUTINE--RESET-------------------------TEKTRONIX, INC.----00017180
      SUBROUTINE RESET                                                  00017200
      COMMON /TKTRNX/ TMINVX,TMINVY,TMAXVX,TMAXVY,TREALX,TREALY,        00017210
     1 TIMAGX,TIMAGY,TRCOSF,TRSINF,TRSCAL,TRFACX,TRFACY,                00017220
     2 TRPAR1,TRPAR2,TRPAR3,TRPAR4,TRPAR5,TRPAR6,KMOFLG(8),KPAD2,       00017230
     3 KBAUDR,KGNFLG,KGRAFL,KHOMEY,KKMODE,KHORSZ,KVERSZ,KTBLSZ,         00017240
     4 KSIZEF,KLMRGN,KRMRGN,KFACTR,KTERM,KLINE,KZAXIS,KBEAMX,KBEAMY,    00017250
     5 KMOVEF,KPCHAR(5),KDASHT,KMINSX,KMINSY,KMAXSX,KMAXSY,KEYCON,      00017260
     6 KINLFT,KOTLFT,KUNIT                                              00017270
      KEYCON=1                                                          00017280
      TRFACX=1.                                                         00017290
      TRFACY=1.                                                         00017300
      KBEAMX=0                                                          00017310
      KHOMEY=3068/KFACTR                                                00017320
      KBEAMY=KHOMEY                                                     00017330
      KMINSX=0                                                          00017340
      KMAXSX=4095/KFACTR                                                00017350
      KMINSY=0                                                          00017360
      KMAXSY=3120/KFACTR                                                00017370
      KHORSZ=56                                                         00017380
      KLINE=0                                                           00017390
      KZAXIS=0                                                          00017400
      KLMRGN=0                                                          00017410
      KRMRGN=4088/KFACTR                                                00017420
      KSIZEF=1                                                          00017430
      KTBLSZ=10                                                         00017440
      KVERSZ=88                                                         00017450
      TMINVX=0.                                                         00017460
      TMAXVX=4095./FLOAT(KFACTR)                                        00017470
      TMINVY=0.                                                         00017480
      TMAXVY=3120./FLOAT(KFACTR)                                        00017490
      TRCOSF=1.                                                         00017500
      TRSINF=0.                                                         00017510
      TRSCAL=1.                                                         00017520
C * MOVE TO THE HOME POSITION                                           00017530
      CALL MOVABS(KLMRGN,KHOMEY)                                        00017540
C * SET 4014 ENHANCED FOR SOLID LINES                                   00017550
      IF(KTERM .GE. 3)CALL CWSEND                                       00017560
C * PLACE 4014 IN LARGE CHARACTER SIZE                                  00017570
      IF(KTERM .GE. 2)CALL CHRSIZ(1)                                    00017580
C * PLACE THE TERMINAL IN A/N MODE                                      00017590
      CALL ALFMOD                                                       00017600
      RETURN                                                            00017610
      END                                                               00017620

C----------SUBROUTINE--TKPNT-------------------------TEKTRONIX, INC.----00017640
      SUBROUTINE TKPNT(IX,IY)                                           00017660
      COMMON /TKTRNX/ TMINVX,TMINVY,TMAXVX,TMAXVY,TREALX,TREALY,        00017670
     1 TIMAGX,TIMAGY,TRCOSF,TRSINF,TRSCAL,TRFACX,TRFACY,                00017680
     2 TRPAR1,TRPAR2,TRPAR3,TRPAR4,TRPAR5,TRPAR6,KMOFLG(8),KPAD2,       00017690
     3 KBAUDR,KGNFLG,KGRAFL,KHOMEY,KKMODE,KHORSZ,KVERSZ,KTBLSZ,         00017700
     4 KSIZEF,KLMRGN,KRMRGN,KFACTR,KTERM,KLINE,KZAXIS,KBEAMX,KBEAMY,    00017710
     5 KMOVEF,KPCHAR(5),KDASHT,KMINSX,KMINSY,KMAXSX,KMAXSY,KEYCON,      00017720
     6 KINLFT,KOTLFT,KUNIT                                              00017730
      IF(KTERM .GE. 3)GO TO 10                                          00017740
C * PUT OUT A GS FOR SIMULATED POINT PLOT MODE                          00017750
      CALL TOUTPT(29)                                                   00017760
      KMOVEF=1                                                          00017770
C * MOVE TO POINT                                                       00017780
      CALL XYCNVT(IX,IY)                                                00017790
C * DRAW  POINT                                                         00017800
10    CALL XYCNVT(IX,IY)                                                00017810
      RETURN                                                            00017820
      END                                                               00017830
C----------FUNCTION----GENFLG------------------------TEKTRONIX, INC.----00017850
      LOGICAL FUNCTION GENFLG(ITEM)                                     00017870
      COMMON /TKTRNX/ TMINVX,TMINVY,TMAXVX,TMAXVY,TREALX,TREALY,        00017880
     1 TIMAGX,TIMAGY,TRCOSF,TRSINF,TRSCAL,TRFACX,TRFACY,                00017890
     2 TRPAR1,TRPAR2,TRPAR3,TRPAR4,TRPAR5,TRPAR6,KMOFLG(8),KPAD2,       00017900
     3 KBAUDR,KGNFLG,KGRAFL,KHOMEY,KKMODE,KHORSZ,KVERSZ,KTBLSZ,         00017910
     4 KSIZEF,KLMRGN,KRMRGN,KFACTR,KTERM,KLINE,KZAXIS,KBEAMX,KBEAMY,    00017920
     5 KMOVEF,KPCHAR(5),KDASHT,KMINSX,KMINSY,KMAXSX,KMAXSY,KEYCON,      00017930
     6 KINLFT,KOTLFT,KUNIT                                              00017940
      GENFLG=KGNFLG .EQ. ITEM                                           00017950
      RETURN                                                            00017960
      END                                                               00017970

C----------SUBROUTINE--ANCHO-------------------------TEKTRONIX, INC.----00017990
      SUBROUTINE ANCHO(ICHAR)                                           00018010
      COMMON /TKTRNX/ TMINVX,TMINVY,TMAXVX,TMAXVY,TREALX,TREALY,        00018020
     1 TIMAGX,TIMAGY,TRCOSF,TRSINF,TRSCAL,TRFACX,TRFACY,                00018030
     2 TRPAR1,TRPAR2,TRPAR3,TRPAR4,TRPAR5,TRPAR6,KMOFLG(8),KPAD2,       00018040
     3 KBAUDR,KGNFLG,KGRAFL,KHOMEY,KKMODE,KHORSZ,KVERSZ,KTBLSZ,         00018050
     4 KSIZEF,KLMRGN,KRMRGN,KFACTR,KTERM,KLINE,KZAXIS,KBEAMX,KBEAMY,    00018060
     5 KMOVEF,KPCHAR(5),KDASHT,KMINSX,KMINSY,KMAXSX,KMAXSY,KEYCON,      00018070
     6 KINLFT,KOTLFT,KUNIT                                              00018080
      IF(KKMODE.EQ.0)GO TO 10                                           00018090
      CALL ALFMOD                                                       00018100
10    CALL TOUTPT(ICHAR)                                                00018110
C * ROUND NON-INTEGER CHARACTER WIDTH IN 1023 CO-ORDINATES              00018120
      KBEAMX=KBEAMX+(KHORSZ+KFACTR/2)/KFACTR                            00018130
      IF(KBEAMX.LT.KRMRGN)GO TO 20                                      00018140
      CALL NEWLIN                                                       00018150
20    RETURN                                                            00018160
      END                                                               00018170

C----------SUBROUTINE--A1OUT-------------------------TEKTRONIX, INC.----00018190
      SUBROUTINE A1OUT(NCHAR,IA1)                                       00018210
      DIMENSION IADE(72),IA1(1)                                         00018220
      ITEMP=NCHAR                                                       00018230
      DO 10 I=1,NCHAR,72                                                00018240
      ISEND=72                                                          00018250
      IF(ITEMP .LT. 72)ISEND=ITEMP                                      00018260
      CALL KA12AS(ISEND,IA1(I),IADE)                                    00018270
      CALL ANSTR(ISEND,IADE)                                            00018280
10    ITEMP=ITEMP-72                                                    00018290
      RETURN                                                            00018300
      END                                                               00018310

C----------SUBROUTINE--AOUTST------------------------TEKTRONIX, INC.----00018330
      SUBROUTINE AOUTST(NCHAR,IAM)                                      00018350
      DIMENSION IADE(72),IAM(1)                                         00018360
	DATA MAXLEN/72/
	LEN=NCHAR
	IF(LEN.GT.MAXLEN)LEN=MAXLEN
      CALL KAM2AS(LEN,IAM,IADE)                                       
      CALL ANSTR(LEN,IADE)                                            
      RETURN                                                            00018390
      END                                                               00018400

C----------SUBROUTINE--ANSTR-------------------------TEKTRONIX, INC.----00018420
      SUBROUTINE ANSTR(NCHAR,IADE)                                      00018440
      COMMON /TKTRNX/ TMINVX,TMINVY,TMAXVX,TMAXVY,TREALX,TREALY,        00018450
     1 TIMAGX,TIMAGY,TRCOSF,TRSINF,TRSCAL,TRFACX,TRFACY,                00018460
     2 TRPAR1,TRPAR2,TRPAR3,TRPAR4,TRPAR5,TRPAR6,KMOFLG(8),KPAD2,       00018470
     3 KBAUDR,KGNFLG,KGRAFL,KHOMEY,KKMODE,KHORSZ,KVERSZ,KTBLSZ,         00018480
     4 KSIZEF,KLMRGN,KRMRGN,KFACTR,KTERM,KLINE,KZAXIS,KBEAMX,KBEAMY,    00018490
     5 KMOVEF,KPCHAR(5),KDASHT,KMINSX,KMINSY,KMAXSX,KMAXSY,KEYCON,      00018500
     6 KINLFT,KOTLFT,KUNIT                                              00018510
      DIMENSION IADE(1)                                                 00018520
	MAXLEN=72
	IF(KUNIT.EQ.1)MAXLEN=MAXLEN-10
	IF(KUNIT.EQ.2.OR.KUNIT.EQ.3)MAXLEN=MAXLEN-2
      IPT=1                                                             00018540
C * PLACE THE TERMINAL IN A/N MODE, IF NEEDED                           00018550
      IF(KKMODE .NE. 0)CALL ALFMOD                                      00018560
C * GET A NEWLINE WHEN THE BEAM POSITION IS OUTSIDE MARGINS             00018570
      IF(KBEAMX .LT. KLMRGN)GO TO 10                                    00018580
5	IF(KBEAMX.LE.KRMRGN)GO TO 20
	IF(KBEAMX.LT.4092/KFACTR)GO TO 10
	KBEAMX=KLMRGN
	KBEAMY=KBEAMY-(KVERSZ+KFACTR/2)/KFACTR
	IF(KBEAMY.LT.0)KBEAMY=KHOMEY
	GO TO 20
10    CALL NEWLIN                                                       00018600
C * CALCULATE NUMBER OF CHARACTERS POSSIBLE TO PUT ON LINE              00018610
20    ISEND=((KRMRGN-KBEAMX)*KFACTR+KHORSZ-1)/KHORSZ                    00018620
C * PUT OUT AT LEAST ONE CHARACTER                                      00018630
      IF(ISEND .LT. 1)ISEND=1                                           00018640
C * DON'T SEND ENOUGH CHARACTERS TO CAUSE BUFFER TRUNCATION             00018650
      IF(ISEND .GT. MAXLEN)ISEND=MAXLEN                                 00018660
      IEND=IPT+ISEND-1                                                  00018670
C * SEND ONLY NUMBER OF CHARACTERS RECEIVED                             00018680
      IF(IEND .GT. NCHAR)ISEND=NCHAR-IPT+1                              00018690
      CALL TOUTST(ISEND,IADE(IPT))                                      00018700
C * UPDATE THE BEAM                                                     00018710
      KBEAMX=KBEAMX+(ISEND*KHORSZ+KFACTR/2)/KFACTR                      00018720
	IF(KBEAMX.GT.4092/KFACTR)KBEAMX=4092/KFACTR
      IPT=IPT+ISEND                                                     00018730
C * REPEAT ON NEWLINE UNTIL ALL CHARACTERS SENT                         00018740
      IF(IEND .LT. NCHAR)GO TO 5                                       
      RETURN                                                            00018760
      END                                                               00018770

C----------SUBROUTINE--NEWLIN------------------------TEKTRONIX, INC.----00018790
      SUBROUTINE NEWLIN                                                 00018810
      CALL CARTN                                                        00018820
      CALL LINEF                                                        00018830
      RETURN                                                            00018840
      END                                                               00018850

C----------SUBROUTINE--CARTN-------------------------TEKTRONIX, INC.----00018870

      SUBROUTINE CARTN                                                  00018890
      COMMON /TKTRNX/ TMINVX,TMINVY,TMAXVX,TMAXVY,TREALX,TREALY,        00018900
     1 TIMAGX,TIMAGY,TRCOSF,TRSINF,TRSCAL,TRFACX,TRFACY,                00018910
     2 TRPAR1,TRPAR2,TRPAR3,TRPAR4,TRPAR5,TRPAR6,KMOFLG(8),KPAD2,       00018920
     3 KBAUDR,KGNFLG,KGRAFL,KHOMEY,KKMODE,KHORSZ,KVERSZ,KTBLSZ,         00018930
     4 KSIZEF,KLMRGN,KRMRGN,KFACTR,KTERM,KLINE,KZAXIS,KBEAMX,KBEAMY,    00018940
     5 KMOVEF,KPCHAR(5),KDASHT,KMINSX,KMINSY,KMAXSX,KMAXSY,KEYCON,      00018950
     6 KINLFT,KOTLFT,KUNIT                                              00018960
      IF(KLMRGN.EQ.0)GO TO 10                                           00018970
C * IF (CR) CAN NOT BE SENT REMOVE ALL EXECUTEABLE CODE EXCEPT NEXT 2   00018980
C * LINES AND RETURN                                                    00018990
      CALL MOVABS(KLMRGN,KBEAMY)                                        00019000
      CALL ALFMOD                                                       00019010
      GO TO 30                                                          00019020
10    IF(KKMODE.NE.0)CALL ALFMOD                                        00019030
C * OUTPUT (CR)                                                         00019040
      CALL TOUTPT(13)                                                   00019050
      KBEAMX=0                                                          00019060
C * RESTORE ZAXIS STATE ON 4014                                         00019070
      IF(KTERM .GE. 2)CALL CWSEND                                       00019080
30    RETURN                                                            00019090
      END                                                               00019100

C----------SUBROUTINE--LINEF-------------------------TEKTRONIX, INC.----00019120
      SUBROUTINE LINEF                                                  00019140
      COMMON /TKTRNX/ TMINVX,TMINVY,TMAXVX,TMAXVY,TREALX,TREALY,        00019150
     1 TIMAGX,TIMAGY,TRCOSF,TRSINF,TRSCAL,TRFACX,TRFACY,                00019160
     2 TRPAR1,TRPAR2,TRPAR3,TRPAR4,TRPAR5,TRPAR6,KMOFLG(8),KPAD2,       00019170
     3 KBAUDR,KGNFLG,KGRAFL,KHOMEY,KKMODE,KHORSZ,KVERSZ,KTBLSZ,         00019180
     4 KSIZEF,KLMRGN,KRMRGN,KFACTR,KTERM,KLINE,KZAXIS,KBEAMX,KBEAMY,    00019190
     5 KMOVEF,KPCHAR(5),KDASHT,KMINSX,KMINSY,KMAXSX,KMAXSY,KEYCON,      00019200
     6 KINLFT,KOTLFT,KUNIT                                              00019210
C * IF (LF) CAN NOT BE SENT REMOVE NEXT 2 EXECUTEABLE LINES AND         00019220
C * CHANGE @GO TO@ FROM 200 TO 100                                      00019230
      IF(KKMODE .NE. 0)CALL ALFMOD                                      00019240
C * OUTPUT (LF)                                                         00019250
      CALL TOUTPT(10)                                                   00019260
      KBEAMY=KBEAMY-(KVERSZ+KFACTR/2)/KFACTR                            00019270
      IF(KBEAMY .GE. 0)GO TO 200                                        00019280
      KBEAMY=KHOMEY                                                     00019290
100   CALL MOVABS(KBEAMX,KBEAMY)                                        00019300
      CALL ALFMOD                                                       00019310
C * RESTORE ZAXIS MODE IF APPROPRIATE                                   00019320
200   IF(KTERM .GE. 2)CALL CWSEND                                       00019330
      RETURN                                                            00019340
      END                                                               00019350

C----------SUBROUTINE--BAKSP-------------------------TEKTRONIX, INC.----00019370
      SUBROUTINE BAKSP                                                  00019390
      COMMON /TKTRNX/ TMINVX,TMINVY,TMAXVX,TMAXVY,TREALX,TREALY,        00019400
     1 TIMAGX,TIMAGY,TRCOSF,TRSINF,TRSCAL,TRFACX,TRFACY,                00019410
     2 TRPAR1,TRPAR2,TRPAR3,TRPAR4,TRPAR5,TRPAR6,KMOFLG(8),KPAD2,       00019420
     3 KBAUDR,KGNFLG,KGRAFL,KHOMEY,KKMODE,KHORSZ,KVERSZ,KTBLSZ,         00019430
     4 KSIZEF,KLMRGN,KRMRGN,KFACTR,KTERM,KLINE,KZAXIS,KBEAMX,KBEAMY,    00019440
     5 KMOVEF,KPCHAR(5),KDASHT,KMINSX,KMINSY,KMAXSX,KMAXSY,KEYCON,      00019450
     6 KINLFT,KOTLFT,KUNIT                                              00019460
      IF(KKMODE.NE.0)CALL ALFMOD                                        00019470
C * OUTPUT (BS)                                                         00019480
      CALL TOUTPT(8)                                                    00019490
      KBEAMX=KBEAMX-(KHORSZ+KFACTR/2)/KFACTR                            00019500
      IF(KBEAMX.GE.0)GO TO 10                                           00019510
      KBEAMX=KBEAMX+4095/KFACTR                                         00019520
10    RETURN                                                            00019530
      END                                                               00019540

C----------SUBROUTINE--HOME--------------------------TEKTRONIX, INC.----00019560
      SUBROUTINE HOME                                                   00019580
      COMMON /TKTRNX/ TMINVX,TMINVY,TMAXVX,TMAXVY,TREALX,TREA Y,        00019590
     1 TIMAGX,TIMAGY,TRCOSF,TRSINF,TRSCAL,TRFACX,TRFACY,                00019600
     2 TRPAR1,TRPAR2,TRPAR3,TRPAR4,TRPAR5,TRPAR6,KMOFLG(8),KPAD2,       00019610
     3 KBAUDR,KGNFLG,KGRAFL,KHOMEY,KKMODE,KHORSZ,KVERSZ,KTBLSZ,         00019620
     4 KSIZEF,KLMRGN,KRMRGN,KFACTR,KTERM,KLINE,KZAXIS,KBEAMX,KBEAMY,    00019630
     5 KMOVEF,KPCHAR(5),KDASHT,KMINSX,KMINSY,KMAXSX,KMAXSY,KEYCON,      00019640
     6 KINLFT,KOTLFT,KUNIT                                              00019650
      CALL MOVABS(KLMRGN,KHOMEY)                                        00019660
      CALL ALFMOD                                                       00019670
      RETURN                                                            00019680
      END                                                               00019690

C----------SUBROUTINE--ERASE-------------------------TEKTRONIX, INC.----00019710
      SUBROUTINE ERASE                                                  00019730
      DIMENSION ICODE(2)                                                00019740
      DATA ICODE(1),ICODE(2)/27,12/                                     00019750
      CALL TOUTST(2,ICODE)                                              00019760
      CALL IOWAIT(10)                                                   00019770
      CALL RECOVR                                                       00019780
      RETURN                                                            00019790
      END                                                               00019800

C----------SUBROUTINE--RECOVR------------------------TEKTRONIX, INC.----00019820
      SUBROUTINE RECOVR                                                 00019840
      COMMON /TKTRNX/ TMINVX,TMINVY,TMAXVX,TMAXVY,TREALX,TREALY,        00019850
     1 TIMAGX,TIMAGY,TRCOSF,TRSINF,TRSCAL,TRFACX,TRFACY,                00019860
     2 TRPAR1,TRPAR2,TRPAR3,TRPAR4,TRPAR5,TRPAR6,KMOFLG(8),KPAD2,       00019870
     3 KBAUDR,KGNFLG,KGRAFL,KHOMEY,KKMODE,KHORSZ,KVERSZ,KTBLSZ,         00019880
     4 KSIZEF,KLMRGN,KRMRGN,KFACTR,KTERM,KLINE,KZAXIS,KBEAMX,KBEAMY,    00019890
     5 KMOVEF,KPCHAR(5),KDASHT,KMINSX,KMINSY,KMAXSX,KMAXSY,KEYCON,      00019900
     6 KINLFT,KOTLFT,KUNIT                                              00019910
C  SAVE THE GRAPHIC LEVEL FLAG
	IFLAG=KGRAFL
C * REMOVE MOVE FLAG                                                    00019920
      KMOVEF=0                                                          00019930
C * SAVE THE MODE                                                       00019940
      MODE=KKMODE+1                                                     00019950
C * SAVE THE Y-COORDINATE                                               00019960
      IY=KBEAMY                                                         00019970
C * CLEAR ALL OTHER MODES                                               00019980
      CALL ALFMOD                                                       00019990
C * MOVE TO SCREEN LOCATION                                             00020000
      CALL MOVABS(KBEAMX,IY)                                            00020010
C * SET THE HARDWARE DASH AND Z-AXIS WHEN NEED|D
	IF(KTERM.GE.2)CALL CWSEND
C * PLACE IN THE PROPER MODE                                            00020020
      IF(MODE .LT. 1)MODE=1                                             00020030
      IF(MODE .GT.5)MODE=5                                              00020040
      GO TO (100,200,120,100,200),MODE                                  00020050
100   CALL ALFMOD                                                       00020060
      GO TO 200                                                         00020070
120   CALL PNTMOD                                                       00020080
C * RESTORE THE GRAPHIC LEVEL FLAG
200	KGRAFL=IFLAG
	RETURN
      END                                                               00020100

C----------SUBROUTINE--NEWPAG------------------------TEKTRONIX, INC.----00020120
      SUBROUTINE NEWPAG                                                 00020140
      COMMON /TKTRNX/ TMINVX,TMINVY,TMAXVX,TMAXVY,TREALX,TREALY,        00020150
     1 TIMAGX,TIMAGY,TRCOSF,TRSINF,TRSCAL,TRFACX,TRFACY,                00020160
     2 TRPAR1,TRPAR2,TRPAR3,TRPAR4,TRPAR5,TRPAR6,KMOFLG(8),KPAD2,       00020170
     3 KBAUDR,KGNFLG,KGRAFL,KHOMEY,KKMODE,KHORSZ,KVERSZ,KTBLSZ,         00020180
     4 KSIZEF,KLMRGN,KRMRGN,KFACTR,KTERM,KLINE,KZAXIS,KBEAMX,KBEAMY,    00020190
     5 KMOVEF,KPCHAR(5),KDASHT,KMINSX,KMINSY,KMAXSX,KMAXSY,KEYCON,      00020200
     6 KINLFT,KOTLFT,KUNIT                                              00020210
      DIMENSION ICODE(2)                                                00020220
      DATA ICODE(1),ICODE(2)/27,12/                                     00020230
      IF(KKMODE .NE. 0)CALL ALFMOD                                      00020240
C * OUTPUT (ESC) (FF) FOR NEW PAGE                                      00020250
      CALL TOUTST(2,ICODE)                                              00020260
      CALL IOWAIT(10)                                                   00020270
      IF(KLMRGN.EQ.0)GO TO 10                                           00020280
      CALL MOVABS(KLMRGN,KHOMEY)                                        00020290
      CALL ALFMOD                                                       00020300
      GO TO 20                                                          00020310
10    KBEAMX=0                                                          00020320
      KBEAMY=KHOMEY                                                     00020330
20    RETURN                                                            00020340
      END                                                               00020350
C                                                                       00020360

C----------SUBROUTINE--ALFMOD------------------------TEKTRONIX, INC.----00020370
C                                                                       00020380
      SUBROUTINE ALFMOD                                                 00020390
      COMMON /TKTRNX/ TMINVX,TMINVY,TMAXVX,TMAXVY,TREALX,TREALY,        00020400
     1 TIMAGX,TIMAGY,TRCOSF,TRSINF,TRSCAL,TRFACX,TRFACY,                00020410
     2 TRPAR1,TRPAR2,TRPAR3,TRPAR4,TRPAR5,TRPAR6,KMOFLG(8),KPAD2,       00020420
     3 KBAUDR,KGNFLG,KGRAFL,KHOMEY,KKMODE,KHORSZ,KVERSZ,KTBLSZ,         00020430
     4 KSIZEF,KLMRGN,KRMRGN,KFACTR,KTERM,KLINE,KZAXIS,KBEAMX,KBEAMY,    00020440
     5 KMOVEF,KPCHAR(5),KDASHT,KMINSX,KMINSY,KMAXSX,KMAXSY,KEYCON,      00020450
     6 KINLFT,KOTLFT,KUNIT                                              00020460
C * SET ALPHA MODE OUTPUT (US)                                          00020470
      CALL TOUTPT(31)                                                   00020480
      KKMODE=0                                                          00020490
      IF(KBEAMY.GT.KHOMEY) KBEAMY=KHOMEY                                00020500
      RETURN                                                            00020510
      END                                                               00020520
C                                                                       00020530

C----------SUBROUTINE--MOVABS------------------------TEKTRONIX, INC.----00020540
C                                                                       00020550
      SUBROUTINE MOVABS(IX,IY)                                          00020560
      COMMON /TKTRNX/ TMINVX,TMINVY,TMAXVX,TMAXVY,TREALX,TREALY,        00020570
     1 TIMAGX,TIMAGY,TRCOSF,TRSINF,TRSCAL,TRFACX,TRFACY,                00020580
     2 TRPAR1,TRPAR2,TRPAR3,TRPAR4,TRPAR5,TRPAR6,KMOFLG(8),KPAD2,       00020590
     3 KBAUDR,KGNFLG,KGRAFL,KHOMEY,KKMODE,KHORSZ,KVERSZ,KTBLSZ,         00020600
     4 KSIZEF,KLMRGN,KRMRGN,KFACTR,KTERM,KLINE,KZAXIS,KBEAMX,KBEAMY,    00020610
     5 KMOVEF,KPCHAR(5),KDASHT,KMINSX,KMINSY,KMAXSX,KMAXSY,KEYCON,      00020620
     6 KINLFT,KOTLFT,KUNIT                                              00020630
      CALL VECMOD                                                       00020640
      CALL XYCNVT(IX,IY)                                                00020650

      KGRAFL=0                                                          00020660
      RETURN                                                            00020670
      END                                                               00020680
C                                                                       00020690

C----------SUBROUTINE--IOWAIT------------------------TEKTRONIX, INC.----00020700
C                                                                       00020710
      SUBROUTINE IOWAIT(ITIME)                                          00020720
C * THIS ROUTINE IS USED TO GENERATE DELAYS FOR REMOTE TERMINALS        00020730
      COMMON /TKTRNX/ TMINVX,TMINVY,TMAXVX,TMAXVY,TREALX,TREALY,        00020740
     1 TIMAGX,TIMAGY,TRCOSF,TRSINF,TRSCAL,TRFACX,TRFACY,                00020750
     2 TRPAR1,TRPAR2,TRPAR3,TRPAR4,TRPAR5,TRPAR6,KMOFLG(8),KPAD2,       00020760
     3 KBAUDR,KGNFLG,KGRAFL,KHOMEY,KKMODE,KHORSZ,KVERSZ,KTBLSZ,         00020770
     4 KSIZEF,KLMRGN,KRMRGN,KFACTR,KTERM,KLINE,KZAXIS,KBEAMX,KBEAMY,    00020780
     5 KMOVEF,KPCHAR(5),KDASHT,KMINSX,KMINSY,KMAXSX,KMAXSY,KEYCON,      00020790
     6 KINLFT,KOTLFT,KUNIT                                              00020800
      IF(KBAUDR.LE.0)GO TO 20                                           00020810
      KOUNT=ITIME*KBAUDR/10                                             00020820
      DO 10 J=1,KOUNT                                                   00020830
C * OUTPUT (SYN) TO INSURE AGAINST LOSS OF OUTPUT WHILE                 00020840
C * TERMINAL IS BUSY. (SYN) DOES NOT AFFECT THE TERMINAL.               00020850
10    CALL TOUTPT(22)                                                   00020860
20    RETURN                                                            00020870
      END                                                               00020880
C                                                                       00020890

C----------SUBROUTINE--VECMOD------------------------TEKTRONIX, INC.----00020900
C                                                                       00020910
      SUBROUTINE VECMOD                                                 00020920
      COMMON /TKTRNX/ TMINVX,TMINVY,TMAXVX,TMAXVY,TREALX,TREALY,        00020930
     1 TIMAGX,TIMAGY,TRCOSF,TRSINF,TRSCAL,TRFACX,TRFACY,                00020940
     2 TRPAR1,TRPAR2,TRPAR3,TRPAR4,TRPAR5,TRPAR6,KMOFLG(8),KPAD2,       00020950
     3 KBAUDR,KGNFLG,KGRAFL,KHOMEY,KKMODE,KHORSZ,KVERSZ,KTBLSZ,         00020960
     4 KSIZEF,KLMRGN,KRMRGN,KFACTR,KTERM,KLINE,KZAXIS,KBEAMX,KBEAMY,    00020970
     5 KMOVEF,KPCHAR(5),KDASHT,KMINSX,KMINSY,KMAXSX,KMAXSY,KEYCON,      00020980
     6 KINLFT,KOTLFT,KUNIT                                              00020990
      IF(KKMODE.EQ.1)GO TO 10                                           00021000
C * OUTPUT (US) TO ENTER A/N MODE AND RESET FOR VECTOR MODE             00021010
      CALL TOUTPT(31)                                                   00021020
      DO 112 II=1,5                                                     00021030
112   KPCHAR(II)=-1                                                     00021040
      KKMODE=1                                                          00021050
C * OUTPUT (GS) TO ENTER VECTOR MODE                                    00021060
10    CALL TOUTPT(29)                                                   00021070
      KMOVEF=1                                                          00021080
      RETURN                                                            00021090
      END                                                               00021100
C                                                                       00021110

C----------SUBROUTINE--CSIZE-------------------------TEKTRONIX, INC.----00021120
C                                                                       00021130
      SUBROUTINE CSIZE(IHORZ,IVERT)                                     00021140
      COMMON /TKTRNX/ TMINVX,TMINVY,TMAXVX,TMAXVY,TREALX,TREALY,        00021150
     1 TIMAGX,TIMAGY,TRCOSF,TRSINF,TRSCAL,TRFACX,TRFACY,                00021160
     2 TRPAR1,TRPAR2,TRPAR3,TRPAR4,TRPAR5,TRPAR6,KMOFLG(8),KPAD2,       00021170
     3 KBAUDR,KGNFLG,KGRAFL,KHOMEY,KKMODE,KHORSZ,KVERSZ,KTBLSZ,         00021180
     4 KSIZEF,KLMRGN,KRMRGN,KFACTR,KTERM,KLINE,KZAXIS,KBEAMX,KBEAMY,    00021190
     5 KMOVEF,KPCHAR(5),KDASHT,KMINSX,KMINSY,KMAXSX,KMAXSY,KEYCON,      00021200
     6 KINLFT,KOTLFT,KUNIT                                              00021210
      IHORZ=(KHORSZ+KFACTR/2)/KFACTR                                    00021220
      IVERT=(KVERSZ+KFACTR/2)/KFACTR                                    00021230
      RETURN                                                            00021240

      END                                                               00021250
C                                                                       00021260

C----------SUBROUTINE--PNTMOD------------------------TEKTRONIX, INC.----00021270
C                                                                       00021280
      SUBROUTINE PNTMOD                                                 00021290
      COMMON /TKTRNX/ TMINVX,TMINVY,TMAXVX,TMAXVY,TREALX,TREALY,        00021300
     1 TIMAGX,TIMAGY,TRCOSF,TRSINF,TRSCAL,TRFACX,TRFACY,                00021310
     2 TRPAR1,TRPAR2,TRPAR3,TRPAR4,TRPAR5,TRPAR6,KMOFLG(8),KPAD2,       00021320
     3 KBAUDR,KGNFLG,KGRAFL,KHOMEY,KKMODE,KHORSZ,KVERSZ,KTBLSZ,         00021330
     4 KSIZEF,KLMRGN,KRMRGN,KFACTR,KTERM,KLINE,KZAXIS,KBEAMX,KBEAMY,    00021340
     5 KMOVEF,KPCHAR(5),KDASHT,KMINSX,KMINSY,KMAXSX,KMAXSY,KEYCON,      00021350
     6 KINLFT,KOTLFT,KUNIT                                              00021360
C * CANCEL PREVIOUS MODES - OUTPUT (US)                                 00021370
      CALL TOUTPT(31)                                                   00021380
      DO 111 II=1,5                                                     00021390
111   KPCHAR(II)=-1                                                     00021400
      KKMODE=2                                                          00021410
C * FOR HARDWARE POINT PLOT OUTPUT AN (FS)                              00021420
      IF(KTERM .GE. 3)CALL TOUTPT(28)                                   00021430
      RETURN                                                            00021440
      END                                                               00021450
C                                                                       00021460

C----------SUBROUTINE--IPMOD-------------------------TEKTRONIX, INC.----00021470
C                                                                       00021480
      SUBROUTINE IPMOD                                                  00021490
      COMMON /TKTRNX/ TMINVX,TMINVY,TMAXVX,TMAXVY,TREALX,TREALY,        00021500
     1 TIMAGX,TIMAGY,TRCOSF,TRSINF,TRSCAL,TRFACX,TRFACY,                00021510
     2 TRPAR1,TRPAR2,TRPAR3,TRPAR4,TRPAR5,TRPAR6,KMOFLG(8),KPAD2,       00021520
     3 KBAUDR,KGNFLG,KGRAFL,KHOMEY,KKMODE,KHORSZ,KVERSZ,KTBLSZ,         00021530
     4 KSIZEF,KLMRGN,KRMRGN,KFACTR,KTERM,KLINE,KZAXIS,KBEAMX,KBEAMY,    00021540
     5 KMOVEF,KPCHAR(5),KDASHT,KMINSX,KMINSY,KMAXSX,KMAXSY,KEYCON,      00021550
     6 KINLFT,KOTLFT,KUNIT                                              00021560
      DIMENSION ICODE(2)                                                00021570
      DATA ICODE(1),ICODE(2)/31,30/                                     00021580
C * OUTPUT (US) TO CANCEL PREVIOUS MODE AND (RS) TO SET INCPLT MODE     00021590
      CALL TOUTST(2,ICODE)                                              00021600
      KKMODE=3                                                          00021610
      KGRAFL=0                                                          00021620
      RETURN                                                            00021630
      END                                                               00021640
C                                                                       00021650

C----------SUBROUTINE--XYCNVT------------------------TEKTRONIX, INC.----00021660
C                                                                       00021670
      SUBROUTINE XYCNVT(IX,IY)                                          00021680
      COMMON /TKTRNX/ TMINVX,TMINVY,TMAXVX,TMAXVY,TREALX,TREALY,        00021690
     1 TIMAGX,TIMAGY,TRCOSF,TRSINF,TRSCAL,TRFACX,TRFACY,                00021700
     2 TRPAR1,TRPAR2,TRPAR3,TRPAR4,TRPAR5,TRPAR6,KMOFLG(8),KPAD2,       00021710
     3 KBAUDR,KGNFLG,KGRAFL,KHOMEY,KKMODE,KHORSZ,KVERSZ,KTBLSZ,         00021720
     4 KSIZEF,KLMRGN,KRMRGN,KFACTR,KTERM,KLINE,KZAXIS,KBEAMX,KBEAMY,    00021730
     5 KMOVEF,KPCHAR(5),KDASHT,KMINSX,KMINSY,KMAXSX,KMAXSY,KEYCON,      00021740
     6 KINLFT,KOTLFT,KUNIT                                              00021750
      DIMENSION IPLT(5),IOPT(5)                                         00021760
      DATA IDREW,ISYN /0,22/                                            00021770
C * RECEIVE THE PLOT CHARACTERS                                         00021780
      CALL PLTCHR(IX,IY,IPLT)                                           00021790
C * OPTIMIZE THE OUTPUT                                                 00021800
      LEN=0                                                             00021810
C * CHECK IF HIGH Y IS NEEDED                                           00021820
      IF(KPCHAR(1) .EQ. IPLT(1))GO TO 10                                00021830

C * INCLUDE HIGH Y IF NEEDED                                            00021840
      LEN=1                                                             00021850
      KPCHAR(1)=IPLT(1)                                                 00021860
      IOPT(1)=IPLT(1)                                                   00021870
C * CHECK IF LSBYX IS NEEDED                                            00021880
10    IF(KTERM .LE. 2)GO TO 20                                          00021890
      IF(KPCHAR(2) .EQ. IPLT(2))GO TO 20                                00021900
C * INCLUDE LSBYX IF NEEDED                                             00021910
      LEN=LEN+1                                                         00021920
      KPCHAR(2)=IPLT(2)                                                 00021930
      IOPT(LEN)=IPLT(2)                                                 00021940
      GO TO 30                                                          00021950
C * CHECK IF LOW Y IS NEEDED                                            00021960
20    IF(KPCHAR(3) .NE. IPLT(3))GO TO 30                                00021970
      IF(KPCHAR(4) .EQ. IPLT(4))GO TO 40                                00021980
C * INCLUDE LOW Y IF NEEDED                                             00021990
30    LEN=LEN+1                                                         00022000
      KPCHAR(3)=IPLT(3)                                                 00022010
      IOPT(LEN)=IPLT(3)                                                 00022020
C * CHECK IF HIGH X IS NEEDED                                           00022030
      IF(KPCHAR(4) .EQ. IPLT(4))GO TO 50                                00022040
C * INCLUDE HIGH X IF NEEDED                                            00022050
      LEN=LEN+1                                                         00022060
      KPCHAR(4)=IPLT(4)                                                 00022070
      IOPT(LEN)=IPLT(4)                                                 00022080
C * CHECK IF LOW X IS NEEDED                                            00022090
40    IF(KPCHAR(5) .NE. IPLT(5))GO TO 50                                00022100
C * CHECK IF ALL THE CHARACTERS ARE THE SAME                            00022110
      IF(LEN .NE. 0)GO TO 50                                            00022120
C * CHECK IF (GS) FOR DARK VECTOR ALREADY SENT                          00022130
      IF(KMOVEF .EQ. 1)GO TO 50                                         00022140
C * CHECK IF VECTOR IS ALREADY DRAWN TO SPOT                            00022150
      IF(IDREW .EQ. 1)GO TO 80                                          00022160
C * INCLUDE THE LOW X                                                   00022170
50    LEN=LEN+1                                                         00022180
      KPCHAR(5)=IPLT(5)                                                 00022190
      IOPT(LEN)=IPLT(5)                                                 00022200
C * CHECK FOR POSSIBLE SPEED PROBLEM                                    00022210
60    IF(LEN .GE. KPAD2)GO TO 70                                        00022220
      LEN=LEN+1                                                         00022230
      IOPT(LEN)=ISYN                                                    00022240
      GO TO 60                                                          00022250
C * SEND THE ARRAY TO THE OUTPUT BUFFER                                 00022260
70    CALL TOUTST(LEN,IOPT)                                             00022270
C * SET THE COMMON AND HISTORY VARIABLES                                00022280
C * SET THE DREW HERE FLAG                                              00022290
      IDREW=1                                                           00022300
C * REMOVE  THE DREW HERE FLAG IF DIDNT DRAW                            00022310
      IF(KMOVEF .EQ. 1)IDREW=0                                          00022320
C * REMOVE THE MOVE FLAG                                                00022330
      KMOVEF=0                                                          00022340
80    KBEAMX=IX                                                         00022350
      KBEAMY=IY                                                         00022360
      RETURN                                                            00022370
      END                                                               00022380
C                                                                       00022390
C----------FUNCTION----LINWDT------------------------TEKTRONIX, INC.----00022400
C                                                                       00022410
      FUNCTION LINWDT(NUMCHR)                                           00022420

      COMMON /TKTRNX/ TMINVX,TMINVY,TMAXVX,TMAXVY,TREALX,TREALY,        00022430
     1 TIMAGX,TIMAGY,TRCOSF,TRSINF,TRSCAL,TRFACX,TRFACY,                00022440
     2 TRPAR1,TRPAR2,TRPAR3,TRPAR4,TRPAR5,TRPAR6,KMOFLG(8),KPAD2,       00022450
     3 KBAUDR,KGNFLG,KGRAFL,KHOMEY,KKMODE,KHORSZ,KVERSZ,KTBLSZ,         00022460
     4 KSIZEF,KLMRGN,KRMRGN,KFACTR,KTERM,KLINE,KZAXIS,KBEAMX,KBEAMY,    00022470
     5 KMOVEF,KPCHAR(5),KDASHT,KMINSX,KMINSY,KMAXSX,KMAXSY,KEYCON,      00022480
     6 KINLFT,KOTLFT,KUNIT                                              00022490
      LINWDT=(KHORSZ * NUMCHR + KFACTR/2)/KFACTR                        00022500
      RETURN                                                            00022510
      END                                                               00022520
C                                                                       00022530
C----------FUNCTION----LINHGT------------------------TEKTRONIX, INC.----00022540
C                                                                       00022550
      FUNCTION LINHGT(NUMLIN)                                           00022560
      COMMON /TKTRNX/ TMINVX,TMINVY,TMAXVX,TMAXVY,TREALX,TREALY,        00022570
     1 TIMAGX,TIMAGY,TRCOSF,TRSINF,TRSCAL,TRFACX,TRFACY,                00022580
     2 TRPAR1,TRPAR2,TRPAR3,TRPAR4,TRPAR5,TRPAR6,KMOFLG(8),KPAD2,       00022590
     3 KBAUDR,KGNFLG,KGRAFL,KHOMEY,KKMODE,KHORSZ,KVERSZ,KTBLSZ,         00022600
     4 KSIZEF,KLMRGN,KRMRGN,KFACTR,KTERM,KLINE,KZAXIS,KBEAMX,KBEAMY,    00022610
     5 KMOVEF,KPCHAR(5),KDASHT,KMINSX,KMINSY,KMAXSX,KMAXSY,KEYCON,      00022620
     6 KINLFT,KOTLFT,KUNIT                                              00022630
      LINHGT=(KVERSZ * NUMLIN + KFACTR/2)/KFACTR                        00022640
      RETURN                                                            00022650
      END                                                               00022660
C                                                                       00022670

C----------SUBROUTINE--CHRSIZ------------------------TEKTRONIX, INC.----00022680
C                                                                       00022690
      SUBROUTINE CHRSIZ(K)                                              00022700
      COMMON /TKTRNX/ TMINVX,TMINVY,TMAXVX,TMAXVY,TREALX,TREALY,        00022710
     1 TIMAGX,TIMAGY,TRCOSF,TRSINF,TRSCAL,TRFACX,TRFACY,                00022720
     2 TRPAR1,TRPAR2,TRPAR3,TRPAR4,TRPAR5,TRPAR6,KMOFLG(8),KPAD2,       00022730
     3 KBAUDR,KGNFLG,KGRAFL,KHOMEY,KKMODE,KHORSZ,KVERSZ,KTBLSZ,         00022740
     4 KSIZEF,KLMRGN,KRMRGN,KFACTR,KTERM,KLINE,KZAXIS,KBEAMX,KBEAMY,    00022750
     5 KMOVEF,KPCHAR(5),KDASHT,KMINSX,KMINSY,KMAXSX,KMAXSY,KEYCON,      00022760
     6 KINLFT,KOTLFT,KUNIT                                              00022770
      DIMENSION ICODE(2),ICHRTB(2,4)                                    00022780
      DATA ICHRTB(1,1),ICHRTB(2,1)/56,88/                               00022790
      DATA ICHRTB(1,2),ICHRTB(2,2)/51,83/                               00022800
      DATA ICHRTB(1,3),ICHRTB(2,3)/34,53/                               00022810
      DATA ICHRTB(1,4),ICHRTB(2,4)/31,48/                               00022820
      DATA ICODE(1)/27/                                                 00022830
C * CHECK TERMINAL TYPE                                                 00022840
      IF(KTERM .LE. 1)GO TO 10                                          00022850
      IF(K .LT. 1)K=1                                                   00022860
      IF(K .GT. 4)K=4                                                   00022870
      KSIZEF=K                                                          00022880
      KHORSZ=ICHRTB(1,K)                                                00022890
      KVERSZ=ICHRTB(2,K)                                                00022900
      ICODE(2)=55+K                                                     00022910
      CALL TOUTST(2,ICODE)                                              00022920
10    RETURN                                                            00022930
      END                                                               00022940
C                                                                       00022950

C----------SUBROUTINE--CZAXIS------------------------TEKTRONIX, INC.----00022960
C                                                                       00022970
      SUBROUTINE CZAXIS(ICODE)                                          00022980
      COMMON /TKTRNX/ TMINVX,TMINVY,TMAXVX,TMAXVY,TREALX,TREALY,        00022990
     1 TIMAGX,TIMAGY,TRCOSF,TRSINF,TRSCAL,TRFACX,TRFACY,                00023000
     2 TRPAR1,TRPAR2,TRPAR3,TRPAR4,TRPAR5,TRPAR6,KMOFLG(8),KPAD2,       00023010
     3 KBAUDR,KGNFLG,KGRAFL,KHOMEY,KKMODE,KHORSZ,KVERSZ,KTBLSZ,         00023020
     4 KSIZEF,KLMRGN,KRMRGN,KFACTR,KTERM,KLINE,KZAXIS,KBEAMX,KBEAMY,    00023030
     5 KMOVEF,KPCHAR(5),KDASHT,KMINSX,KMINSY,KMAXSX,KMAXSY,KEYCON,      00023040
     6 KINLFT,KOTLFT,KUNIT                                              00023050
C * ICODE = 0 -- NORMAL Z AXIS                                          00023060
C *       = 1 --DEFOCUSED Z AXIS                                        00023070
C *       = 2 --WRITE-THRU ENABLE                                       00023080
C *       = 3 --NON-STORE ENABLE                                        00023090
      IF(KTERM .LE. 1)GO TO 10                                          00023100
      KZAXIS=ICODE                                                      00023110
	IF(KZAXIS.LT.0)KZAXIS=0
	IF(KZAXIS.GT.2)KZAXIS=2
      CALL CWSEND                                                       00023120
10    RETURN                                                            00023130
      END                                                               00023140

C----------SUBROUTINE--CWSEND------------------------TEKTRONIX, INC.----00023160
      SUBROUTINE CWSEND                                                 00023180
      COMMON /TKTRNX/ TMINVX,TMINVY,TMAXVX,TMAXVY,TREALX,TREALY,        00023190
     1 TIMAGX,TIMAGY,TRCOSF,TRSINF,TRSCAL,TRFACX,TRFACY,                00023200
     2 TRPAR1,TRPAR2,TRPAR3,TRPAR4,TRPAR5,TRPAR6,KMOFLG(8),KPAD2,       00023210
     3 KBAUDR,KGNFLG,KGRAFL,KHOMEY,KKMODE,KHORSZ,KVERSZ,KTBLSZ,         00023220
     4 KSIZEF,KLMRGN,KRMRGN,KFACTR,KTERM,KLINE,KZAXIS,KBEAMX,KBEAMY,    00023230
     5 KMOVEF,KPCHAR(5),KDASHT,KMINSX,KMINSY,KMAXSX,KMAXSY,KEYCON,      00023240
     6 KINLFT,KOTLFT,KUNIT                                              00023250
      DIMENSION ICODE(2)                                                00023260
      DATA ICODE(1)/27/                                                 00023270
      ICODE(2)=96+KZAXIS*8+KLINE                                        00023280
      CALL TOUTST(2,ICODE)                                              00023290
      RETURN                                                            00023300
      END                                                               00023310

C----------SUBROUTINE--TSEND-------------------------TEKTRONIX, INC.----00023330
      SUBROUTINE TSEND                                                  00023350
      DIMENSION ITEMP(1)                                                00023360
      CALL BUFFPK(0,ITEMP)                                              00023370
      RETURN                                                            00023380
      END                                                               00023390

C----------SUBROUTINE--TOUTPT------------------------TEKTRONIX, INC.----00023410
      SUBROUTINE TOUTPT(KKOUT)                                          00023430
      DIMENSION KOUT(1)                                                 00023440
      KOUT(1)=KKOUT                                                     00023450
      CALL TOUTST(1,KOUT)                                               00023460
      RETURN                                                            00023470
      END                                                               00023480

C----------SUBROUTINE--TOUTST------------------------TEKTRONIX, INC.----00023500
      SUBROUTINE TOUTST(LEN,IADE)                                       00023520
      COMMON /TKTRNX/ TMINVX,TMINVY,TMAXVX,TMAXVY,TREALX,TREALY,        00023530
     1 TIMAGX,TIMAGY,TRCOSF,TRSINF,TRSCAL,TRFACX,TRFACY,                00023540
     2 TRPAR1,TRPAR2,TRPAR3,TRPAR4,TRPAR5,TRPAR6,KMOFLG(8),KPAD2,       00023550
     3 KBAUDR,KGNFLG,KGRAFL,KHOMEY,KKMODE,KHORSZ,KVERSZ,KTBLSZ,         00023560
     4 KSIZEF,KLMRGN,KRMRGN,KFACTR,KTERM,KLINE,KZAXIS,KBEAMX,KBEAMY,    00023570
     5 KMOVEF,KPCHAR(5),KDASHT,KMINSX,KMINSY,KMAXSX,KMAXSY,KEYCON,      00023580
     6 KINLFT,KOTLFT,KUNIT                                              00023590
      DIMENSION IADE(1),IUSE(72)                                        00023600
      DATA ISYNC,MAXLEN/22,72/                                          00023610
      LENOUT=0
      IF (LEN .LE. 0) GO TO 40
      ITEST=KPAD2-1                                                     00023640
      DO 30 I=1,LEN                                                     00023650
      ITEMP=IADE(I)                                                     00023660
C * TEST TO SEE IF PADDING WITH (SYN) TO SOLVE SPEED IS NEEDED          00023670
C * REMOVE THIS SECTION IF NOT NEEDED **********************************00023680
      IF(ITEST .LE. 0)GO TO 20                                          00023690
      IF(ITEMP .GT. 31)GO TO 20                                         00023700
      IF(ITEMP .LT. 27)GO TO 20                                         00023710
      DO 10 K=1,ITEST                                                   00023720
      IF(LENOUT .GE. MAXLEN)GO TO 40                                    00023730
      LENOUT=LENOUT+1                                                   00023740
10    IUSE(LENOUT)=ISYNC                                                00023750
20    CONTINUE                                                          00023760
C **********************************************************************00023770
C * INSERT CODE EXPANSION CHARACTERS HERE, WHEN NEEDED                  00023780
      IF(LENOUT .GE. MAXLEN)GO TO 40                                    00023790
      LENOUT=LENOUT+1                                                   00023800
30    IUSE(LENOUT)=ITEMP                                                00023810
40    CALL BUFFPK(LENOUT,IUSE)                                          00023820
      RETURN                                                            00023830
      END                                                               00023840
C                                                                       00023850
C----------SUBROUTINE--BUFFPK-----------------------TEKTRONIX,  INC.----00023860
C                                                                       00023870
      SUBROUTINE BUFFPK(NCHAR,IOUT)                                     00023880
      COMMON /TKTRNX/ TMINVX,TMINVY,TMAXVX,TMAXVY,TREALX,TREALY,        00023890
     1 TIMAGX,TIMAGY,TRCOSF,TRSINF,TRSCAL,TRFACX,TRFACY,                00023900
     2 TRPAR1,TRPAR2,TRPAR3,TRPAR4,TRPAR5,TRPAR6,KMOFLG(8),KPAD2,       00023910
     3 KBAUDR,KGNFLG,KGRAFL,KHOMEY,KKMODE,KHORSZ,KVERSZ,KTBLSZ,         00023920
     4 KSIZEF,KLMRGN,KRMRGN,KFACTR,KTERM,KLINE,KZAXIS,KBEAMX,KBEAMY,    00023930
     5 KMOVEF,KPCHAR(5),KDASHT,KMINSX,KMINSY,KMAXSX,KMAXSY,KEYCON,      00023940
     6 KINLFT,KOTLFT,KUNIT                                              00023950
      DIMENSION IDATA(72),IOUT(1)                   
      DATA MAXLEN,LENOUT,NODATA,ITRAIL/72,0,1,1/                        00023970
        LEN=NCHAR
C * DUMP THE BUFFER IF THE MODE IS UNBUFFERED
        IF(KUNIT.EQ.4)GO TO 45
C * DUMP THE BUFFER WHEN REQUESTED BY LEN=0                             00023980
      IF(NCHAR .LE. 0)GO TO 10                                          00023990
C * DON'T DUMP THE BUFFER IF NEW STRING WILL FIT                        00024000
      IF(NCHAR .LE. KOTLFT)GO TO 70                                     00024010
C * DETERMINE IF THERE IS DATA IN BUFFER                                00024020
10    IF(NODATA .EQ. 1)GO TO 50                                         00024030
        NODATA=1
C * DETERMINE THE FORMAT THE USER WANTS BUFFER DUMPED IN                00024040
      GO TO (20,30,40,45),KUNIT                                         00024050
C * OUTPUT BUFFER FORMAT IS (GS),PLTCHRS,DATA,(US)                      00024060
20    LENOUT=LENOUT+1                                                   00024070
C * APPEND (US) TO END OF BUFFER                                        00024080
      IDATA(LENOUT)=31                                                  00024090
      CALL ADEOUT(LENOUT,IDATA)                                         00024100
      CALL PLTCHR(KBEAMX,KBEAMY,IDATA)                                  00024110
C * RESTORE THE BEAM POSITION AT FIRST OF THE NEXT BUFFER               00024120
      IDATA(2)=IDATA(1)                                                 00024130
      IDATA(1)=29                                                       00024140
C * AND NOW THE MODE BEFORE THE OUTPUT WAS ASKED FOR                    00024150
      LENOUT=6                                                          00024160
      KEY=KKMODE+1                                                      00024170
      IF(KEY .LT. 1)KEY=1                                               00024180
      IF(KEY .GT. 5)KEY=1                                               00024190
C * MODE IS A/N,VEC,PNT,INC,DSH                                         00024200
      GO TO (21, 22, 23, 24, 22),KEY                                    00024210
C * ENTER A/N MODE                                                      00024220
21    IDATA(LENOUT)=31                                                  00024230
      GO TO 50                                                          00024240
C * ENTER VECTOR MODE                                                   00024250
22    IDATA(LENOUT)=29                                                  00024260
      IF(KMOVEF .NE. 1)LENOUT=LENOUT-1                                  00024270
      GO TO 50                                                          00024280
C * ENTER POINT MODE                                                    00024290
23    IF(KTERM .LT. 3)GO TO 22                                          00024300
      IDATA(LENOUT)=28                                                  00024310
      LENOUT=LENOUT+1                                                   00024320
      GO TO 22                                                          00024330
C * ENTER INCREMENTAL PLOT MODE                                         00024340
24    IDATA(LENOUT)=30                                                  00024350
C * RAISE OR LOWER PEN AS NEEDED                                        00024360
C * THE FOLLOWING 3 LINES ARE NOT NEEDED ON SOME PLOTTERS **************00024370
      LENOUT=LENOUT+1                                                   00024380
      IDATA(LENOUT)=80                                                  00024390
      IF(KMOVEF .EQ. 1)IDATA(LENOUT)=32                                 00024400
C **********************************************************************00024410
      GO TO 50                                                          00024420
C * OUTPUT BUFFER FORMAT IS (SYN),DATA,(ESC)                            00024430
30      IF(NCHAR.LE.0.AND.KMOFLG(1).NE.1)GO TO 20
        LENOUT=LENOUT+1
C * APPEND (ESC) TO END OF BUFFER                                       00024450
      IDATA(LENOUT)=27                                                  00024460
      CALL ADEOUT(LENOUT,IDATA)                                         00024470
      IDATA(1)=22                                                       00024480
      LENOUT=1                                                          00024490
      GO TO 50                                                          00024500
C * OUTPUT BUFFER FORMAT IS DATA ONLY                                   00024510
40    CALL ADEOUT(LENOUT,IDATA)                                         00024520
      LENOUT=0                                                          00024530
        GO TO 50
C * NON-BUFFERED OUTPUT FORMAT
45      IF(LENOUT.GT.0)CALL ADEOUT(LENOUT,IDATA)
        IF(LEN.GT.0)CALL ADEOUT(LEN,IOUT)
        LENOUT=0
        NODATA=1
        GO TO 90
50    KOTLFT=MAXLEN-LENOUT-ITRAIL                                       00024540
      IF(LEN .LE. 0) GO TO 90                                           00024550
70    NODATA=0                                                          00024560
        IF(LEN.GT.KOTLFT)LEN=KOTLFT
      LEN=NCHAR                                                         00024570
      IF(LEN .GT. KOTLFT)LEN=KOTLFT                                     00024580
      DO 80 I=1,LEN                                                     00024590
      LENOUT=LENOUT+1                                                   00024600
80    IDATA(LENOUT)=IOUT(I)                                             00024610
90    KOTLFT=MAXLEN-LENOUT-ITRAIL                                       00024620
      RETURN                                                            00024630
      END                                                               00024640
C                                                                       00024650

C----------SUBROUTINE--PLTCHR------------------------TEKTRONIX, INC.----00024660
C                                                                       00024670
      SUBROUTINE PLTCHR(IX,IY,ICHAR)                                    00024680
      COMMON /TKTRNX/ TMINVX,TMINVY,TMAXVX,TMAXVY,TREALX,TREALY,        00024690
     1 TIMAGX,TIMAGY,TRCOSF,TRSINF,TRSCAL,TRFACX,TRFACY,                00024700
     2 TRPAR1,TRPAR2,TRPAR3,TRPAR4,TRPAR5,TRPAR6,KMOFLG(8),KPAD2,       00024710
     3 KBAUDR,KGNFLG,KGRAFL,KHOMEY,KKMODE,KHORSZ,KVERSZ,KTBLSZ,         00024720
     4 KSIZEF,KLMRGN,KRMRGN,KFACTR,KTERM,KLINE,KZAXIS,KBEAMX,KBEAMY,    00024730
     5 KMOVEF,KPCHAR(5),KDASHT,KMINSX,KMINSY,KMAXSX,KMAXSY,KEYCON,      00024740
     6 KINLFT,KOTLFT,KUNIT
      DIMENSION ICHAR(1)
C * CALCULATE THE PLOT CHARACTERS TO ARRIVE AT IX,IY                    00024770
C * ORDER IS HIY, LSBYX, LOY, HIX, LOX                                  00024780

      KX=IX*KFACTR                                                      00024790
      KY=IY*KFACTR                                                      00024800
      ICHAR(1)=MOD(KY/128,32)+32                                        00024810
      ICHAR(2)=MOD(KY,4)*4+MOD(KX,4)+96                                 00024820
      ICHAR(3)=MOD(KY/4,32)+96                                          00024830
      ICHAR(4)=MOD(KX/128,32)+32                                        00024840
      ICHAR(5)=MOD(KX/4,32)+64                                          00024850
      RETURN                                                            00024860
      END                                                               00024870
C                                                                       00024880

C----------SUBROUTINE KAS2AM-------------------------EGLIN AFB----------00024890
C
        SUBROUTINE KAS2AM(NC,IADE,IA2)
        DIMENSION IADE(1)
        LOGICAL*1  IA2(1)
        DO 1 I=1,NC
1       IA2(I)=IADE(I)
        RETURN
        END
C

C----------SUBROUTINE KAS2A1-------------------------EGLIN AFB----------00024900
C
        SUBROUTINE KAS2A1(NC,IADE,IA1)
        DIMENSION IADE(1),IA1(1)
        DO 1 I=1,NC
1       IA1(I)=IADE(I)+8192
        RETURN
        END
C

C----------SUBROUTINE KAM2AS-------------------------EGLIN AFB----------00024910
C
        SUBROUTINE KAM2AS(NC,IAM,IADE)
        DIMENSION IADE(1)
        LOGICAL*1 IAM(1)
        DO 1 I=1,NC
1       IADE(I)=IAM(I)
        RETURN
        END
C

C----------SUBROUTINE KA12AS------------------------EGLIN AFB-----------00024920
C
        SUBROUTINE KA12AS(NC,IA1,IADE)
        LOGICAL*1 IA1(1),IADE(1)
        IE=2*NC-1
        DO 1 I=1,IE,2
        IADE(I)=IA1(I)
1       IADE(I+1)=0
        RETURN
        END

