
                               					 5-May-1986 12:24:22	VAX FORTRAN V4.0-2                  Page   1
								 5-May-1986 12:23:52	QSA1:[050001.AU]NET.FOR;33                  

0001    C
0002    	PARAMETER (LINESIZE=132,NQUE=40,NUSERS=5)
0003    C
0004    C
0005    C
0006    	CHARACTER CR*(1),LF*(1),DEV*(8),NUM*(4),TEXT*(LINESIZE)
0007    	CHARACTER DATETIME*(32),WHO(NUSERS)*30,FILE(NUSERS)*3
0008    	CHARACTER TITLE*(LINESIZE),LIST*(LINESIZE),NAME*32
0009    	CHARACTER PREFIX(NUSERS)*1,ISO(NUSERS)*3,LABEL*20
0010    	CHARACTER MESS1(NUSERS)*80,MESS2(NUSERS)*80,MESS3(NUSERS)*80
0011    	CHARACTER WHAT(NUSERS)*32
0012    C
0013    	LOGICAL*1 FOPEN(NUSERS)
0014    	BYTE SRC(14)
0015    C
0016    	INTEGER*2 F,N,A,FNA,FNAIX,FNANQ,COMMAND(100),IE(4)
0017    	1,IBUF(4096),IOSB(4),IOSBR(4),IOSBW(4)
0018    C
0019    	INTEGER*4 CHARX(2),ICHAN,NERR,IDESCR(2)
0020    C
0021    	INTEGER SYS$QIO,SYS$ASSIGN,SYS$ASCEFC,SYS$WFLOR
0022    	1,SYS$READEF,SYS$CLREF,SYS$SETIMR,LIB$INSQHI
0023    	2,SYS$TRNLOG,SYS$ASCTIM,SYS$GETTIM,SYS$QIOW
0024    	3,SYS$DCLAST,LIB$REMQTI,SYS$SETPRI,STR$POSITION
0025    	4,STR$TRIM,SYS$ALLOC
0026    C
0027    	INCLUDE 'SYS$LIBRARY:FORSYSDEF($SSDEF)/NOLIST'
0707    	INCLUDE 'NMADEF.FOR/NOLIST'
1587    	INCLUDE 'SYS$LIBRARY:FORSYSDEF($IODEF)/NOLIST'
2230    	INCLUDE 'SYS$LIBRARY:FORSYSDEF($LIBDEF)/NOLIST'
2483    C
2484    C	TRANSLATE THE NAME
2485    C
2486    	DEV='   '
2487    	NERR=SYS$TRNLOG('DATA_NET',,DEV,,,)
2488    	IF(NERR.NE.SS$_NORMAL)THEN
2489    		TYPE *,' TRANSLATION ERROR'
2490    		CALL EXIT (NERR)
2491    	ENDIF
2492    C
2493    C	ASSIGN CHANNEL
2494    C'
2495    	NERR=SYS$ASSIGN(DEV,ICHAN,,)
2496    	IF(NERR.NE.SS$_NORMAL)THEN
2497    		TYPE *,' ASSIGN ERROR'
2498    		CALL EXIT (NERR)
2499    	ENDIF
2500    C
2501    C	INITIALIZE
2502    C
2503    	IDESCR(1)=200				!SETUP DESCRIPTER
2504    	IDESCR(2)=%LOC(COMMAND)	
2505    	DO 30 I=1,100
2506    30	COMMAND(I)=0
2507    C
2508    C	WE NOW GET THE CURRENT CHANNEL INFO
2509    C

NET$MAIN                       					 5-May-1986 12:24:22	VAX FORTRAN V4.0-2                  Page   2
								 5-May-1986 12:23:52	QSA1:[050001.AU]NET.FOR;33                  

