home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / PCL4P31.ZIP / PCL4P.USR < prev    next >
Encoding:
Text File  |  1992-03-11  |  45.2 KB  |  1,322 lines

  1.  
  2.  
  3.                           Personal Communications Library
  4.  
  5.                                For the Turbo Pascal
  6.  
  7.  
  8.                                     ( PCL4P )
  9.  
  10.  
  11.  
  12.                                 USERS MANUAL
  13.  
  14.  
  15.  
  16.  
  17.  
  18.                                   Version 3.1
  19.  
  20.                                  March 1, 1992
  21.  
  22.  
  23.  
  24.  
  25.                         This software is provided as-is.
  26.                  There are no warranties, expressed or implied.
  27.  
  28.  
  29.  
  30.  
  31.                               Copyright (C) 1992
  32.                               All rights reserved
  33.  
  34.  
  35.  
  36.                               MarshallSoft Computing, Inc.
  37.                               Post Office Box 4543
  38.                               Huntsville AL 35815
  39.  
  40.                               Phone (205) 881-4630
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.         PCL4P Users Manual                                     Page 1
  61.                                Table of Contents
  62.  
  63.  
  64.  
  65.  
  66.  
  67.          Chapter                                        Page
  68.  
  69.          Introduction........................................3
  70.          Registration........................................4
  71.          Library Overview....................................5
  72.             Initialization & Termination.....................5
  73.             Configuration....................................5
  74.             Modem Control & Status...........................6
  75.             Serial I/O.......................................6
  76.             Error Detection..................................7
  77.             General Support..................................7
  78.          Installation........................................8
  79.          Using the Library...................................9
  80.          Compiling...........................................10
  81.          Talking to your Modem...............................11
  82.          Problems............................................12
  83.          Function Summary....................................13
  84.          Serial Communications...............................14
  85.          IBM Communications Ports............................15
  86.          RS232 Signals.......................................16
  87.          National INS8250, INS16450, and INS16550 UARTs......17
  88.          Register Summary....................................18
  89.          Example Code........................................20
  90.             SIMPLE...........................................20
  91.             TERM.............................................20
  92.             LOOPBACK.........................................20
  93.             MODEM............................................20
  94.          Revision History....................................21
  95.          License.............................................22
  96.          Warranty............................................22
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.         PCL4P Users Manual                                     Page 2
  121.                                   Introduction
  122.  
  123.  
  124.          The  Personal Communications Library for Turbo Pascal ( PCL4P ) is
  125.          an asynchronous communications library  designed  for  experienced
  126.          software  developers  programming in Turbo Pascal. An IBM PC/XT/AT
  127.          or compatible is required.  The PCL features:
  128.  
  129.             o  28 communications and support functions.
  130.             o  Support for INS16550 UART
  131.             o  Interrupt driven receiver.
  132.             o  Supports 300 baud to 115,200 baud.
  133.             o  Supports COM1, COM2, COM3, and COM4.
  134.             o  Adjustable receive queues from 8 bytes to 16 KB.
  135.             o  Control-BREAK error exit.
  136.             o  17 communications error conditions trapped.
  137.             o  Allows 2 ports to run concurrently.
  138.             o  Complete modem control & status.
  139.             o  Written in assembly language for small size & high speed.
  140.  
  141.          A  typical  application  program  using  PCL4P might look like the
  142.          following code outline:
  143.  
  144.  
  145.          ******************************************************************
  146.          *                                                                *
  147.          * program YourProgram                                            *
  148.          *                                                                *
  149.          * uses PCL4P;                                                    *
  150.          * ...                                                            *
  151.          * ...                                                            *
  152.          * var Buffer : array[0..1023] of Char;                           *
  153.          * ...                                                            *
  154.          * begin (* YourProgram *)                                        *
  155.          *    RetCode := SioRxBuf(Port,Ofs(Buffer),Seg(Buffer),Size1024); *
  156.          *    RetCode := SioParms(Port,NoParity,OneStopBit,WordLength8);  *
  157.          *    RetCode := SioReset(Port,Baud2400);                         *
  158.          *    ...                                                         *
  159.          *    ... ( application code )                                    *
  160.          *    ...                                                         *
  161.          *    RetCode := SioDone(Port);                                   *
  162.          * end. (* YourProgram *)                                         *
  163.          ******************************************************************
  164.  
  165.  
  166.          In the above example, SioRxBuf is called to set up the a 1024 byte
  167.          receive  buffer; SioParms is called to set up the parity, stop bit
  168.          count, and word length; SioReset is called to set the baud rate to
  169.          2400 and  reset  the  UART  (  Univeral  Asynchronous  Receiver  /
  170.          Transmitter ).
  171.  
  172.          Before  leaving your application, SioDone is called to restore the
  173.          prior state of the serial communications system.
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.         PCL4P Users Manual                                     Page 3
  181.                                   Registration
  182.  
  183.  
  184.          The shareware version of PCL4P.LIB is provided  so  that  you  may
  185.          personally  determine  the usefulness of the product for yourself.
  186.          If  you  can  use  the  Personal  Communications  Library,  please
  187.          register  your  use  with us. Send $45 plus $3 S&H ( $6 outside of
  188.          the USA, Canada, and Mexico ) to:
  189.  
  190.                   MarshallSoft Computing, Inc.
  191.                   Post Office Box  4543
  192.                   Huntsville AL 35815
  193.  
  194.  
  195.          Please pay by check in US dollars drawn on a  US  bank.   Purchase
  196.          Orders  (  POs  )  are accepted from US companies listed in Dunn &
  197.          Bradstreet.  Print the file PCL4C.INV if an invoice is needed. The
  198.          registered package is mailed first class US Mail ( packet air mail
  199.          overseas ). If you are in a hurry, please call us and we can  ship
  200.          immediately within the US by COD ( street address and phone number
  201.          required ).
  202.  
  203.          The registered package includes:
  204.  
  205.             o  Turbo Pascal library without the shareware screens.
  206.             o  Assembler source code for the library.
  207.             o  Printed Users Manual.
  208.             o  Printed Reference Manual.
  209.             o  Telephone support for one year.
  210.             o  All updates ( with printed manuals ) are $15  plus  $3  S&H
  211.                ( $6 outside of USA, Canada, & Mexico ).
  212.  
  213.          PCL4P.ASM is the source code for the library. The source  code  is
  214.          copyrighted  by MarshallSoft Computing, Inc. The user is granted a
  215.          license to use the PCL4P object code in his own application  only.
  216.          PCL4P.ASM  is  not  shareware and may not be sold or given away to
  217.          anyone.
  218.  
  219.          The  registered  user  will receive the latest version of PCL4P by
  220.          return mail.  A 5.25" diskette is provided unless a 3.5"  diskette
  221.          is requested. Be sure to specify the "Pascal" version.
  222.  
  223.  
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.         PCL4P Users Manual                                     Page 4
  241.                                   Library Overview
  242.  
  243.  
  244.          The  PCL4P  library is organized into six categories of functions.
  245.          Refer to the PCL Reference Manual ( PCL4P.REF  )  for  details  on
  246.          individual functions.
  247.  
  248.  
  249.                           1. Initialization & Termination
  250.  
  251.  
  252.          There  are  six  functions  in  the initialization and termination
  253.          category.  Together, SioParms,  SioFIFO,  SioRxBuf,  and  SioReset
  254.          initialize  your  serial  communications system.  Your application
  255.          must call SioParms  and  SioRxBuf  before  calling  SioReset,  and
  256.          SioReset  must  be  called before any serial I/O processing can be
  257.          done.
  258.  
  259.          After initialization, SioParms and SioBaud can be called again  to
  260.          change  the communications parameters without resetting the serial
  261.          port.
  262.  
  263.          Before  exiting  from  your  application,  SioDone must be called.
  264.          Failure to call SioDone can crash your system later.
  265.  
  266.          SioRxBuf   -- Sets up receive buffer.
  267.          SioFIFO    -- Sets the FIFO trigger level ( INS16550 only )
  268.          SioParms   -- Sets parity, stop bits, and word length.
  269.          SioReset   -- Initialize a serial port for processing.
  270.          SioDone    -- Terminates further serial processing.
  271.          SioBaud    -- Sets the baud rate of the selected port.
  272.  
  273.  
  274.                           2.  Configuration
  275.  
  276.  
  277.          There  are two functions in the configuration category. SioUART is
  278.          used to change the UART base address for a communications port  at
  279.          a   non-standard  address,  while  SioIRQ  is  used  to  assign  a
  280.          nonstandard  IRQ  line  to  a  port.   (  See  the   chapter   IBM
  281.          Communications  Ports  for more details on standard UART addresses
  282.          and IRQ lines ).
  283.  
  284.          The  configuration  category  functions  should  be  called before
  285.          calling SioReset in order to have any effect.  There is no  "error
  286.          checking" done, so be very careful in using these functions.
  287.  
  288.          SioUART -- Sets the UART base address.
  289.          SioIRQ  -- Assigns an IRQ line to a port.
  290.  
  291.  
  292.  
  293.  
  294.  
  295.  
  296.  
  297.  
  298.  
  299.  
  300.         PCL4P Users Manual                                     Page 5
  301.                           3. Modem Control & Status
  302.  
  303.  
  304.          There  are  seven  functions  in  the  modem  control  and  status
  305.          category which provide your application with complete control over
  306.          the status and control bits of your modem.
  307.  
  308.          There are two modem control bits, "Data Terminal Ready"  (  DTR  )
  309.          and  "Request  To  Send"  ( RTS ). These bits can be read, set, or
  310.          cleared by SioDTR and SioRTS.
  311.  
  312.          There are four modem status bits, "Data Set Ready" ( DSR ), "Clear
  313.          To Send" ( CTS ), "Ring Indicator"  (  RI  ),  and  "Data  Carrier
  314.          Detect"  (  DCD ). SioModem can read any of the modem status bits.
  315.          SioDSR, SioCTS, SioRI, and SioDCD can only read  their  respective
  316.          modem status bit.
  317.  
  318.          Refer to the chapter entitled "RS232 Signals" for a discussion  of
  319.          each of the control and status bits.
  320.  
  321.          SioDTR    -- Set, clear, or read the Data Terminal Ready (DTR) bit.
  322.          SioRTS    -- Sets, clears, or reads the Request to Send (RTS) line.
  323.          SioModem  -- Reads the modem status register.
  324.          SioDSR    -- Reads the Data Set Ready (DSR) modem status bit.
  325.          SioCTS    -- Reads the Clear to Send (CTS) modem status bit
  326.          SioDCD    -- Reads the Data Carrier Detect (DCD) modem status bit.
  327.          SioRI     -- Reads the Ring Indicator (RI) modem status bit.
  328.  
  329.  
  330.                           4. Serial I/O
  331.  
  332.  
  333.          There are six  library  functions  in  the  serial  I/O  category.
  334.          Together,  these  functions  give  the programmer complete control
  335.          over serial I/O.  Higher level functions  such  as  protocols  and
  336.          smart  modem communications can be completely implemented in terms
  337.          of these functions. Refer to the example code.
  338.  
  339.          SioGetc  and SioPutc perform all the actual serial I/O.  SioUnGetc
  340.          and SioRxFlush modify the receive queue. SioLine can  be  used  to
  341.          test for UART errors.
  342.  
  343.          SioGetc    -- Reads the next character from the serial line.
  344.          SioPutc    -- Transmit a character over a serial line.
  345.          SioUnGetc  -- "Un-gets" (puts back) a specified character.
  346.          SioRxFlush -- Flush ( clears) the receive buffer.
  347.          SioRxQue   -- Returns the number of characters in the receive queue.
  348.          SioLine    -- Reads the line status register.
  349.  
  350.  
  351.  
  352.  
  353.  
  354.  
  355.  
  356.  
  357.  
  358.  
  359.  
  360.         PCL4P Users Manual                                     Page 6
  361.                           5.  Error Detection
  362.  
  363.  
  364.          There are four functions in the error detection category. They are
  365.          concerned with detecting or reporting communications errors.   Use
  366.          of  these  functions  can make your application significantly more
  367.          robust.
  368.  
  369.          SioBrkKey  can  be  used  as  an  "emergency"   exit   from   your
  370.          application. SioBrkSig can read or modify the UART break bit. This
  371.          is  useful for signalling the remote system that a fatal condition
  372.          has occurred. SioLoopBack can be used to  test  the  integrity  of
  373.          your  UART.  SioError displays a error message corresponding to an
  374.          error  code  returned from a PCL4P function ( every PCL4P function
  375.          returns a code ).
  376.  
  377.          SioBrkKey -- Returns non-zero if the Control-BREAK key was pressed
  378.          SioBrkSig -- Asserts, cancels, or detects  BREAK  signal.
  379.          SioError  -- Displays  error  in  text.
  380.          SioLoopBack -- Performs a UART loopback test.
  381.  
  382.  
  383.                           6.  General Support
  384.  
  385.  
  386.          There are two functions in the general support category.  SioDelay
  387.          delays a specified number of clock tics while SioTimer returns the
  388.          system clock tics.
  389.  
  390.          SioDelay    -- Delays one or more tics.
  391.          SioTimer    -- Returns the number of system clock tics.
  392.  
  393.  
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400.  
  401.  
  402.  
  403.  
  404.  
  405.  
  406.  
  407.  
  408.  
  409.  
  410.  
  411.  
  412.  
  413.  
  414.  
  415.  
  416.  
  417.  
  418.  
  419.  
  420.         PCL4P Users Manual                                     Page 7
  421.                                   Installation
  422.  
  423.  
  424.          (1) Before installation of PCL4P , your compiler should already be
  425.          installed  on your system and tested. If you are not familiar with
  426.          makefiles,  refer  to  your  compiler  manual.  Examine  the  file
  427.          "FILES.LST" for a list of all the distribution files.
  428.  
  429.          (2) Make a backup  copy  of  your  distribution  disk.   Put  your
  430.          original distribution disk in a safe place.
  431.  
  432.          (3)  Create  a  work  directory  on your work disk ( normally your
  433.          harddisk ). For example, to create a work directory  named  PCL4P,
  434.          we first log onto the work disk and then type:
  435.  
  436.                                MKDIR PCL4P
  437.  
  438.          (4)  Copy  all the files from your backup copy of the distribution
  439.          disk to your work directory.  For example, to  copy  from  the  A:
  440.          drive to your work directory, we type:
  441.  
  442.                               CD PCL4P
  443.                               COPY A:*.*
  444.  
  445.          (5) Compile SIMPLE.PAS:
  446.  
  447.                               TPC SIMPLE
  448.  
  449.          SIMPLE.PAS should compile without any problems.
  450.  
  451.          (7) The recommended way to  test  SIMPLE  is  to  run  it  on  two
  452.          computers  connected  by a null modem cable.  Whatever is typed on
  453.          one computer should be displayed on the other.
  454.  
  455.          (8) Compile and run each of the remaining example programs.
  456.  
  457.  
  458.  
  459.  
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466.  
  467.  
  468.  
  469.  
  470.  
  471.  
  472.  
  473.  
  474.  
  475.  
  476.  
  477.  
  478.  
  479.  
  480.         PCL4P Users Manual                                     Page 8
  481.                                   Using the Library
  482.  
  483.  
  484.          The  PCL4P  has been tested on a TANDY 1000 ( 4.77 MHZ 8088 IBM PC
  485.          clone ), a TANDY 3000 ( 80286 IBM AT clone ), a TANDY 1400LT ( IBM
  486.          XT clone ), and a Gateway 2000 Cache ( 25 MHZ 80386-DX  ).   PCL4P
  487.          has been tested under MSDOS 2.11, 3.2, 3.3, 4.01, and 5.0.
  488.  
  489.          Please  examine  the  PCL4P.PAS file. Note that COM1 is defined as
  490.          port zero, not port one.  The user must assume  the  responsibilty
  491.          for passing the correct information when calling PCL4P functions.
  492.  
  493.          For an example of PCL4P use, examine the terminal emulator program
  494.          SIMPLE.PAS.  The user should compile and link SIMPLE.PAS as a test
  495.          of the library.
  496.  
  497.          If you have two computers, then you can connect them together with
  498.          a  null  modem  cable  and  run  SIMPLE  or TERM on both machines.
  499.          Whatever is typed on one machine should appear on the  other,  and
  500.          vice versa.
  501.  
  502.          If you have a modem, use TERM to call up any bulletin board system
  503.          ( BBS ). Be sure to un-comment the code that initializes th modem.
  504.  
  505.          in  the source code so that TERM sends an initialization string to
  506.          your modem.
  507.  
  508.          There are many free BBSs around the country. Look in any issue  of
  509.          "Computer  Shopper" ( available in bookstores, computer shops, and
  510.          many grocery stores ) for a list of current systems.
  511.  
  512.  
  513.  
  514.  
  515.  
  516.  
  517.  
  518.  
  519.  
  520.  
  521.  
  522.  
  523.  
  524.  
  525.  
  526.  
  527.  
  528.  
  529.  
  530.  
  531.  
  532.  
  533.  
  534.  
  535.  
  536.  
  537.  
  538.  
  539.  
  540.         PCL4P Users Manual                                     Page 9
  541.                                   Compiling
  542.  
  543.  
  544.          Registered users may wish to assemble  PCL4PLIB.ASM.  To  assemble
  545.          using the Microsoft assembler:
  546.  
  547.                MASM PCL4PLIB /DPASCAL_MODEL;
  548.  
  549.          To build the library TPU:
  550.  
  551.                TPC PCL4P
  552.  
  553.          To compile the sample programs:
  554.  
  555.                TPC SIMPLE.PAS
  556.  
  557.                TPC LOOPBACK.PAS
  558.  
  559.                TPC TERM.PAS /m
  560.  
  561.          A  makefile (  TERM.MAK  )  is  also  provided  for  the  TERM.PAS
  562.          program. To compile TERM and all dependent units, type:
  563.  
  564.                MAKE -FTERM
  565.  
  566.  
  567.  
  568.  
  569.  
  570.  
  571.  
  572.  
  573.  
  574.  
  575.  
  576.  
  577.  
  578.  
  579.  
  580.  
  581.  
  582.  
  583.  
  584.  
  585.  
  586.  
  587.  
  588.  
  589.  
  590.  
  591.  
  592.  
  593.  
  594.  
  595.  
  596.  
  597.  
  598.  
  599.  
  600.         PCL4P Users Manual                                     Page 10
  601.                              Talking To Your Modem
  602.  
  603.  
  604.          If your application uses a Modem ( as  opposed  to  using  a  null
  605.          modem  cable  ),  then  you  should  always send an initialization
  606.          string to your modem if it is a programmable modem such  as  those
  607.          made  by  Hayes.  Communication programs such as PROCOMM and TELIX
  608.          always send such a string automatically as soon as they start up.
  609.  
  610.          The particular initialization string depends on the make  of  your
  611.          modem.   For  Hayes  and  Hayes  compatible  modems, the following
  612.          string ( followed by a carriage return ) should work:
  613.  
  614.               AT E1 S7=60 S11=60 V1 X1 Q0 S0=0
  615.  
  616.          Refer to your Hayes User's Guide for a full  discussion  of  these
  617.          commands. A brief description is as follows:
  618.  
  619.          AT     Modem attention command.
  620.          E1     Modem will echo what you send to it.
  621.          S7=60  Wait 60 seconds for carrier and/or dial tone.
  622.          S11=60 Use 60 milliseconds for tone dialing duration & spacing.
  623.          V1     Display result code as words ( not numbers ).
  624.          X1     Use the extended result message ( CONNECT XXXX ) set.
  625.          Q0     Modem returns result codes.
  626.          S0=0   Do not answer RING.
  627.  
  628.          If your application will answer incoming calls, then  set  the  S0
  629.          register to the ring on which to automatically answer.
  630.  
  631.          If  you  send  the  above  codes  by using SioPutc ( as opposed to
  632.          typing them from the keyboard ), then follow these guidelines:
  633.  
  634.          (1) Send an initial  carriage  return  before  the  initialization
  635.          string.
  636.  
  637.          (2) Pause at least two tics ( 18 tics to the second )  after  each
  638.          character  sent  as  your  modem needs the time to perform its own
  639.          internal processing.  Pause a little longer if your modem  is  not
  640.          accepting your initialization string.
  641.  
  642.          (3) Pause one and a half seconds after sending any  initialization
  643.          command  such  as ATZ or AT&F since your modem must do quite a bit
  644.          of processing.
  645.  
  646.          If you experience any problems in initializing your  Hayes  modem,
  647.          you should first reset it to factory settings by sending:
  648.  
  649.               AT&F
  650.  
  651.          Refer  to  the  TERM program ( functions SendTo and WaitFor in the
  652.          file MODEM_IO.PAS ) for an  example  of  sending  an  initialization
  653.          string to a Hayes compatible modem.
  654.  
  655.  
  656.  
  657.  
  658.  
  659.  
  660.         PCL4P Users Manual                                     Page 11
  661.                                   Problems
  662.  
  663.  
  664.          If you cannot get your application to run properly, first  compile
  665.          and  run  the  terminal  emulator program TERM provided on your
  666.          distribution disk.  If you are using  a  null  modem  cable  or  a
  667.          non-programmable  modem, be sure to set the HAYES constant to 0 in
  668.          the source code ( #define HAYES 0 ).  If you  are  using  a  Hayes
  669.          compatible  modem, set the HAYES constant to 1. If you are using a
  670.          programmable modem which is not Hayes compatible,  then  you  must
  671.          modify the initialization string for your particular modem.
  672.  
  673.          If  your application does not run but TERM runs correctly, then
  674.          you  have  most  likely  made  a  programming  mistake   in   your
  675.          application. MarshallSoft Computing cannot debug your application,
  676.          especially  over  the  telephone!   However,  consider each of the
  677.          following when searching for an error in your application.
  678.  
  679.          1.  Did you include the "uses PCL4P" statement ?
  680.  
  681.          2.  Is your receive buffer large enough ? If you are using 1K data
  682.              blocks in YMODEM, then your receive buffer should be at  least
  683.              1K ( 2K if baud rates above 38400 are to be used ).
  684.  
  685.          4.  Have you selected too high a baud rate ( if you  are  using  a
  686.              slow PC ) ?  If only one COM port is being run, you should  be
  687.              able to run at 38400 baud on 8088 machines and 115200 on  most
  688.              286 and all 386 and 486 machines.
  689.  
  690.          5.  Are  you  attempting  to  run  another  application   in   the
  691.              background ?  Try running  without any other programs  running
  692.              in the background ( unload all TSR programs ).
  693.  
  694.          6.  If you are running two COM ports simultaneously, are you using
  695.              separate receive buffers ? ( you should ).
  696.  
  697.          7.  Did SioReset return a zero value ?  If not, then you must call
  698.              SioReset again. See TERM.PAS for an example.
  699.  
  700.          8.  Did you send the proper initialization string to your modem ?
  701.              Did you set DTR and RTS ? ( you should ).
  702.  
  703.          9.  Do you have more than one COM1 port, etc.  For example, if you
  704.              have a COM1 port on your motherboard,  you cannot add  another
  705.              COM1  port  or  modem  board  that  uses  COM1  without  first
  706.              disabling the COM1 on the motherboard.
  707.  
  708.          Registered  users  can call (205) 881 - 4630 from 5 PM to 8 PM CST
  709.          Monday through Friday for help.
  710.  
  711.  
  712.  
  713.  
  714.  
  715.  
  716.  
  717.  
  718.  
  719.  
  720.         PCL4P Users Manual                                     Page 12
  721.                                   Function Summary
  722.  
  723.  
  724.          Refer to the PCL4P Reference Manual (  PCL4P.REF  )  for  detailed
  725.          information  on  the  communications  and support functions. A one
  726.          line summary of each function follows:
  727.  
  728.  
  729.          SioBaud     Sets the baud rate of the selected port.
  730.          SioBrkKey   Returns non-zero if the Control-BREAK key was pressed.
  731.          SioBrkSig   Asserts, cancels, or detects BREAK signal.
  732.          SioCTS      Reads the Clear to Send (CTS) modem status bit.
  733.          SioDCD      Reads the Data Carrier Detect (DCD) modem status bit.
  734.          SioDelay    Delays one or more tics ( 18 tics per second ).
  735.          SioDone     Terminates further serial processing.
  736.          SioDSR      Reads the Data Set Ready (DSR) modem status bit.
  737.          SioDTR      Set, clear, or read the Data Terminal Ready (DTR) bit.
  738.          SioError    Displays error in text.
  739.          SioFIFO     Sets the FIFO trigger level ( INS16550 only ).
  740.          SioGetc     Reads the next character from the serial line.
  741.          SioIRQ      Assigns a IRQ line to a port.
  742.          SioLine     Reads the line status register.
  743.          SioLoopBack Performs a UART loopback test.
  744.          SioModel    Returns a code corresponding to the memory model used.
  745.          SioModem    Reads the modem status register.
  746.          SioParms    Sets parity, stop bits, and word length.
  747.          SioPutc     Transmit a character over a serial line.
  748.          SioReset    Initialize a serial port for processing.
  749.          SioRI       Reads the Ring Indicator (RI) modem status bit.
  750.          SioRTS      Sets, clears, or reads the Request to Send (RTS) line.
  751.          SioRxBuf    Sets up receive buffer.
  752.          SioRxFlush  Flushes ( clears ) the receive buffer.
  753.          SioRxQue    Returns the number of characters in the receive queue.
  754.          SioTimer    Returns the number of system clock tics.
  755.          SioUART     Sets the UART base address.
  756.          SioUnGetc   "Un-gets" ( puts back ) a specified character.
  757.  
  758.  
  759.  
  760.  
  761.  
  762.  
  763.  
  764.  
  765.  
  766.  
  767.  
  768.  
  769.  
  770.  
  771.  
  772.  
  773.  
  774.  
  775.  
  776.  
  777.  
  778.  
  779.  
  780.         PCL4P Users Manual                                     Page 13
  781.                          Serial Communications
  782.  
  783.  
  784.          The heart  of  serial  communications  is  the  UART  (  Universal
  785.          Asynchronous   Receiver  Transmitter  ).   The  IBM  PC/XT/AT  and
  786.          compatibles use the INS8250, INS16450, or the INS16550  UART.  The
  787.          purpose of the UART is:
  788.  
  789.          (1)  To  convert  bytes  from the CPU ( Central Processing Unit ),
  790.          into a serial format by adding  the  necessary  start,  stop,  and
  791.          parity bits to each byte before transmission, and to then transmit
  792.          each bit at the correct baud rate.
  793.  
  794.          (2) To convert the incoming stream ( at a specified baud rate ) of
  795.          serial  bits  into  bytes  by removing the start, stop, and parity
  796.          bits before being made available to the CPU.
  797.  
  798.          The  UART  is  part of the serial interface circuitry which allows
  799.          the CPU to send and receive signals over the RS232 lines. This can
  800.          be diagrammed as follows:
  801.  
  802.                                Serial Interface
  803.                             *********************
  804.                             *                   *
  805.          *******  Data Bus  *     ********      *    RS232 Signals
  806.          * CPU **************     * UART *      ******************
  807.          *******            *     ********      *
  808.                             *                   *
  809.                             *********************
  810.  
  811.          The  INS8250/16450/16550  UART  is  capable of operating in one of
  812.          two  modes,  "polled"  and   "interrupt   driven".    The   serial
  813.          communications  functions  in the BIOS uses the polled method.  In
  814.          this approach, the CPU is typically in a loop asking the UART over
  815.          and over again if it has a byte ready. If its  does,  the  polling
  816.          code  returns the byte.  But, if the next byte comes in before the
  817.          polling code is executing again, then that byte is lost.
  818.  
  819.          In the interrupt driven approach ( used by PCL4C for incoming data
  820.          ), when a byte is received by  the  UART,  an  "Interrupt  Service
  821.          Routine"  (  ISR ) is executed immediately, suspending temporarily
  822.          whatever else is executing.  The ISR then  moves  the  byte  to  a
  823.          buffer  so  that your application program can later read it. Refer
  824.          to the sections entitled "RS232  Signals"  and  "National  INS8250
  825.          UART" for further information on these topics.
  826.  
  827.          The best way to learn about serial communications  is  to  read  a
  828.          good  book  on the subject. Several good texts are available.  Two
  829.          that I like are:
  830.  
  831.          (1) C Programmers's Guide to Serial Communications by Joe Campbell
  832.          (SAMS)
  833.  
  834.          (2) Mastering Serial Communications by Peter Gofton (SYBEX).
  835.  
  836.  
  837.  
  838.  
  839.  
  840.         PCL4P Users Manual                                     Page 14
  841.                                   IBM Communications Ports
  842.  
  843.  
  844.          There  are  a  few  things to know about how serial communications
  845.          ports are used by  IBM  PC/XT/AT  and  compatible  computers.  The
  846.          standard IBM PC/XT/AT configuration values are as follows:
  847.  
  848.          Port     Reg Base   IRQ Line   Vector
  849.          COM1        3F8H        4        12
  850.          COM2        2F8H        3        11
  851.          COM3        3E8H        4        12
  852.          COM4        2E8H        3        11
  853.  
  854.          PCL4P assumes the  above  values.  If  necessary,  the  UART  base
  855.          address   can  be changed by SioUART. However, the IRQ and Service
  856.          vector values can not be changed ( unless you  modify  the  source
  857.          code ).
  858.  
  859.          When installing new communications cards, the following guidelines
  860.          are recommended:
  861.  
  862.          (1) Be sure to read the documentaion  for  the  hardware  you  are
  863.          installing.   Pay special attention to UART base addresses and IRQ
  864.          lines.
  865.  
  866.          (2) If you have a choice in base addresses and IRQ  lines,  always
  867.          choose standard values as defined above.
  868.  
  869.          (3) The first port should be COM1, the second COM2, etc.
  870.  
  871.          (4)  Use  SioUART  to  zero  all  unused ports ( for example, call
  872.          SioUART(COM4,0) if there is no COM4 port installed ).
  873.  
  874.          (5)  Be  carefull not to configure two ports for the same address.
  875.          This is easier to do than you may believe.
  876.  
  877.          (6) Choose an external modem over an internal  one.   It  is  much
  878.          easier  to  debug problems with an external modem than an internal
  879.          one.
  880.  
  881.          (7) Always test your port as soon as it is installed.
  882.  
  883.  
  884.  
  885.  
  886.  
  887.  
  888.  
  889.  
  890.  
  891.  
  892.  
  893.  
  894.  
  895.  
  896.  
  897.  
  898.  
  899.  
  900.         PCL4P Users Manual                                     Page 15
  901.                                   RS232 Signals
  902.  
  903.  
  904.          RS-232  is  the name of the serial data interface standard used to
  905.          connect computers to modems.  Most IBM  compatible  computers  are
  906.          built  with  at least one serial port and use either DB9 ( 9 pin )
  907.          or DB25 ( 25 pin ) connectors.
  908.  
  909.          A summary of these pins and  their  function  follows.   For  more
  910.          detailed  information, refer to one of the many books dealing with
  911.          RS-232 interfacing.
  912.  
  913.          Signal Ground Pin 7 (DB25), Pin 5 (DB9)
  914.  
  915.          The SG line is used as the common signal ground, and  must  always
  916.          be connected.
  917.  
  918.          Transmit Data Pin 2 (DB25), Pin 3 (DB9)
  919.  
  920.          The TX line is used to carry data from the computer to the modem.
  921.  
  922.          Receive Data Pin 3 (DB25), Pin 2 (DB9)
  923.  
  924.          The RX line is used to carry data from the modem to the computer.
  925.  
  926.          Data Terminal Ready Pin 20 (DB25), Pin 4 (DB9)
  927.  
  928.          The  DTR  line is used by the computer to signal the modem that it
  929.          is ready.
  930.  
  931.          Data Set Ready Pin 6 (DB25), Pin 6 (DB9)
  932.  
  933.          The DSR line is used by the modem to signal the computer  that  it
  934.          is ready.
  935.  
  936.          Request to Send Pin 4 (DB25), Pin 7 (DB9)
  937.  
  938.          The  RTS  line  is  used  to "turn the line around" in half duplex
  939.          modems, but is not necessary in full duplex modems.
  940.  
  941.          Clear to Send Pin 5 (DB25), Pin 8 (DB9)
  942.  
  943.          The  CTS  line, like the RTS line, is not necessary in full duplex
  944.          modems.
  945.  
  946.          Data Carrier Detect Pin 8 (DB25), Pin 1 (DB9)
  947.  
  948.          The DCD line is used by the modem to signal the  computer  that  a
  949.          data carrier signal is present.
  950.  
  951.          Ring Indicator Pin 22 (DB25), Pin 9 (DB9)
  952.  
  953.          The RI line is asserted when a 'ring' occurs.
  954.  
  955.  
  956.  
  957.  
  958.  
  959.  
  960.         PCL4P Users Manual                                     Page 16
  961.                 National INS8250, INS16450, and INS16550 UARTs
  962.  
  963.          The Personal Communications  Library  is  based  on  the  standard
  964.          National  INS8250,  INS16450, and INS16550 UARTs. The 8250 was the
  965.          original UART used in the IBM PC, whereas the 16450  is  a  faster
  966.          version  found  on most 286 & up machines. The 16550 contains a 16
  967.          byte FIFO to further reduce communications overhead.  These  UARTs
  968.          consists of 8 register ports as follows:
  969.  
  970.          Offset    R/W   Register
  971.            0       R/W   Receiver ( read ) / Transmitter ( write )
  972.            1       R/W   Interrupt Enable ( read )
  973.            2       R     Interrupt Identification
  974.            2       W     FIFO control ( INS16550 only )
  975.            3       R/W   Data Format ( Line Control )
  976.            4       R/W   RS-232 ( Modem ) Control
  977.            5       R/W   Line Status
  978.            6       R/W   RS-232 ( Modem ) Status
  979.            7       R/W   Not used.
  980.  
  981.          The  UART  registers  are  based  at  3F8  (COM1), 2F8 (COM2), 3E8
  982.          (COM3), and 2E8 (COM4). COM1 and COM3 share  interrupt  vector  12
  983.          and  interrupt  request  line  IRQ4  while  COM2  and  COM4  share
  984.          interrupt vector 11 and interrupt request line IRQ3.   This  means
  985.          that  COM1  and  COM3  cannot  both  be  used  at  the  same time.
  986.          Similarly, COM2 and COM4 cannot both be used at the same time.
  987.  
  988.  
  989.          Port     Reg Base   IRQ Line   Vector
  990.          COM1        3F8H        4        12
  991.          COM2        2F8H        3        11
  992.          COM3        3E8H        4        12
  993.          COM4        2E8H        3        11
  994.  
  995.          Four sources of interrupts are possible with the 8250  and  16550:
  996.          (1) receiver error or BREAK, (2) receiver data ready, (3) ready to
  997.          transmit,  and  (4) RS232 input.  These four sources of interrupts
  998.          are summarized as follows:
  999.  
  1000.          Source of Interrupt        Action Required to Clear
  1001.          Receiver error or BREAK.   Read Line Status register.
  1002.          Receiver data.             Read data from data register.
  1003.          Transmitter Buffer Empty.  Write to data register or read IID reg.
  1004.          RS232 input.               Read Modem Status register.
  1005.  
  1006.          However,  PCL4C  only  enables  the receiving data interrupt. This
  1007.          means that interrupts can only be caused by incoming data.
  1008.  
  1009.          If  you  are not familiar with the INS8250, several good books are
  1010.          available.   Refer  to  the  Serial  Communications  chapter   for
  1011.          recommendations.    Although  a  knowledge  of  the  8250  is  not
  1012.          necessary to use PCL4C, a  general  knowledge  of  the  theory  of
  1013.          asynchronous serial communications is recommended.
  1014.  
  1015.  
  1016.  
  1017.  
  1018.  
  1019.  
  1020.         PCL4P Users Manual                                     Page 17
  1021.                                Register Summary
  1022.  
  1023.  
  1024.          REG 0 : Data Register
  1025.  
  1026.          Reading  from  the data register fetches the next input byte, once
  1027.          it is ready.  Writing to the  data  register  transmits  the  byte
  1028.          written to it over the serial line.
  1029.  
  1030.          REG 1 : Interrupt Enable 
  1031.  
  1032.          The  Interrupt  Enable  register  enables  each  of  four types of
  1033.          interrupts when the appropriate bit is set to a one.
  1034.  
  1035.          bit 3 : Enable interrupt on RS232 input.
  1036.          bit 2 : Enable interrupt on receiver error or break.
  1037.          bit 1 : Enable interrupt on transmitter buffer empty ( TBE ).
  1038.          bit 0 : Enable interrupt on received data ( RxRDY ).
  1039.  
  1040.          REG 2 : Interrupt Identification (IID)
  1041.  
  1042.          Reading  the  Interrupt Identification ( read only ) register once
  1043.          an interrupt has occurred identifies the interrupt as follows:
  1044.  
  1045.          Bit 2  Bit 1  Bit 0  Priority    Interrupt
  1046.            0      0      1      none      none
  1047.            1      1      0      0 (high)  Serialization or break.
  1048.            1      0      0      1         Received data.
  1049.            0      1      0      2         Transmitter Buffer Empty.
  1050.            0      0      0      3 (low)   RS232 Input.
  1051.  
  1052.          In the INS16650, REG 2 ( write only ) is  also  the  FIFO  control
  1053.          register.   Writing  bits  6 & 7 will set the FIFO trigger level (
  1054.          number of bytes received before an interrupt is generated ).
  1055.  
  1056.          Bit 7  Bit 6   Trigger             Bit 7  Bit 6   Trigger
  1057.           0      0      1 byte               1      1      8 bytes
  1058.           0      1      4 bytes              1      1      14 bytes
  1059.  
  1060.          REG 3 : Line Control
  1061.  
  1062.          RS232 line parameters are selected by writing to this register.
  1063.  
  1064.          bit 7 : DLAB = 0
  1065.          bit 6 : BREAK on(1), off(0).
  1066.          bits 5-3: Parity None(000),ODD(001),EVEN(011),MARK(101),SPACE(111)
  1067.          bit 2 : One stop bit(0), two stop bits(1).
  1068.          bits 1-0: Data bits = 5 (00), 6(01), 7(10), 8(11).
  1069.  
  1070.          When the Divisor Latch Access Bit ( DLAB ) is 1, registers 0 and 1
  1071.          become the LS and MS bytes of the Baud Rate Divisor registers.
  1072.  
  1073.          Baud   Divisor      Baud  Divisor      Baud  Divisor
  1074.           300    0180        4800   0018       38400   0003
  1075.          1200    0060        9600   000C       57600   0002
  1076.          2400    0030       19200   0006      115200   0001
  1077.  
  1078.  
  1079.  
  1080.         PCL4P Users Manual                                     Page 18
  1081.          REG 4 : Modem Control
  1082.  
  1083.          RTS, DTR, loopback testing, and General Purpose Outputs #1 and  #2
  1084.          are controlled by the Modem Control register as follows:
  1085.  
  1086.          bit 4 : Enable local loopback.
  1087.          bit 3 : Enable GP02. Necessary for 8250 interrupts.
  1088.          bit 2 : Enable GP01.
  1089.          bit 1 : Set / clear RTS.
  1090.          bit 0 : Set / clear DTR.
  1091.  
  1092.          REG 5 : Line Status
  1093.  
  1094.          Reading  the  Line  Status register provides status information as
  1095.          follows ( 1 for TRUE, 0 for FALSE ) :
  1096.  
  1097.          bit 6 : Transmitter Empty.
  1098.          bit 5 : Transmitter Buffer Empty ( TBE ).
  1099.          bit 4 : BREAK detect.
  1100.          bit 3 : Framing error.
  1101.          bit 2 : Parity error.
  1102.          bit 1 : Overrun error.
  1103.          bit 0 : Data Ready.
  1104.  
  1105.          REG 6 : Modem Status
  1106.  
  1107.          Reading the Modem Status register provides  the  following  status
  1108.          information ( 1 for TRUE, 0 for FALSE ) :
  1109.  
  1110.          bit 7 : DCD status.
  1111.          bit 6 : RI status.
  1112.          bit 5 : DSR status.
  1113.          bit 4 : CTS status.
  1114.          bit 3 : Delta DCD status.
  1115.          bit 2 : Delta RI status.
  1116.          bit 1 : Delta DSR status.
  1117.          bit 0 : Delta CTS status.
  1118.  
  1119.          The  delta  bits  ( bits 0 through 3 ) are set whenever one of the
  1120.          status bits ( bits 4 through 7 ) changes ( from 0 to 1 or  from  1
  1121.          to  0  )  since  the  last time that the Modem Status register was
  1122.          read. Reading the Modem Status register clear the delta bits.
  1123.  
  1124.          REG 7 : Scratch Register
  1125.  
  1126.          There is no function associated with  register  7.   It  does  not
  1127.          exist in early versions of the 8250.
  1128.  
  1129.  
  1130.  
  1131.  
  1132.  
  1133.  
  1134.  
  1135.  
  1136.  
  1137.  
  1138.  
  1139.  
  1140.         PCL4P Users Manual                                     Page 19
  1141.                                   Example Code
  1142.  
  1143.  
  1144.          The  following programs are provided as examples of the use of the
  1145.          PCL4P library.  They are not part of the PCL4P library, and may be
  1146.          used in any way the user wishes. Makefiles (  small  model  )  are
  1147.          provided for all example code.
  1148.  
  1149.          SIMPLE
  1150.  
  1151.          SIMPLE  is  an  extremely simple terminal emulator program.  It is
  1152.          provided as the smallest and  easiest  to  understand  example  of
  1153.          serial communications programming using PCL4P.
  1154.  
  1155.          To  start  SIMPLE,  just type SIMPLE. The baud rate is set at 2400
  1156.          and can be easily changed in the source code. Similiarly the  port
  1157.          is set to COM1 and is easily changed in the source code. Note that
  1158.          SIMPLE does not send an initialization string to your modem.
  1159.  
  1160.          TERM
  1161.  
  1162.          TERM  is  a  more  capable  terminal  emulator  than  SIMPLE.   It
  1163.          functions as a dumb terminal emulator but can exchange files using
  1164.          XMODEM ( Standard XMODEM, XMODEM-CRC, and XMODEM-1K ) and YMODEM (
  1165.          batch  capability  ) communications protocols. TERM will also send
  1166.          an initialization string to your Hayes compatible modem.
  1167.  
  1168.          To start TERM, type TERM followed by the port ( 1 to 4 )  and  the
  1169.          baud rate ( 300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 57600,
  1170.          or 115200). For example, "TERM 4 2400".
  1171.  
  1172.          LOOPBACK
  1173.  
  1174.          LOOPBACK performs a loopback test of the selected port UART.  This
  1175.          is  useful  for  testing  a  serial port UART that is suspected of
  1176.          being bad. However, defective UARTS are very unusual.
  1177.  
  1178.          Start LOOPBACK by typing LOOPBACK followed by the port ( 1 to 4 ).
  1179.          For example "LOOPBACK 4".
  1180.  
  1181.          MODEM
  1182.  
  1183.          MODEM  displays the modem status lines (DSR, CTS, DCD, and RI) and
  1184.          the modem control lines (DTR and RTS). Additionally, it allows the
  1185.          user to set or clear the modem control lines. MODEM is useful when
  1186.          testing RS232 cable connections.
  1187.  
  1188.          To start MODEM, type MODEM followed by the port ( 1 to  4  ).  For
  1189.          example "MODEM 1".
  1190.  
  1191.  
  1192.  
  1193.  
  1194.  
  1195.  
  1196.  
  1197.  
  1198.  
  1199.  
  1200.         PCL4P Users Manual                                     Page 20
  1201.                                   Revision History
  1202.  
  1203.  
  1204.          Version 1.0 -- 14 January 1991 -- original release.
  1205.  
  1206.          Version 1.1 -- 11 March 1991
  1207.  
  1208.          o  Added SioUnGetc() function to library.
  1209.          o  Minor documentation changes.
  1210.  
  1211.          Version 1.2 -- 1 June 1991
  1212.  
  1213.          o  Name changed to Personal Communications Library.
  1214.          o  Minor bug fixes.
  1215.  
  1216.          Version 1.3 -- 1 July 1991
  1217.  
  1218.          o  Added NORESET option to SioReset.
  1219.          o  Added SioDSR, SioCTS, SioDCD, and SioRI.
  1220.          o  Added SioLoopBack function to library.
  1221.          o  Added LOOPBACK.PAS example program.
  1222.  
  1223.          Version 2.0 -- 1 Nov 1991
  1224.  
  1225.          o  All example code released in shareware package.
  1226.          o  Fixed bug due to Microsoft Assembler (MASM 5.0,5.1) error.
  1227.          o  Greatly expanded documentation.
  1228.  
  1229.          ( MarshallSoft incorporated on December 23, 1991 )
  1230.  
  1231.          Version 3.0 -- 15 Jan 1991
  1232.  
  1233.          o  Added XMODEM & YMODEM to example code.
  1234.          o  Added SioUART function.
  1235.          o  Added "UART undefined" error code.
  1236.          o  Added "Bad or missing UART" error code.
  1237.          o  Added "Port already enabled" error code.
  1238.          o  Added "Cannot enable both COM1 & COM3 ..." error code.
  1239.          o  Fixed several minor bugs ( using new automated testing ).
  1240.  
  1241.          Version 3.1 -- 1 March 1992
  1242.  
  1243.          o  Added SioFIFO ( INS16550 only ).
  1244.          o  Added SioIRQ function.
  1245.          o  Increased maximum receive buffer size to 32K bytes.
  1246.          o  Added MODEM.C example code.
  1247.  
  1248.  
  1249.  
  1250.  
  1251.  
  1252.  
  1253.  
  1254.  
  1255.  
  1256.  
  1257.  
  1258.  
  1259.  
  1260.         PCL4P Users Manual                                     Page 21
  1261.                                   License
  1262.  
  1263.  
  1264.          MarshallSoft Computing, Inc. grants the registered user  of  PCL4P
  1265.          the  right  to  use  the  PCL4P  library ( in object form ) in the
  1266.          development  of  any  software  product  without  any   royalties.
  1267.          However,  the  source  code for the library may not be released in
  1268.          whole or in part.
  1269.  
  1270.  
  1271.                                   Warranty
  1272.  
  1273.  
  1274.          MARSHALLSOFT COMPUTING, INC. DISCLAIMS ALL WARRANTIES RELATING  TO
  1275.          THIS  SOFTWARE,  WHETHER  EXPRESSED  OR IMPLIED, INCLUDING BUT NOT
  1276.          LIMITED TO ANY IMPLIED WARRANTIES OF MERCHANTABILITY  AND  FITNESS
  1277.          FOR  A  PARTICULAR  PURPOSE, AND ALL SUCH WARRANTIES ARE EXPRESSLY
  1278.          AND SPECIFICALLY DISCLAIMED. NEITHER MARSHALLSOFT COMPUTING,  INC.
  1279.          NOR ANYONE ELSE WHO HAS BEEN INVOLVED IN THE CREATION, PRODUCTION,
  1280.          OR  DELIVERY  OF  THIS  SOFTWARE SHALL BE LIABLE FOR ANY INDIRECT,
  1281.          CONSEQUENTIAL, OR INCIDENTAL DAMAGES ARISING OUT  OF  THE  USE  OR
  1282.          INABILITY  TO  USE  SUCH  SOFTWARE EVEN IF MARSHALLSOFT COMPUTING,
  1283.          INC.  HAS BEEN ADVISED OF  THE  POSSIBILITY  OF  SUCH  DAMAGES  OR
  1284.          CLAIMS. IN NO EVENT SHALL MARSHALLSOFT COMPUTING, INC.'S LIABILITY
  1285.          FOR ANY SUCH DAMAGES EVER EXCEED THE PRICE PAID FOR THE LICENSE TO
  1286.          USE  THE SOFTWARE, REGARDLESS OF THE FORM OF THE CLAIM. THE PERSON
  1287.          USING  THE  SOFTWARE  BEARS  ALL  RISK  AS  TO  THE  QUALITY   AND
  1288.          PERFORMANCE OF THE SOFTWARE.
  1289.  
  1290.          Some  states  do not allow the exclusion of the limit of liability
  1291.          for consequential or incidental damages, so the  above  limitation
  1292.          may not apply to you.
  1293.  
  1294.          This  agreement  shall  be  governed  by  the laws of the State of
  1295.          Alabama and shall inure to the benefit of Marshallsoft  Computing,
  1296.          Inc.   and  any successors, administrators, heirs and assigns. Any
  1297.          action or proceeding brought by either  party  against  the  other
  1298.          arising  out of or related to this agreement shall be brought only
  1299.          in a STATE or FEDERAL COURT of competent jurisdiction  located  in
  1300.          Madison County, Alabama. The parties hereby consent to in personam
  1301.          jurisdiction of said courts.
  1302.  
  1303.  
  1304.  
  1305.  
  1306.  
  1307.  
  1308.  
  1309.  
  1310.  
  1311.  
  1312.  
  1313.  
  1314.  
  1315.  
  1316.  
  1317.  
  1318.  
  1319.  
  1320.         PCL4P Users Manual                                     Page 22
  1321.  
  1322.