(*----------------------------------------------------------------*) procedure send_char(character : integer); (* Input : integer value of character to be sent. Output : none. Variables affected: none; *) begin repeat until (Port[$0d] and $4) <> 0; {wait until xmt buffer empty} Port[$0c] := character; {send character} end; (*----------------------------------------------------------------*) procedure send_break_sig; (* Input : none Output : none Variables affected : none This procedure sends a 'break' signal from the Executive to the modem. *) begin port[$d] := $5; {select sio register 5} port[$d] := $f8;{set output to 'break'} delay(300); {delay for approx 300 ms} port[$d] := $5; {select sio register 5} port[$d] := $e8;{restore sio to normal} end; {send_break_sig} (*-----------------------------------------------------------------*) procedure print_connect_menu; (* Input : none Output : none This procedure prints a menu of commands available from within the 'connect' command. *) begin writeln('******************************************************'); writeln('commands available from inside connect mode:'); writeln; writeln('c return to command mode'); writeln('b send a break to remote terminal or computer'); writeln('******************************************************'); end; (*---------------------------------------------------------------*) procedure term; (* virtual terminal mode *) (* Term is the virtual terminal mode. Anything typed at the terminal is sent to the modem port, and anything the port receives is sent to the terminal. ^\C aborts the virtual terminal mode. Input: none. Output : none. Variables affected: none. *) var letter, temp : integer; connect_exit : boolean; begin (* term *) connect_exit := false; temp := 0; writeln('Connected to remote host. Type Control-backslash c to return'); writeln('to local Kermit.'); repeat if (Port[$d] and $1) <> 0 then {if char came in from comm line} begin letter := Port[$c] and $7f; {get incoming char-zero parity} bdos(6,letter); {send letter to console} if printing then bdos(5,letter); {print it if needed} end; if bdos(6,$fe) <>0 then {is a console char ready?} begin letter := bdos(6,$ff); {yes, get it} case letter of (* check for escape sequence *) escape_char : begin if temp = escape_char then send_char(escape_char) else temp := escape_char; end; $43, $63 : begin (* handle upper and lower case 'C' *) if temp = escape_char then connect_exit := true else send_char(letter); temp := 0; end; $42, $62 : begin {handle upper and lower case 'B' } if temp = escape_char then send_break_sig else send_char (letter); temp := 0; end; $3f : begin {handle esc ? } if temp = escape_char then print_connect_menu else send_char (letter); temp :=0; end; else begin if temp = escape_char then begin send_char(escape_char); write(con, bell); end; send_char(letter); temp := 0; end; end; (* case *) end; until connect_exit; end; (* term *)