2510    	NERR=SYS$QIOW(,%VAL(ICHAN),%VAL(IO$_SENSEMODE+IO$M_CTRL),IOSB,,,
2511    	1CHARX,IDESCR,,,,)
2512    	IF(NERR.NE.SS$_NORMAL)THEN
2513    		TYPE *,' QIO ERROR'
2514    		CALL EXIT (NERR)
2515    	ENDIF
2516    	TYPE *,' STATUS=',IOSB
2517    	TYPE *,' CHAR=',CHARX
2518    	TYPE *,' MODE=',COMMAND
2519    C
2520    C	SET THE NEW LINK
2521    C
2522    	DO 40 I=1,100
2523    40	COMMAND(I)=0
2524    	COMMAND(1)=NMA$C_PCLI_BFN
2525    	COMMAND(2)=3
2526    	COMMAND(3)=0
2527    	COMMAND(4)=NMA$C_PCLI_PAD
2528    	COMMAND(5)=NMA$C_STATE_ON
2529    	COMMAND(6)=0
2530    	COMMAND(7)=NMA$C_PCLI_PTY
2531    	COMMAND(8)='0660'X
2532    	COMMAND(9)=0
2533    	COMMAND(10)=NMA$C_PCLI_CRC
2534    	COMMAND(11)=NMA$C_STATE_ON
2535    	COMMAND(12)=0
2536    	COMMAND(13)=NMA$C_PCLI_PHA
2537    	COMMAND(14)=8
2538    	COMMAND(15)=NMA$C_LINMC_SET
2539    	COMMAND(16)='00AA'X			!CAD ADDRESS
2540    	COMMAND(17)='0004'X
2541    	COMMAND(18)='0496'X
2542    C
2543    	IDESCR(1)=24				!SETUP DESCRIPTER
2544    	IDESCR(2)=%LOC(COMMAND)	
2545    C
2546    	SRC(7)='AA'X				!uVAX ADDRESS
2547    	SRC(8)='00'X
2548    	SRC(9)='04'X
2549    	SRC(10)='00'X
2550    	SRC(11)='0A'X
2551    	SRC(12)='04'X
2552    	SRC(13)='06'X
2553    	SRC(14)='60'X
2554    C
2555    C	SET MODE
2556    C
2557    	NERR=SYS$QIOW(,%VAL(ICHAN),%VAL(IO$_SETMODE+IO$M_CTRL+IO$M_STARTUP)
2558    	1,IOSB,,,,IDESCR,,,,)
2559    	IF(NERR.NE.SS$_NORMAL)THEN
2560    		TYPE *,' QIO ERROR'
2561    		CALL EXIT (NERR)
2562    	ENDIF
2563    	TYPE *,' STATUS=',IOSB
2564    	TYPE *,' MODE=',COMMAND
2565    C
2566    C	READ IT BACK

NET$MAIN                       					 5-May-1986 12:24:22	VAX FORTRAN V4.0-2                  Page   3
								 5-May-1986 12:23:52	QSA1:[050001.AU]NET.FOR;33                  

2567    C
2568    	IDESCR(1)=200				!SETUP DESCRIPTER
2569    	IDESCR(2)=%LOC(COMMAND)	
2570    	NERR=SYS$QIOW(,%VAL(ICHAN),%VAL(IO$_SENSEMODE+IO$M_CTRL),IOSB,,,
2571    	1CHARX,IDESCR,,,,)
2572    	IF(NERR.NE.SS$_NORMAL)THEN
2573    		TYPE *,' QIO ERROR'
2574    		CALL EXIT (NERR)
2575    	ENDIF
2576    	TYPE *,' STATUS=',IOSB
2577    	TYPE *,' CHAR=',CHARX
2578    	TYPE *,' MODE=',COMMAND
2579    C
2580    C	SET THE FIRST READ
2581    C
2582    	ISTAT=SYS$QIO(%VAL(33),%VAL(ICHAN),%VAL(IO$_READVBLK),IOSBR,,,
2583    	1IBUF,%VAL(512),,,SRC,)
2584    	IF(ISTAT.NE.SS$_NORMAL)THEN
2585    		TYPE *,' READ QIO ERROR ',ISTAT
2586    		TYPE *, IOSBR
2587    		CALL LIB$SIGNAL(%VAL(ISTAT))
2588    		CALL LIB$SIGNAL(%VAL(IOSBR(1)))
2589    	ENDIF
2590    	TYPE *,' INITIALIZED READ'
2591    C
2592    C	TEST DIRECTION
2593    C
2594    	TYPE *,' ENTER OUTPUT DATA (CTRL-Z READ)'
2595    	READ(*,999,END=90)INIT
2596    C
2597    C	SET BUFFER
2598    C
2599    	DO 50 I=1,256
2600    50	IBUF(I)=INIT
2601    C
2602    C	SEND IT OUT
2603    C
2604    	ISTAT=SYS$QIO(%VAL(32),%VAL(ICHAN),%VAL(IO$_WRITEVBLK),IOSBW,,,
2605    	1IBUF,%VAL(512),,,SRC(7),)
2606    	IF(ISTAT.NE.SS$_NORMAL)THEN
2607    		TYPE *,' WRITE QIO ERROR ',ISTAT
2608    		TYPE *, IOSBW
2609    		CALL LIB$SIGNAL(%VAL(ISTAT))
2610    		CALL LIB$SIGNAL(%VAL(IOSBW(1)))
2611    	ENDIF
2612    	TYPE *,' SENT FIRST BUFFER'
2613    C
2614    C
2615    C	EVENT FLAGS USED ARE
2616    C	32	WRITE NET DONE
2617    C	33	READ NET DONE
2618    C	34	TIMER
2619    C
2620    C
2621    C
2622    C	NOW WAIT FOR EVENT
2623    C

