home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / INFO / SYSUTL / 16550S.ZIP / 16550.PAS < prev   
Encoding:
Pascal/Delphi Source File  |  1988-04-13  |  3.3 KB  |  99 lines

  1. (*****************************************************************************)
  2. (*                                                                           *)
  3. (*                    16550 - A TPBoard Sysop Utility                        *)
  4. (*                                                                           *)
  5. (*                                  by                                       *)
  6. (*                      Jon Schneider & Rick Petersen                        *)
  7. (*                                                                           *)
  8. (*                                                                           *)
  9. (*    This program will toggle the state of a 16550 UART's FIFO buffer.      *)
  10. (*    It only seems to work with the Fossil driver X00.SYS version 1.09b.    *)
  11. (*    By toggling the buffer ON, even 4.77 Mhz PC's are able to receive      *)
  12. (*    files at a fixed rate of 19,200 baud without error.                    *)
  13. (*                                                                           *)
  14. (*    The code uses portions of the 'Turbo Professional' library. It         *)
  15. (*    will not compile without it.                                           *)
  16. (*                                                                           *)
  17. (*****************************************************************************)
  18.  
  19.  
  20.  
  21. {$R-}    {Range checking off}
  22. {$B-}    {Boolean complete evaluation off}
  23. {$S-}    {Stack checking off}
  24. {$I+}    {I/O checking on}
  25. {$N-}    {No numeric coprocessor}
  26. {$M $4000, $4000, $A0000}
  27.  
  28.  
  29. program a16550;
  30.  
  31.  
  32. Uses
  33.   Crt, TpString;
  34.   
  35. var
  36.    num_params : Integer;
  37.    input_byte : Byte;
  38.    state : String;
  39.    cmd_tail : Boolean;
  40.    com_port : Word;
  41.  
  42.       
  43. Procedure usage;
  44.  
  45. begin
  46.    Writeln;
  47.    WriteLn('16550 - A TPBoard utility for toggling the 16550''s FIFO buffer');
  48.    WriteLn;
  49.    WriteLn('USAGE:  16550 [1-4] [on/off/?]');
  50.    WriteLn;
  51.    WriteLn('        Where ''1'' thru ''4'' is the COM port,  ''on'' or ''off'' will toggle');
  52.    WriteLn('        the FIFO buffer''s state, and ''?'' will show it''s status. Turning');
  53.    WriteLn('        the buffered mode on is guaranteed to lock up your system if you');
  54.    WriteLn('        are using OpusCom, and may cause problems with other programs.');
  55.    WriteLn('        It WILL work with X00 version 1.09b, TPBoard, and ProComm Plus.');
  56.    WriteLn;
  57.    Halt
  58. end;
  59.  
  60.  
  61. begin                         { 16550 }
  62.    CheckBreak := False;
  63.    num_params := ParamCount;
  64.    cmd_tail := num_params = 2;
  65.    if (not cmd_tail) then
  66.       usage;
  67.    if ParamStr(1) = '1' then
  68.       com_port := $3fa
  69.    else if ParamStr(1) = '2' then
  70.       com_port := $2fa
  71.    else if ParamStr(1) = '3' then
  72.       com_port := $3ea
  73.    else if ParamStr(1) = '4' then
  74.       com_port := $2ea
  75.    else
  76.       usage;
  77.    state := StUpcase(ParamStr(2));
  78.    if state = 'ON' then
  79.       Port[com_port] := $07 
  80.    else if state = 'OFF' then
  81.       Port[com_port] := $00
  82.    else if state = '?' then
  83.       begin
  84.          WriteLn;
  85.          input_byte := Port[com_port];
  86.          input_byte := input_byte and $c0;
  87.          Write('FIFO buffer is turned ');
  88.          if input_byte = $c0 then
  89.             WriteLn('ON.')
  90.          else
  91.             WriteLn('OFF.');
  92.       end
  93.    else
  94.       usage;
  95.    WriteLn;
  96. end.                    { of 16550.Pas }
  97.  
  98. 
  99.