home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / intelmdsa / md2con.plm next >
Text File  |  2020-01-01  |  2KB  |  75 lines

  1. conn$module:
  2. do;
  3.  
  4. /* CONNECT: Establish a "virtual terminal" connection through a      */
  5. /* specified serial i/o port.  Here, port 0 represents the console.  */
  6.  
  7. declare port byte external;
  8. declare debug byte external;
  9.  
  10.  
  11. print:  procedure(msg) external;
  12.         declare msg address;
  13. end print;
  14.  
  15.  
  16. nout:   procedure(n) external;
  17.         declare n address;
  18. end nout;
  19.  
  20.  
  21. newline: procedure external; end newline;
  22.  
  23.  
  24. ready:  procedure (port) byte external;
  25.         declare port byte;
  26. end ready;
  27.  
  28.  
  29. csts:  procedure byte external;
  30. end csts;
  31.  
  32.  
  33. putc:   procedure (c, port) external;
  34.         declare (c, port) byte;
  35. end putc;
  36.  
  37.  
  38. getc:   procedure (port) byte external;
  39.         declare port byte;
  40. end getc;
  41.  
  42.  
  43. connect:
  44.         procedure public;
  45.         declare port2cmd literally '0F7H';
  46.         declare rx$rdy literally '02H';
  47.         declare (c,temp) byte;
  48.  
  49.         if debug then
  50.           do;
  51.             call print(.('connecting to serial port $'));
  52.             call nout(port);
  53.             call newline;
  54.          end;
  55.          call print(.('you are now connected to VAX/VMS $'));
  56.          call newline;
  57.          call print(.('type ctrl-D to return to ISIS-Kermit $'));
  58.          call newline;
  59.        do while (1);
  60.            temp = csts;
  61.            if temp > 0 then do;
  62.               c = getc(0);
  63.               if c = 4 then do;
  64.                 /* type ctrl-d to return to main program */
  65.                 call newline;
  66.                 return;
  67.               end;
  68.               call putc(c, port);
  69.             end;
  70.           if ready(port) > 0 then call putc(getc(port), 0);
  71.          end;
  72. end connect;
  73.  
  74. end conn$module;
  75.