NET$MAIN                       					 5-May-1986 12:24:22	VAX FORTRAN V4.0-2                  Page   4
								 5-May-1986 12:23:52	QSA1:[050001.AU]NET.FOR;33                  

2624    90	MASK=7
2625    	ISTAT=SYS$WFLOR(%VAL(32),%VAL(MASK))
2626    C
2627    C	NOW READ ALL EVENT FLAGS
2628    C
2629    	ISTAT=SYS$READEF(%VAL(32),IFLAG)
2630    C
2631    C	FANOUT TO CORRECT ROUTINE
2632    C
2633    	IFAN=IAND(IFLAG,MASK)
2634    	GO TO (100,200,300),IFAN
2635    C
2636    C	EVENT ROUTINES
2637    C
2638    C
2639    C	TIMER HERE SIGNAL 34
2640    C
2641    	ISTAT=SYS$CLREF(%VAL(34))
2642    	GO TO 90
2643    C
2644    C	WRITE DONE EVENT NUMBER 32
2645    C
2646    100	ISTAT=SYS$CLREF(%VAL(32))
2647    	GO TO 90
2648    C
2649    C	READ DONE EVENT NUMBER 33
2650    C
2651    200	IF(IOSBR(1).NE.SS$_NORMAL)THEN
2652    		TYPE *, IOSBR
2653    		CALL LIB$SIGNAL(%VAL(IOSBR(1)))
2654    	ELSE
2655    		TYPE *,' DATA=',IBUF(1),IBUF(2),IBUF(3),IBUF(4)
2656    	ENDIF
2657    C
2658    C	REQUE THE OPERATION
2659    C
2660    	ISTAT=SYS$QIO(%VAL(33),%VAL(ICHAN),%VAL(IO$_READVBLK),IOSBR,,,
2661    	1IBUF,%VAL(512),,,SRC,)
2662    	IF(ISTAT.NE.SS$_NORMAL)THEN
2663    		TYPE *,' READ QIO ERROR ',ISTAT
2664    		TYPE *, IOSBR
2665    		CALL LIB$SIGNAL(%VAL(ISTAT))
2666    		CALL LIB$SIGNAL(%VAL(IOSBR(1)))
2667    	ENDIF
2668    C
2669    C	RESET BUFFER
2670    C
2671    C	DO 210 I=1,256
2672    C210	IBUF(I)=IBUF(I)+1
2673    C
2674    C	SEND IT BACK
2675    C
2676    	ISTAT=SYS$QIO(%VAL(32),%VAL(ICHAN),%VAL(IO$_WRITEVBLK),IOSBW,,,
2677    	1IBUF,%VAL(512),,,SRC(7),)
2678    	IF(ISTAT.NE.SS$_NORMAL)THEN
2679    		TYPE *,' WRITE QIO ERROR ',ISTAT
2680    		TYPE *, IOSBW

NET$MAIN                       					 5-May-1986 12:24:22	VAX FORTRAN V4.0-2                  Page   5
								 5-May-1986 12:23:52	QSA1:[050001.AU]NET.FOR;33                  

2681    		CALL LIB$SIGNAL(%VAL(ISTAT))
2682    		CALL LIB$SIGNAL(%VAL(IOSBW(1)))
2683    	ENDIF
2684    	GO TO 90
2685    C
2686    C	BOTH DONE
2687    C
2688    300	ISTAT=SYS$CLREF(%VAL(32))
2689    	GO TO 200
2690    C
2691    C	FORMATS
2692    C
2693    999	FORMAT(I)
2694    	END




PROGRAM SECTIONS

    Name				 Bytes   Attributes

  0 $CODE                                 1659   PIC CON REL LCL   SHR   EXE   RD NOWRT LONG
  1 $PDATA                                 181   PIC CON REL LCL   SHR NOEXE   RD NOWRT LONG
  2 $LOCAL                               10532   PIC CON REL LCL NOSHR NOEXE   RD   WRT LONG

    Total Space Allocated                12372


ENTRY POINTS

    Address  Type  Name          

  0-00000000       NET$MAIN      


