(* >>>> KERMGLOB.TEXT  ************************************************)

(*$S+*)
(*$I-*)
(*$R-*)
(*$V-*)

UNIT kermglob;   INTRINSIC CODE 16   DATA  17;

INTERFACE

  CONST version = 'RUG/PT 1.0';
        cs_file = 'CONSOLE:';
        pr_file = 'PRINTER:';
        setup_file = '*KERMIT.DATA';
        sys_misc_file = '*SYSTEM.MISCINFO';
        blk_size = 512;
        page_size = 1024;
        outport = 8;        (* output port #  remout*)
        inport = 7;         (* input  port #  remin *)
        keyport = 2;
        consol  = 1;
        line_printer = 6;
        bell = 7;           (* ASCII bell *)
        linefeed = 10;      (* ASCII line feed *)
        formfeed = 12;      (* ASCII formfeed *)
        backspace = 8;      (* ASCII backspace *)
        del = 127;          (* ASCII delete char *)
        xdle = 16;          (* ASCII DLE *)
                            (* space compression prefix for p_system *)
        eoline = 13;        (* end of line character  *)
        at_eof = -1;        (* value to return if at eof *)
        def_maxpack = 94;   (* default max packet size I can handle *)
        max_buf = 96;       (* max packetsize(94) + 2 *)

    (* screen control information *)
    (* console line on which to put specified info *)
 
        title_line = 0;
        status_line = 2;
        packet_line = 3;
        retry_line = 5;
        file_line = 7;
        error_line = 8;
        debug_line = 10;
        pack_line = 13;
        ack_line = 17;
        prompt_line = 23;
    (* position on line to put info *)
        statuspos = 36;
        packet_pos = 19;
        retry_pos = 17;
        file_pos = 11;
 
(*-------------------------------------------------------------------*)

TYPE packettype = packed array[ 0..maxbuf ] of char;

     parity_type = (nopar, oddpar, evenpar, markpar, spacepar);

     statustype = (null, at_eol, unconfirmed, parm_expected, ambiguous,
                   unrec, fn_expected, pn_expected, ch_expected, num_expected);
 
     vocab = (nullsym, allsym, baudsym, consym, debugsym, delsym, dirsym,
              emulatesym, eolnsym, escsym, evensym, exitsym, filewarnsym,
              helpsym, ibmsym, localsym, marksym, maxtrysym, maxpsym, nofeedsym,
              nonesym, oddsym, offsym, onsym, paritysym, pdirsym, phelpsym,
              prefixsym, pshowsym, quitsym, recsym, rejectsym, sendsym,
              setsym, showsym, spacesym, stopbsym, textfsym, timeoutsym,
              wordlensym, xoffsym, xoffwaitsym, xonsym);

     scrcommands = (sc_up, sc_right, sc_clreol, sc_clreos, sc_home,
                    sc_delchar, sc_clrall, sc_clrline, sc_left, sc_down);
 
     rem_stat_rec = (all_sp_char, stop_flush_break_sp_char, scr_40_sp_char,
                     no_sp_char, mask_msbit_remin, no_mask_msbit_remin);
 
     cntrl_word_rec = packed record
                         channel    : ( out, inp );
                         purpose    : ( status, control );
                         reserved   :   0..2047  ;
                         special_req: ( none, rw_req );
                         filler     :   0..3 ;
                      end;
 
     acia_type   =  ( unknown, A6551, A6850, Fut1, Fut2, Fut3 );
 
(*--------------------------------------------------------------------*)
 
VAR rec_pkt, packet  : packet_type;

    noun, verb, adj: vocab;

    vocablist: ARRAY[vocab] OF STRING;
 
    err_string, prefix_vol, newprefix_vol, xfilename, line: STRING;
 
    newescchar, escchar, bstodel, newxonchar, xonchar, newxoffchar, xoffchar,
    newxeolchar, xeolchar, eolnchar, sohchar, mypchar, padchar, quote,
    currstate, prefix, rlf, ndfs, eraseol, eraseos, home, delchar, clrscreen,
    clrline, backsp, lf, cr, ff, xdle_char, int_key, my_quote : CHAR;
 
    expected: SET OF vocab;
    ctl_set, ctlq_set : SET OF CHAR;
 
    my_time, max_try, init_try,  data_bit, stop_bit, baud, newdbit, newstopbit,
    newbaud, xoffwtime, newxoffwait, newtimeout, newmaxtry, vol_num, crpos,
    bufpos, bufend, maxpack,mypad, pad, xtime, errplen, iostatus,
    acia_cntrl_reg, acia_comm_reg, temp, new_maxpack, spsiz, max1_data,
    max2_data : INTEGER;
 
    def : FILE OF INTEGER;   (* setup file at init  *)
    p, pr : INTERACTIVE; (* printer or console file *)
    untyped_f, apple_file, rec_file : FILE;
 
    reject_cntrl_char, fwarn, ibm, half_duplex, debug, pr_out,
    text_file, print_enable, no_ffeed,  send_ok, rec_ok, dle_flag, emulate
     : BOOLEAN;
 
    acia_implem : acia_type;
 
    new_par, parity : parity_type;
 
    control_word : cntrl_word_rec;
 
    no_sfb_char, sfb_char : rem_stat_rec;
 
    prefixed : ARRAY[scr_commands] OF BOOLEAN;
 
    filebuf: PACKED ARRAY[1..page_size] OF CHAR;

(*-----------------------------------------------------------------------*)

PROCEDURE Dummy;

IMPLEMENTATION

PROCEDURE dummy;
begin
end;
 
BEGIN
END. { kermglob }