VARIABLES

    Address  Type  Name              Address  Type  Name              Address  Type  Name              Address  Type  Name          

      **      I*2  A                   **      CHAR CR                  **      CHAR DATETIME        2-00002714  CHAR DEV           
      **      I*2  F                   **      I*2  FNA                 **      I*2  FNAIX               **      I*2  FNANQ         
      **      I*4  I               2-0000271C  I*4  ICHAN               **      I*4  IFAN            2-00002728  I*4  IFLAG         
  2-00002724  I*4  INIT                **      I*4  ISTAT               **      CHAR LABEL               **      CHAR LF            
      **      I*4  LIB$INSQHI          **      I*4  LIB$REMQTI          **      CHAR LIST                **      I*4  MASK          
      **      I*2  N                   **      CHAR NAME            2-00002720  I*4  NERR                **      CHAR NUM           
      **      I*4  STR$POSITION        **      I*4  STR$TRIM            **      I*4  SYS$ALLOC           **      I*4  SYS$ASCEFC    
      **      I*4  SYS$ASCTIM          **      I*4  SYS$DCLAST          **      I*4  SYS$GETTIM          **      I*4  SYS$SETIMR    
      **      I*4  SYS$SETPRI          **      CHAR TEXT                **      CHAR TITLE         

NET$MAIN                       					 5-May-1986 12:24:22	VAX FORTRAN V4.0-2                  Page   6
								 5-May-1986 12:23:52	QSA1:[050001.AU]NET.FOR;33                  

ARRAYS

    Address  Type  Name                Bytes  Dimensions

  2-00000000  I*4  CHARX                   8  (2)
  2-00000010  I*2  COMMAND               200  (100)
  2-00000096  CHAR FILE                   15  (5)
  2-00000609  L*1  FOPEN                   5  (5)
  2-000000E0  I*2  IBUF                 8192  (4096)
  2-00000008  I*4  IDESCR                  8  (2)
  2-000000C8  I*2  IE                      8  (4)
  2-000020E0  I*2  IOSB                    8  (4)
  2-000020E8  I*2  IOSBR                   8  (4)
  2-000020F0  I*2  IOSBW                   8  (4)
  2-000000AA  CHAR ISO                    15  (5)
  2-000000B9  CHAR MESS1                 400  (5)
  2-00000249  CHAR MESS2                 400  (5)
  2-000003D9  CHAR MESS3                 400  (5)
  2-000000A5  CHAR PREFIX                  5  (5)
  2-00002706  L*1  SRC                    14  (14)
  2-00000569  CHAR WHAT                  160  (5)
  2-00000000  CHAR WHO                   150  (5)


LABELS

    Address   Label       Address   Label       Address   Label       Address   Label       Address   Label       Address   Label   

      **      30            **      40            **      50        0-000004C3  90        0-000004FC  100       0-00000511  200     
  0-00000508  300       1-000000B0  999'    


FUNCTIONS AND SUBROUTINES REFERENCED

  Type  Name            Type  Name            Type  Name            Type  Name            Type  Name            Type  Name          

        FOR$EXIT              LIB$SIGNAL       I*4  SYS$ASSIGN       I*4  SYS$CLREF        I*4  SYS$QIO          I*4  SYS$QIOW      
   I*4  SYS$READEF       I*4  SYS$TRNLOG       I*4  SYS$WFLOR     


COMMAND QUALIFIERS

  FOR/LIST NET

  /CHECK=(NOBOUNDS,OVERFLOW,NOUNDERFLOW)
  /DEBUG=(NOSYMBOLS,TRACEBACK)
  /STANDARD=(NOSYNTAX,NOSOURCE_FORM)
  /SHOW=(NOPREPROCESSOR,NOINCLUDE,MAP,NODICTIONARY,SINGLE)
  /WARNINGS=(GENERAL,NODECLARATIONS)
  /CONTINUATIONS=19  /NOCROSS_REFERENCE  /NOD_LINES  /NOEXTEND_SOURCE  /F77
  /NOG_FLOATING  /I4  /NOMACHINE_CODE  /OPTIMIZE

NET$MAIN                       					 5-May-1986 12:24:22	VAX FORTRAN V4.0-2                  Page   7
								 5-May-1986 12:23:52	QSA1:[050001.AU]NET.FOR;33                  

COMPILATION STATISTICS

  Run Time:           27.66 seconds
  Elapsed Time:       42.06 seconds
  Page Faults:        618
  Dynamic Memory:     935 pages
