home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 18 / CD_ASCQ_18_111294_W.iso / dos / prg / pas / pcl4p42 / pcl4p.usr < prev    next >
Text File  |  1994-08-19  |  82KB  |  2,110 lines

  1.  
  2.  
  3.                                Personal Communications Library
  4.  
  5.                                      For Turbo Pascal
  6.  
  7.  
  8.                                          (PCL4P)
  9.  
  10.  
  11.  
  12.                                       USERS MANUAL
  13.  
  14.  
  15.  
  16.  
  17.  
  18.                                        Version 4.2
  19.  
  20.                                        Sept 1, 1994
  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) 1994
  32.                                    All rights reserved
  33.  
  34.  
  35.  
  36.                                    MarshallSoft Computing, Inc.
  37.                                    Post Office Box 4543
  38.                                    Huntsville AL 35815
  39.  
  40.                                    Voice 205-881-4630
  41.                                    FAX   205|881|4630
  42.                                    BBS   205-880-9748
  43.  
  44.  
  45.  
  46.  
  47.                                             _______
  48.                                        ____|__     |                (R)
  49.                                     --+       |    +-------------------
  50.                                       |   ____|__  |  Association of
  51.                                       |  |       |_|  Shareware
  52.                                       |__|   o   |    Professionals
  53.                                     --+--+   |   +---------------------
  54.                                          |___|___|    MEMBER
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.              PCL4 Users Manual                                                Page 1
  69.                                    C O N T E N T S
  70.  
  71.  
  72.  
  73.  
  74.  
  75.                 Chapter                                                   Page
  76.  
  77.                 1.0 Introduction................................................3
  78.                     1.1 User Support............................................4
  79.                     1.2 ASP Ombudsman...........................................4
  80.                     1.3 A Typical Application...................................5
  81.                     1.4 Installation............................................6
  82.                 2.0 Library Organization........................................7
  83.                     2.1 Configuration...........................................7
  84.                     2.2 Initialization & Termination............................7
  85.                     2.3 Modem Control & Status..................................8
  86.                     2.4 Serial I/O..............................................8
  87.                     2.5 Error Detection.........................................9
  88.                     2.6 General Support.........................................9
  89.                 3.0 Library Overview...........................................10
  90.                     3.1 Using the Library......................................10
  91.                     3.2 Example Programs.......................................10
  92.                     3.3 Door Programs..........................................10
  93.                     3.4 BBS Programs...........................................11
  94.                     3.5 Compiling & Linking....................................11
  95.                     3.6 Turbo Vision...........................................11
  96.                 4.0 Talking to Your Modem......................................12
  97.                     4.1 Modem Standards........................................12
  98.                     4.2 Flow Control...........................................13
  99.                     4.3 MODEM_IO functions.....................................13
  100.                     4.4 Modem Initialization...................................14
  101.                 5.0 Problems...................................................15
  102.                 6.0 Serial Communications......................................16
  103.                     6.1 Communications Basics..................................16
  104.                     6.2 Standard Port Addresses................................17
  105.                     6.3 Running 3 or 4 Ports Concurrently......................18
  106.                     6.4 Using Multiport Cards..................................19
  107.                         6.4.1 The DigiBoard....................................19
  108.                         6.4.2 The BOCA Board...................................19
  109.                     6.5 Transmitter Interrupts.................................20
  110.                     6.6 RS232 Signals..........................................21
  111.                     6.7 National INS8250, INS16450, and INS16550 UARTs.........22
  112.                     6.8 Register Summary.......................................23
  113.                 7.0 Terminal Emulator Program (TERM)...........................25
  114.                 8.0 Legal Issues...............................................26
  115.                     8.1 Registration...........................................27
  116.                     8.2 License................................................27
  117.                     8.3 Warranty...............................................27
  118.                 9.0 Summary....................................................28
  119.                     9.1 Revision History.......................................28
  120.                     9.2 Function Summary.......................................30
  121.                     9.3 Further Reading........................................30
  122.                10.0 Other MarshallSoft Computing products for Pascal...........31
  123.                     10.1 The LZW Data Compression Library for Pascal...........31
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.              PCL4 Users Manual                                                Page 2
  137.               1.0 Introduction
  138.  
  139.  
  140.               The   Personal  Communications  Library  for  Turbo  Pascal  (PCL4P)  is  an
  141.               asynchronous  communications  library  designed  for  experienced   software
  142.               developers  programming  in  Turbo  Pascal,  version  4.0  and  up.  The PCL
  143.               features:
  144.  
  145.               o 35 communications and support functions.
  146.               o Support for the high performance 16550 UART.
  147.               o Supports hardware (RTS/CTS) flow control.
  148.               o Interrupt driven receiver and transmitter (optional).
  149.               o Supports 300 baud to 115,200 baud.
  150.               o Supports the DigiBoard PC/4 and PC/8.
  151.               o Supports the BOCA BB1004, BB1008, and BB2016 boards.
  152.               o Supports COM1 through COM8 (through COM16 with multiport board)
  153.               o Adjustable receive queues from 8 bytes to 32 KB.
  154.               o Control-BREAK error exit.
  155.               o 18 communications error conditions trapped.
  156.               o Allows 4 ports to run concurrently (16 with multiport board).
  157.               o Complete modem control & status.
  158.               o Written in assembly language for small size & high speed.
  159.               o Terminal program featuring ASCII (with XON/XOFF), XMODEM, YMODEM,
  160.                 and YMODEM-G.
  161.  
  162.  
  163.               Why should you buy PCL4P ?  Several good reasons are:
  164.  
  165.                 COMPLETE - PCL4P is complete since it provides absolute control
  166.                            of the serial ports (including the high  performance
  167.                            INS16550).
  168.  
  169.                  COMPACT - PCL4P  is  very compact  at  less  than  8  KB. Your
  170.                            application doesn't carry a lot of excess code.
  171.  
  172.                     FAST - PCL4P is fast since it will  run  at  38400  baud  on
  173.                            even  slow  8088 PCs (4.77 MHZ) and at 115200 baud on
  174.                            most everything else.
  175.  
  176.                  SUPPORT - If you get stuck,  you talk  to  the programmer  that
  177.                            wrote the code, not a  person  hired  to  answer  the
  178.                            phone.
  179.  
  180.                      BBS - A BBS is available (2400 to 9600 baud, N81) in order
  181.                            to provide immediate support as necessary.
  182.  
  183.               NEWSLETTER - One  year  subscription  to  the  MSC  newsletter
  184.                            discusses communications  problems  and  solutions
  185.                            (published quarterly).
  186.  
  187.                    PRICE - You get PCL4P for a very reasonable price !
  188.  
  189.                 UPGRADES - Once you buy PCL4P, you can always update to  the  most
  190.                            recent version very inexpensively ($15 plus shipping).
  191.  
  192.  
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.              PCL4 Users Manual                                                Page 3
  205.               1.1 User Support
  206.  
  207.               We want you to be successful in developing your applications using PCL4P! We
  208.               depend on our customers to let us know what they need  in  a  communications
  209.               library.   This  means we are committed to providing the best communications
  210.               library that we can. If you have any suggestions or comments, please let  us
  211.               know.
  212.  
  213.               If you are having a problem using PCL4P, call  us  at  205-881-4630  between
  214.               1:30  PM  and  9:30  PM  CST  Monday through Saturday, or FAX us at the same
  215.               telephone number at any time (24 hours).  You can also call at  other  times
  216.               and  leave  a message, and call back later for a reply. However, we can only
  217.               answer questions with respect to using the PCL4P library.   We  cannot  help
  218.               you program your application, but we'll be glad to discuss it with you.
  219.  
  220.               You may also call our User Support BBS (2400 to 9600 baud, no parity, 8 data
  221.               bits,  1  stop  bit)  at 205-880-9748 and leave a message (address it to the
  222.               SYSOP).  We will usually have a reply ready for you within 24 hours.
  223.  
  224.               The BBS is available 24 hours per day. All files are in standard ZIP format.
  225.               The  BBS  will  contain  the  latest  shareware  version of all MarshallSoft
  226.               products as well as related files such as:
  227.  
  228.                   BUGS.ZIP     -  Bug report.
  229.                   NEWS.ZIP     |  Latest news regarding our products.
  230.                   PRODUCTS.DOC -  List of all shareware products.
  231.  
  232.               The MarshallSoft  Computing,  Inc.   newsletter  "Comm  Talk"  is  published
  233.               quarterly.  It discusses various communications problems and solutions using
  234.               PCL4P  as  well  as related information. Registered users receive a one year
  235.               complimentary subscription  when  first  registering  and  for  each  update
  236.               purchased.
  237.  
  238.               Of  course,  you can always write to us. You should receive a reply within a
  239.               week or so.
  240.  
  241.  
  242.               1.2 ASP Ombudsman
  243.  
  244.  
  245.               MarshallSoft Computing, Inc.  is a member of the  Association  of  Shareware
  246.               Professionals  (ASP).   ASP  wants to make sure that the shareware principle
  247.               works for you.  If you are unable to  resolve  a  shareware-related  problem
  248.               with  an  ASP  member  by contacting the member directly, ASP may be able to
  249.               help. The ASP Ombudsman can help you resolve a dispute or  problem  with  an
  250.               ASP  member,  but  does not provide technical support for members' products.
  251.               Please write to the ASP Ombudsman at  545  Grover  Road,  Muskegon,  MI  USA
  252.               49442-9427,  Fax  616-788-2765,  or send a CompuServe message via CompuServe
  253.               Mail to ASP Ombudsman 70007,3536.
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271.  
  272.              PCL4 Users Manual                                                Page 4
  273.               1.3 A Typical Application
  274.  
  275.  
  276.               In general, there are two classes of applications that use a  communications
  277.               library  like PCL4P - those that use a modem to connect to the outside world
  278.               and those that connect directly to a peripheral device. In  either  case,  a
  279.               typical  application  program using PCL4P might look like the following code
  280.               outline:
  281.  
  282.  
  283.  
  284.               +----------------------------------------------------------------+
  285.               |                                                                |
  286.               | program YourProgram                                            |
  287.               |                                                                |
  288.               | uses PCL4P;                                                    |
  289.               | ...                                                            |
  290.               | var RxBufPtr : Pointer;                                        |
  291.               |     RxBufSeg : Integer;                                        |
  292.               |                                                                |
  293.               | ...                                                            |
  294.               | begin (* YourProgram *)                                        |
  295.               |    GetMem(RxBufPtr,1024+16);                                   |
  296.               |    RxBufSeg := (Seg(RxBufPtr)+1) + (Ofs(RxBufPtr) SHR 4);      |
  297.               |    ...                                                         |
  298.               |    RetCode := SioRxBuf(Port,RxBufSeg,Size1024);                |
  299.               |    RetCode := SioParms(Port,NoParity,OneStopBit,WordLength8);  |
  300.               |    RetCode := SioReset(Port,Baud2400);                         |
  301.               |    ...                                                         |
  302.               |    ... ( application code )                                    |
  303.               |    ...                                                         |
  304.               |    RetCode := SioDone(Port);                                   |
  305.               | end. (* YourProgram *)                                         |
  306.               +----------------------------------------------------------------+
  307.  
  308.  
  309.  
  310.               In the above example, SioRxBuf is called to set up the a 1024  byte  receive
  311.               buffer;  SioParms  is  called to set up the parity, stop bit count, and word
  312.               length; SioReset is called to set the baud rate to 2400 and reset the UART (
  313.               Univeral Asynchronous Receiver / Transmitter ).
  314.  
  315.               Before leaving your application, SioDone is  called  to  restore  the  prior
  316.               state of the serial communications system.
  317.  
  318.               If  you  are using a modem, you also need to be concerned about initializing
  319.               your modem correctly and handling any required flow control.  Refer  to  the
  320.               "Talking to Your Modem" chapter for detailed information.
  321.  
  322.               If  you  are  using  the versions of the library with transmitter interrupts
  323.               enabled (PCL4P_2.OBJ) then SioTxBuf must be called to set up the transmitter
  324.               queue.
  325.  
  326.  
  327.  
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  
  335.  
  336.  
  337.  
  338.  
  339.  
  340.              PCL4 Users Manual                                                Page 5
  341.               1.3 Installation
  342.  
  343.  
  344.               (1) Before installation of PCL4P, your compiler should already be  installed
  345.               on  your system and tested. If you are not familiar with makefiles, refer to
  346.               your compiler manual.  Examine the file "FILES.LST" for a list  of  all  the
  347.               distribution files.
  348.  
  349.               (2)  Make  a  backup  copy  of  your  distribution  disk.  Put your original
  350.               distribution disk in a safe place.
  351.  
  352.               (3) Create a work directory on your work disk (normally your harddisk).  For
  353.               example,  to create a work directory named PCL4P, we first log onto the work
  354.               disk and then type:
  355.  
  356.                                MKDIR PCL4P
  357.  
  358.               (4) Copy all the files from your backup copy of  the  distribution  disk  to
  359.               your  work  directory.   For example, to copy from the A: drive to your work
  360.               directory, we type:
  361.  
  362.                               CD PCL4P
  363.                               COPY A:*.*
  364.  
  365.  
  366.               (5) The library unit PCL4P.TPU is compiled with Turbo Pascal 6.0. If you are
  367.               using another version (4.0 or above), you should recompile the library  unit
  368.               as follows:
  369.  
  370.                               TPC PCL4P
  371.  
  372.               (6) Compile SIMPLE.PAS:
  373.  
  374.                               TPC SIMPLE
  375.  
  376.               SIMPLE.PAS should compile without any problems.
  377.  
  378.               (7)  The  recommended  way  to  test  SIMPLE  is  to run it on two computers
  379.               connected by a null modem cable.  Whatever is typed on one  computer  should
  380.               be displayed on the other. SIMPLE can also be tested by connecting your port
  381.               to a modem.
  382.  
  383.               (8) Compile and run TERM.PAS. TERM can be used to call up a BBS such as  our
  384.               customer support BBS and down load files.
  385.  
  386.  
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393.  
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400.  
  401.  
  402.  
  403.  
  404.  
  405.  
  406.  
  407.  
  408.              PCL4 Users Manual                                                Page 6
  409.               2.0 Library Organization
  410.  
  411.  
  412.               The  PCL4P  library  is organized into six categories of functions. Refer to
  413.               the PCL Reference Manual (PCL4P.REF) for details on individual functions.
  414.  
  415.  
  416.               2.1 Configuration
  417.  
  418.  
  419.               There are three functions in the configuration category.  SioPorts  is  used
  420.               to  set  the number of PC ports, specify the first DigiBoard (or BOCA board)
  421.               port, and set the DigiBoard (or BOCA board) status register address. SioUART
  422.               is used to change the UART base address  for  a  communications  port  to  a
  423.               non-standard  address, while SioIRQ is used to assign a nonstandard IRQ line
  424.               to a port.  (See the chapter IBM Communications Ports for  more  details  on
  425.               standard UART addresses and IRQ lines).
  426.  
  427.               The  configuration  functions  SioPorts,  SioUART  and SioIRQ must be called
  428.               before calling any other library functions.  Be very careful in using  these
  429.               functions.  Remember that your serial hardware must support the UART and IRQ
  430.               that you specify.
  431.  
  432.               SioPorts - Set # PC ports, 1st DigiBoard (or BOCA board) port.
  433.               SioUART  | Sets the UART base address.
  434.               SioIRQ   - Assigns an IRQ line to a port.
  435.  
  436.               THE  IRQ  GOLDEN  RULE:  You  may  open (via SioReset) only one port per IRQ
  437.               (except for the DigiBoard and BOCA board).
  438.  
  439.  
  440.               2.2 Initialization & Termination
  441.  
  442.  
  443.               There are eight functions in the initialization  and  termination  category.
  444.               Together,  SioParms,  SioFIFO,  SioRxBuf,  SioTxBuf, and SioReset initialize
  445.               your serial communications system.  Your application must call SioParms  and
  446.               SioRxBuf  before  calling  SioReset,  and SioReset must be called before any
  447.               serial I/O processing can be done.
  448.  
  449.               After initialization, SioParms and SioBaud can be called again to change the
  450.               communications parameters without resetting the serial port. SioFlow can  be
  451.               called to enable hardware flow control.
  452.  
  453.               Before  exiting  from  your  application, SioDone must be called. Failure to
  454.               call SioDone can crash your system later.
  455.  
  456.               SioRxBuf   - Sets up receive buffer.
  457.               SioTxBuf   | Sets up transmitter buffer.
  458.               SioFIFO    | Sets the interrupt level for the INS16550.
  459.               SioParms   | Sets parity, stop bits, and word length.
  460.               SioReset   | Initialize a serial port for processing.
  461.               SioDone    | Terminates further serial processing.
  462.               SioBaud    | Sets the baud rate of the selected port.
  463.               SioFlow    - Enables / disables flow control.
  464.  
  465.  
  466.  
  467.  
  468.  
  469.  
  470.  
  471.  
  472.  
  473.  
  474.  
  475.  
  476.              PCL4 Users Manual                                                Page 7
  477.               2.3 Modem Control & Status
  478.  
  479.  
  480.               There  are  eight  functions  in the modem control and status category which
  481.               provide your application with complete control over the status  and  control
  482.               bits of your modem.
  483.  
  484.               There are two modem control bits, "Data Terminal Ready" (DTR)  and  "Request
  485.               To  Send"  (RTS).  These  bits  can  be  read, set, or cleared by SioDTR and
  486.               SioRTS.
  487.  
  488.               There are four modem status bits, "Data Set Ready" (DSR),  "Clear  To  Send"
  489.               (CTS),  "Ring Indicator" (RI), and "Data Carrier Detect" (DCD). SioModem can
  490.               read any of the modem status bits.  SioDSR, SioCTS, SioRI,  and  SioDCD  can
  491.               only  read  their respective modem status bit. SioGetDiv reads the baud rate
  492.               divisor register so that the baud rate can be determined.
  493.  
  494.               Refer  to  the  chapter entitled "RS232 Signals" for a discussion of each of
  495.               the control and status bits.
  496.  
  497.               SioDTR    - Set, clear, or read the Data Terminal Ready (DTR) bit.
  498.               SioRTS    | Sets, clears, or reads the Request to Send (RTS) line.
  499.               SioModem  | Reads the modem status register.
  500.               SioDSR    | Reads the Data Set Ready (DSR) modem status bit.
  501.               SioCTS    | Reads the Clear to Send (CTS) modem status bit
  502.               SioDCD    | Reads the Data Carrier Detect (DCD) modem status bit.
  503.               SioRI     | Reads the Ring Indicator (RI) modem status bit.
  504.               SioRead   | Reads the contents of the 7 UART registers.
  505.               SioGetDiv - Reads the baud rate divisor registers.
  506.  
  507.               2.4 Serial I/O
  508.  
  509.  
  510.               There are eight library functions in the  serial  I/O  category.   Together,
  511.               these functions give the programmer complete control over serial I/O. Higher
  512.               level  functions  such  as  protocols  and smart modem communications can be
  513.               completely implemented in terms of these functions.  Refer  to  the  example
  514.               code.
  515.  
  516.               SioGetc  and  SioPutc perform all the actual serial I/O.  SioUnGetc "ungets"
  517.               the last serial byte  read.   SioRxFlush  clears  the  receive  queue  while
  518.               SioTxFlush  clears the transmit queue.  SioRxQue returns the number of bytes
  519.               in the receive queue while SioTxQue returns  the  number  of  bytes  in  the
  520.               transmit queue. SioLine can be used to test for UART errors.
  521.  
  522.               SioGetc    - Reads the next character from the serial line.
  523.               SioPutc    | Transmit a character over a serial line.
  524.               SioUnGetc  | "Un-gets" (puts back) a specified character.
  525.               SioRxFlush | Flush (clears) the receive buffer.
  526.               SioRxQue   | Returns the number of characters in the receive queue.
  527.               SioTxFlush | Flush (clears) the transmit buffer.
  528.               SioTxQue   | Returns the number of characters in the transmit queue.
  529.               SioLine    - Reads the line status register.
  530.  
  531.  
  532.  
  533.  
  534.  
  535.  
  536.  
  537.  
  538.  
  539.  
  540.  
  541.  
  542.  
  543.  
  544.              PCL4 Users Manual                                                Page 8
  545.               2.5 Error Detection
  546.  
  547.  
  548.               There are four functions in the error detection category. They are concerned
  549.               with  detecting  or reporting communications errors.  Use of these functions
  550.               can make your application significantly more robust.
  551.  
  552.               SioBrkKey can  be  used  as  an  "emergency"  exit  from  your  application.
  553.               SioBrkSig  can  read  or  modify  the  UART  break  bit.  This is useful for
  554.               signalling  the  remote  system  that  a  fatal  condition   has   occurred.
  555.               SioLoopBack  can  be  used  to  test  the  integrity of your UART.  SioError
  556.               displays a error message corresponding to an  error  code  returned  from  a
  557.               PCL4P function.
  558.  
  559.               SioBrkKey - Returns non-zero if the Control-BREAK key was pressed
  560.               SioBrkSig | Asserts, cancels, or detects  BREAK  signal.
  561.               SioError  - Displays  error  in  text.
  562.               SioLoopBack - Performs a UART loopback test.
  563.  
  564.  
  565.               2.6 General Support
  566.  
  567.  
  568.               There are three functions in the general support category.  Strictly speaking,
  569.               they  are not communications functions, but they take up a very small amount
  570.               of additional memory.  Registered users can remove these functions from  the
  571.               library if needed.
  572.  
  573.               SioInfo     - Returns the library version & memory model.
  574.               SioTimer    | Returns the number of system clock tics.
  575.               SioDelay    - Delays one or more timer tics (18.2 tics per second).
  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.  
  601.  
  602.  
  603.  
  604.  
  605.  
  606.  
  607.  
  608.  
  609.  
  610.  
  611.  
  612.              PCL4 Users Manual                                                Page 9
  613.               3.0 Library Organization
  614.  
  615.  
  616.               3.1 Using the Library
  617.  
  618.  
  619.               The PCL4P library has been tested on a Tandy 1000  (4.77  MHZ  8088  IBM  PC
  620.               clone),  a Tandy 3000 (80286 IBM AT clone), a Tandy 1400LT (IBM XT clone), a
  621.               Gateway 2000 386(25 MHZ 80386-DX), and a Gateway 2000 486(66 MHX  80486-DX).
  622.               PCL4P has been tested under MSDOS 2.11, 3.2, 3.3, 4.01, 5.0, 6.0, and 6.2.
  623.  
  624.               Please examine the PCL4P.PAS file. Note that COM1 is defined as  port  zero,
  625.               not  port  one.   The  user  must  assume  the responsibilty for passing the
  626.               correct information when calling PCL4P functions.
  627.  
  628.  
  629.               3.2 Example Programs
  630.  
  631.  
  632.               Two communications programs are provided as a  demonstration  of  the  PCL4P
  633.               library - SIMPLE and TERM.
  634.  
  635.               SIMPLE  is  provided  as the simpliest example of communications programming
  636.               using PCL4P.  Compile and link SIMPLE.PAS as a test of the library.
  637.  
  638.               If you have two computers, connect them together with a null modem cable and
  639.               run SIMPLE on both machines.  The baud rate in SIMPLE is hard coded to  2400
  640.               baud. It is easily changed in the source code. Start SIMPLE by typing SIMPLE
  641.               followed by the port. For example:
  642.  
  643.                     SIMPLE 1
  644.  
  645.               Once SIMPLE is started on both computers, whatever is typed on  one  machine
  646.               should be displayed on the other, and vice versa.
  647.  
  648.               The  TERM  program  is  a  more  capable  terminal  emulator than SIMPLE. It
  649.               features modem initialization, hardware  flow  control,  and  file  transfer
  650.               using  ASCII,  XMODEM,  YMODEM, and YMODEM-G communications protocols.  TERM
  651.               can be used to call up any bulletin board system, including the MarshallSoft
  652.               Computing BBS.  Start TERM by typing TERM followed  by  the  port  and  baud
  653.               rate. For example:
  654.  
  655.                     TERM 4 2400
  656.  
  657.               Refer to "Terminal Emulator Program" for a complete discussion of TERM.
  658.  
  659.  
  660.               3.3 Door Programs
  661.  
  662.  
  663.               In  order  to  write a door program which "takes over" a serial port without
  664.               resetting the port or changing the baud rate, call SioReset with NORESET  as
  665.               the  second  argument  rather  than the baud rate. Call SioGetDiv to get the
  666.               baud rate divisor if the baud rate must  be  determined.  Be  sure  to  call
  667.               SioDone before returning to the invoking program.
  668.  
  669.  
  670.  
  671.  
  672.  
  673.  
  674.  
  675.  
  676.  
  677.  
  678.  
  679.  
  680.              PCL4 Users Manual                                                Page 10
  681.               3.4 BBS Programs
  682.  
  683.  
  684.               If  you are designing a BBS program, consider using 16550 UARTS.  You should
  685.               also choose a multiport card such as the DigiBoard or BOCA board if you wish
  686.               to run more than 4 ports simultaneously. If  you  wish  to  do  simultaneous
  687.               XMODEM  or  YMODEM transfers, then you need to get the state driven Personal
  688.               Protocol Library. Refer to  the  section  on  other  MarshallSoft  Computing
  689.               products for more information.
  690.  
  691.  
  692.               3.5 Compiling and Linking
  693.  
  694.  
  695.               Registered users may wish to assemble PCL4PLIB.ASM.  To assemble  using  the
  696.               Microsoft assembler:
  697.  
  698.                     MASM PCL4PLIB /DPASCAL_MODEL;
  699.  
  700.               In order to build PCL4P.LIB with transmitter interrupts enabled:
  701.  
  702.                     MASM PCL4PLIB /DPASCAL_MODEL /DSET_TBE;
  703.  
  704.               To build the library TPU:
  705.  
  706.                     TPC PCL4P
  707.  
  708.               To compile the sample programs:
  709.  
  710.                     TPC SIMPLE.PAS
  711.  
  712.                     TPC TERM.PAS /m
  713.  
  714.               A  makefile (TERM.MAK) is also provided for the TERM.PAS program. To compile
  715.               TERM and all dependent units, type:
  716.  
  717.                     MAKE -fTERM
  718.  
  719.  
  720.               3.6 Turbo Vision
  721.  
  722.  
  723.               The PCL4P library can also be used in Turbo  Vision  programs.  Examine  the
  724.               TVTERM.PAS for a simple example program analogous to the SIMPLE.PAS program.
  725.  
  726.               TVTERM  copies any keyboard input to the serial port and copies any incoming
  727.               serial port data to the screen. Type Alternate-X to exit.
  728.  
  729.  
  730.  
  731.  
  732.  
  733.  
  734.  
  735.  
  736.  
  737.  
  738.  
  739.  
  740.  
  741.  
  742.  
  743.  
  744.  
  745.  
  746.  
  747.  
  748.              PCL4 Users Manual                                                Page 11
  749.               4.0 Talking to Your Modem
  750.  
  751.  
  752.               A modem is used to extend the  distance  over  which  you  may  communicate.
  753.               Without  a  modem, your RS232 cable is limited to a maximum of approximately
  754.               50 feet.  But with a modem, you can communicate literally around the world.
  755.  
  756.               Also refer to the section  "MODEM_IO  functions"  for  details  on  MODEM_IO
  757.               functions. These functions facilitate communications with modems.
  758.  
  759.               4.1 Modem Standards
  760.  
  761.  
  762.               Two modems can communicate over a telephone line only if they are both using
  763.               the same signaling frequencies and modulation, which are determined  by  the
  764.               the  modem  standards used.  Modem standards can be divided into three sets:
  765.               (1) speed, (2) data compression used, and (3) error control.
  766.  
  767.               The Bell standards  (103  &  212A)  are  those  of  AT&T.   The  CCITT  (The
  768.               International  Consultative Committee for Telephone and Telegraph) standards
  769.               are designated as "V. ".
  770.  
  771.  
  772.               Speed
  773.  
  774.               Bell 103  -   300 baud
  775.               Bell 212A |  1200 baud
  776.               V.21      |   300 baud
  777.               V.22bis   |  1200 & 2400 baud
  778.               V.32      |  4800 & 9600 baud
  779.               V.32bis   -  4800, 7200, 9600, 12000, and 14400 baud
  780.  
  781.  
  782.               Data Compression
  783.  
  784.               MNP 5     -  Microcom Networking Protocol (proprietary).
  785.               V.42bis   -  International data compression standard.
  786.  
  787.  
  788.               Error Control
  789.  
  790.               MNP 2,3,4 -  Three level error correction (public domain).
  791.               V.42      -  International error correction standard.
  792.  
  793.               Most  of  the  newer  high  speed modems use several of the above standards.
  794.               However, not all combinations of modem makes communicate  easily  with  each
  795.               other, especially at high speed (9600 and up).
  796.  
  797.  
  798.  
  799.  
  800.  
  801.  
  802.  
  803.  
  804.  
  805.  
  806.  
  807.  
  808.  
  809.  
  810.  
  811.  
  812.  
  813.  
  814.  
  815.  
  816.              PCL4 Users Manual                                                Page 12
  817.               4.2 Flow Control
  818.  
  819.  
  820.               With modems using data compression, the modem to modem connection  will  run
  821.               at  various  speeds  depending  on  the quality of the line. The computer to
  822.               modem connection will be at a fixed baud rate. Therefore, a  protocol  (flow
  823.               control)  is  necessary  to synchronize the data flow between and modems and
  824.               the  computer  to  modem  connection.   Refer  to  your  modem  manual   for
  825.               information on flow control protocols supported.
  826.  
  827.               Two  flow  control  protocols are used by most all modems which require flow
  828.               control. Software flow control is called  "XON/XOFF"  (other  software  flow
  829.               control  character  pairs  are defined but operate the same as XON/XOFF) and
  830.               hardware flow control is called "RTS/CTS".  Most modems which  require  flow
  831.               control enable hardware flow control by default.
  832.  
  833.               In XON/XOFF (software) flow control, the computer suspends transmitting data
  834.               if  it  receives  a  XOFF  character  (13 hex) from the modem, and continues
  835.               transmitting when it receives a XON character  (11  hex).   Similiarly,  the
  836.               computer  can  signal  the modem not to send any more data by transmitting a
  837.               XOFF to it, and can tell the modem to continue  transmission  be  sending  a
  838.               XON.
  839.  
  840.               In  RTS/CTS (hardware) flow control, the RTS line is used by the computer to
  841.               signal the modem , while the CTS line is used by the  modem  to  signal  the
  842.               computer.   The  RTS  line  is  set OFF by the computer to tell the modem to
  843.               suspend  transmission,  and  set  to  ON  to  tell  the  modem  to  continue
  844.               transmission.   The CTS line is set to OFF by the modem to tell the computer
  845.               to stop transmitting, and set  to  ON  to  tell  the  computer  to  continue
  846.               transmitting.
  847.  
  848.               Given  the  choice,  always  choose hardware flow control over software flow
  849.               control so that all data transmission  is  transparent.   If  hardware  flow
  850.               control  is  not  the default (which it almost always is), you should modify
  851.               your modem initialization string to turn hardware flow control on.
  852.  
  853.  
  854.               4.3 MODEM_IO Functions
  855.  
  856.  
  857.               The  file  MODEM_IO.PAS  contains  several functions that ease communicating
  858.               with your modem.  Look in the TERM.PAS  code  for  examples  of  their  use.
  859.               Registered users can also see examples in the script interpreter SI.PAS.
  860.  
  861.                    ModemSendTo   : Sends string (including control chars) to the modem.
  862.                    ModemWaitFor  : Waits for a particular string from the modem, passing
  863.                                    all else through.
  864.                    ModemQuiet    : Waits for continuous quiet of specified duration.
  865.                    ModemHangup   : Hangs up the modem.
  866.                    ModemCmdState : Goes into the modem's command state.
  867.                    ModemEcho     : Echos all serial incoming bytes to the display.
  868.  
  869.  
  870.  
  871.  
  872.  
  873.  
  874.  
  875.  
  876.  
  877.  
  878.  
  879.  
  880.  
  881.  
  882.  
  883.  
  884.              PCL4 Users Manual                                                Page 13
  885.               4.4 Modem Initialization
  886.  
  887.  
  888.               If your application uses a modem (as opposed to using a null  modem  cable),
  889.               then  you should always send an initialization string to your modem if it is
  890.               a programmable modem such as those made by  Hayes.   Communication  programs
  891.               such as PROCOMM and TELIX always send such a string automatically as soon as
  892.               they start up.
  893.  
  894.               The particular initialization string depends on the make of your modem.  For
  895.               Hayes  and  Hayes  AT  command  set  compatible modems, the following string
  896.               (followed by a carriage return) should work:
  897.  
  898.                    AT E1 S7=60 S11=60 V1 X1 Q0 S0=0
  899.  
  900.               Refer to your Modem User's Guide for a full discussion of these commands.  A
  901.               brief description is as follows:
  902.  
  903.               AT     Modem attention command.
  904.               E1     Modem will echo what you send to it.
  905.               S7=60  Wait 60 seconds for carrier and/or dial tone.
  906.               S11=60 Use 60 milliseconds for tone dialing duration & spacing.
  907.               V1     Display result code as words (not numbers).
  908.               X1     Use the extended result message (CONNECT XXXX) set.
  909.               Q0     Modem returns result codes.
  910.               S0=0   Do not answer RING.
  911.  
  912.               If  your application will answer incoming calls, then set the S0 register to
  913.               the ring on which to automatically answer.
  914.  
  915.               If you send the above codes by using SioPutc (as opposed to typing them from
  916.               the keyboard), then follow these guidelines:
  917.  
  918.               (1) Send an initial carriage return before the initialization string.
  919.  
  920.               (2) Pause at least two tics (18 tics to the  second)  after  each  character
  921.               sent  as  your  modem needs the time to perform its own internal processing.
  922.               Pause a little longer if your modem is  not  accepting  your  initialization
  923.               string.
  924.  
  925.               (3)  Pause  one  and a half seconds after sending any initialization command
  926.               such as ATZ or AT&F since your modem must do quite a bit of processing.
  927.  
  928.               If you experience any problems in initializing your Hayes modem, you  should
  929.               first reset it to factory settings by sending:
  930.  
  931.                    AT&F
  932.  
  933.               Refer  to  the  TERM  program  (functions  SendTo  and  WaitFor  in the file
  934.               MODEM_IO.PAS) for an example of sending an initialization string to a  Hayes
  935.               compatible modem.
  936.  
  937.  
  938.  
  939.  
  940.  
  941.  
  942.  
  943.  
  944.  
  945.  
  946.  
  947.  
  948.  
  949.  
  950.  
  951.  
  952.              PCL4 Users Manual                                                Page 14
  953.               5.0 Problems
  954.  
  955.  
  956.               If  you  cannot  get your application to run properly, first compile and run
  957.               the terminal emulator program TERM provided on your distribution  disk.   If
  958.               you are using a null modem cable or a non-programmable modem, be sure not to
  959.               define  AT_COMMAND_SET  in DEFINES.PAS.  If you are using a Hayes compatible
  960.               modem, then do define AT_COMMAND_SET {$DEFINE AT_COMMAND_SET}.  If  you  are
  961.               using  a  programmable  modem  which  is not Hayes compatible, then you must
  962.               modify the initialization string for your particular modem.
  963.  
  964.               If your application does not run but TERM runs correctly, then you have most
  965.               likely  made  a  programming  mistake  in  your  application.   MarshallSoft
  966.               Computing  cannot  debug  your  application,  especially over the telephone!
  967.               However, consider each of the following when searching for an error in  your
  968.               application.
  969.  
  970.               1.  Did you include the "uses PCL4P" statement ?
  971.  
  972.               2.  Is your receive buffer large enough ? If you are using 1K data blocks in
  973.               YMODEM,  then  your  receive buffer should be at least 1K ( 2K if baud rates
  974.               above 38400 are to be used ).
  975.  
  976.               4.  Have you selected too high a baud rate ( if you are using a slow PC )  ?
  977.               If  only  one COM port is being run, you should be able to run at 38400 baud
  978.               on 8088 machines and 115200 on most 286 and all 386 and 486 machines.
  979.  
  980.               5.  Are you attempting to run another application in the background  ?   Try
  981.               running  without  any  other programs running in the background ( unload all
  982.               TSR programs ).
  983.  
  984.               6.  If you are running two COM ports simultaneously, are you using  separate
  985.               receive buffers ? ( you should ).
  986.  
  987.               7.   Did SioReset return a zero value ?  If not, then you must call SioReset
  988.               again. See TERM.PAS for an example.
  989.  
  990.               8.  Did you send the proper initialization string to your modem  ?  Did  you
  991.               set DTR and RTS ? ( you should ).
  992.  
  993.               9.   Do  you  have more than one COM1 port, etc.  For example, if you have a
  994.               COM1 port on your motherboard, you cannot add another  COM1  port  or  modem
  995.               board that uses COM1 without first disabling the COM1 on the motherboard.
  996.  
  997.               10. Are you passing the proper segment of the receive (or transmit) buffer?.
  998.               See SIMPLE.PAS or TERM.PAS for an example.
  999.  
  1000.               Registered  users  can  call  (205)  881  - 4630 from 1:30 PM to 9:30 PM CST
  1001.               Monday through Friday for help.
  1002.  
  1003.  
  1004.  
  1005.  
  1006.  
  1007.  
  1008.  
  1009.  
  1010.  
  1011.  
  1012.  
  1013.  
  1014.  
  1015.  
  1016.  
  1017.  
  1018.  
  1019.  
  1020.              PCL4 Users Manual                                                Page 15
  1021.               6.0 Serial Communications
  1022.  
  1023.  
  1024.               6.1 Communications Basics
  1025.  
  1026.  
  1027.               The heart of serial  communications  is  the  UART  (Universal  Asynchronous
  1028.               Receiver  Transmitter).   The  IBM PC/XT/AT and compatibles use the INS8250,
  1029.               INS16450, or the INS16550 UART.  The purpose of the UART is:
  1030.  
  1031.               (1) To convert bytes from the CPU (Central Processing Unit), into  a  serial
  1032.               format  by  adding  the  necessary start, stop, and parity bits to each byte
  1033.               before transmission, and to then transmit each bit at the correct baud rate.
  1034.  
  1035.               (2) To convert the incoming stream (at a specified baud rate) of serial bits
  1036.               into bytes by removing the start, stop, and parity bits  before  being  made
  1037.               available to the CPU.
  1038.  
  1039.               The  UART  is part of the serial interface circuitry which allows the CPU to
  1040.               send and receive signals over the RS232 lines. This  can  be  diagrammed  as
  1041.               follows:
  1042.  
  1043.  
  1044.  
  1045.                                     Serial Interface
  1046.                                  +-------------------+
  1047.                                  |                   |
  1048.               +-----+  Data Bus  |     +------+      |    RS232 Signals
  1049.               | CPU +------------+     | UART |      +----------------*
  1050.               +-----+            |     +------+      |
  1051.                                  |                   |
  1052.                                  +-------------------+
  1053.  
  1054.  
  1055.  
  1056.               The  INS8250/16450/16550  UART  is capable of operating in one of two modes,
  1057.               "polled" and "interrupt driven".  The serial communications functions in the
  1058.               BIOS uses the polled method.  In this approach, the CPU is  typically  in  a
  1059.               loop  asking  the  UART  over  and over again if it has a byte ready. If its
  1060.               does, the polling code returns the byte.  But, if the  next  byte  comes  in
  1061.               before the polling code is executing again, then that byte is lost.
  1062.  
  1063.               In  the  interrupt driven approach (used by PCL4P for incoming data), when a
  1064.               byte is received by the  UART,  an  "Interrupt  Service  Routine"  (ISR)  is
  1065.               executed immediately, suspending temporarily whatever else is executing. The
  1066.               ISR  then  moves  the  byte to a buffer so that your application program can
  1067.               later read it. Refer to the sections entitled "RS232 Signals" and  "National
  1068.               INS8250 UART" for further information on these topics.
  1069.  
  1070.  
  1071.  
  1072.  
  1073.  
  1074.  
  1075.  
  1076.  
  1077.  
  1078.  
  1079.  
  1080.  
  1081.  
  1082.  
  1083.  
  1084.  
  1085.  
  1086.  
  1087.  
  1088.              PCL4 Users Manual                                                Page 16
  1089.               6.2 Standard Port Addresses
  1090.  
  1091.  
  1092.               There  are  a  few  things to know about how serial communications ports are
  1093.               used by IBM PC/XT/AT and compatible computers.  The  standard  IBM  PC/XT/AT
  1094.               configuration values are as follows:
  1095.  
  1096.               Port     Reg Base   IRQ Line   Vector
  1097.               COM1        3F8H        4        12
  1098.               COM2        2F8H        3        11
  1099.               COM3        3E8H        4        12
  1100.               COM4        2E8H        3        11
  1101.  
  1102.               (Refer  to your DigiBoard manual for DigiBoard addresses, or your BOCA board
  1103.               manual for BOCA port addresses).
  1104.  
  1105.               PCL4P assumes the above values.  If necessary, the UART base address can  be
  1106.               changed by SioUART, and IRQ lines can be re-assigned by SioIRQ. Refer to the
  1107.               PCL4P Reference Manual for specific details.
  1108.  
  1109.               When  installing  new  communications  cards,  the  following guidelines are
  1110.               recommended:
  1111.  
  1112.               (1) Be sure to read the documentation for the hardware you  are  installing.
  1113.               Pay special attention to UART base addresses and IRQ lines.
  1114.  
  1115.               (2)  If  you  have  a  choice in base addresses and IRQ lines, always choose
  1116.               standard values as defined above.
  1117.  
  1118.               (3) The first port should be COM1, the second COM2, etc.  Do NOT  skip  over
  1119.               any port. This problem has caught several users.
  1120.  
  1121.               (4)  Use SioUART to zero all unused ports (for example, call SioUART(COM4,0)
  1122.               if there is no COM4 port installed).
  1123.  
  1124.               (5) Be carefull not to configure two ports for the  same  address.  This  is
  1125.               easier to do than you may believe.
  1126.  
  1127.               (6)  Choose  an  external  modem over an internal one.  It is much easier to
  1128.               debug problems with an external modem than an internal one.
  1129.  
  1130.               (7) Select hardware flow control (RTS/CTS) if flow control is  required  and
  1131.               hardware flow control is not the default.
  1132.  
  1133.               (8) Always test your port as soon as it is installed.
  1134.  
  1135.  
  1136.  
  1137.  
  1138.  
  1139.  
  1140.  
  1141.  
  1142.  
  1143.  
  1144.  
  1145.  
  1146.  
  1147.  
  1148.  
  1149.  
  1150.  
  1151.  
  1152.  
  1153.  
  1154.  
  1155.  
  1156.              PCL4 Users Manual                                                Page 17
  1157.               6.3 Running 3 or 4 Ports Concurrently
  1158.  
  1159.  
  1160.               PCL4P supports up to 4 serial ports running concurrently (more if you have a
  1161.               DigiBoard or BOCA board).  One free interrupt for each port is required. The
  1162.               following assumes that you don't have a DigiBoard.
  1163.  
  1164.               Interrupts  IRQ4  and  IRQ3  are  dedicated to the communications ports in a
  1165.               standard IBM PC/XT/AT configuration.  IRQ4 is shared between COM1  and  COM3
  1166.               while IRQ3 is shared between COM2 and COM4.  This means that you can run two
  1167.               ports simultaneously provided that they don't share an interrupt.
  1168.  
  1169.               Suppose that you wish to run 3 ports simultaneously. To begin, you must have
  1170.               3  serial  UARTs  installed  on your computer.  Assume, for purposes of this
  1171.               discussion, that COM1 is installed on your motherboard, and  that  you  have
  1172.               purchased a new 2 port serial communications board.
  1173.  
  1174.               You  should  be able to configure the first serial board port as COM2, which
  1175.               uses IRQ3.  Refer to the manual that came with your serial board.
  1176.  
  1177.               In order to run the third serial port concurrently with  the  first  two,  a
  1178.               unused  interrupt  must be found.  If your serial card can only use IRQ3 and
  1179.               IRQ4, then there is no way to run a third line since IRQ4 and IRQ3 are  used
  1180.               for COM1 and COM2.
  1181.  
  1182.               However,  many serial cards can use other IRQs, typically IRQ2 through IRQ5.
  1183.               Since IRQ5 is normally used  for  a  second  printer  port,  it  is  a  good
  1184.               candidate  for  COM3.  To use IRQ5 for the third serial port, first set your
  1185.               serial card to use IRQ5 for COM3 (refer to your serial card manual) and then
  1186.               add the following line to your applications code before calling SioReset:
  1187.  
  1188.                      RetCode := SioIRQ(COM3,IRQ5);
  1189.  
  1190.               Don't forget to disable any device that might use IRQ5,  such  as  a  second
  1191.               printer  port  or  a  music  card.   Unfortunately,  there is no easy way to
  1192.               determine that you have no conflicts until you actually attempt to  use  the
  1193.               IRQ.  If  there  are  conflicts, your system will probably hang and you will
  1194.               have to reboot.
  1195.  
  1196.               To run a fourth serial port, another  free  IRQ  must  be  found.   On  some
  1197.               systems, IRQ2 can be used. To use IRQ2 for the fourth serial port, first set
  1198.               your serial card to use IRQ2 for COM4 and then add:
  1199.  
  1200.                      RetCode := SioIRQ(COM4,IRQ2);
  1201.  
  1202.               To  summarize,  your  serial  card must be able to generate the correct IRQ,
  1203.               which is not already being used. Refer to the entry for the SioIRQ  function
  1204.               in the PCL4P Reference Manual.
  1205.  
  1206.  
  1207.  
  1208.  
  1209.  
  1210.  
  1211.  
  1212.  
  1213.  
  1214.  
  1215.  
  1216.  
  1217.  
  1218.  
  1219.  
  1220.  
  1221.  
  1222.  
  1223.  
  1224.              PCL4 Users Manual                                                Page 18
  1225.               6.4 Using the DigiBoard
  1226.  
  1227.  
  1228.               PCL4P  supports the the dumb DigiBoard (PC/4 & PC/8) and the dumb BOCA board
  1229.               (BB1004, BB1008, and BB2016).
  1230.  
  1231.               6.4.1 The DigiBoard
  1232.  
  1233.               Your PCs ports must be partitioned into "standard" PC  ports  and  DigiBoard
  1234.               ports.  Remember that standard PC ports cannot share IRQs like the DigiBoard
  1235.               can.  If  you  are  using IRQ4 and IRQ3 for standard PC ports COM1 and COM2,
  1236.               then you cannot use either for DigiBoard ports (try IRQ5 or IRQ7).
  1237.  
  1238.               Suppose that COM1 through COM2 are standard PC ports (using IRQ4  and  IRQ3)
  1239.               and  you  have  installed  a  PC/8  DigiBoard  that you wish to use for COM3
  1240.               through COM10 using interrupt line IRQ5.  You choose to use the  recommended
  1241.               DigiBoard UART addresses starting at $100:
  1242.  
  1243.               Code := SioPorts(10,COM3,$140,DIGIBOARD);
  1244.               Address := $100;                (* 1st DigiBoard UART address *)
  1245.               for Port:=COM3 to COM10 do      (* look at each port *)
  1246.                 begin
  1247.                   Code := SioUART(Port,Address);     (* set the UART address *)
  1248.                   Address := Address + 8;            (* next DigiBoard UART *)
  1249.                   Code := SioIRQ(Port,IRQ5);         (* set the IRQ & ISR *)
  1250.                 end
  1251.  
  1252.               The  DigiBoard uses $140 for the status address for odd interrupts and 0x141
  1253.               for even interrupts.
  1254.  
  1255.               DigiBoard may be contacted at 6400 Flying  Cloud  Drive,  Eden  Prairie,  MN
  1256.               55344.  Telephone 612-943-9020. FAX 612-943-5398.
  1257.  
  1258.               6.4.2 The BOCA Board
  1259.  
  1260.               PCL4P  supports  the  dumb  BOCA  board.  As  with  the  DigiBoard, you must
  1261.               configure PCL4P before using the BOCA board.
  1262.  
  1263.               For example, to configure the BOCA BB2016 to use COM1  to  COM16  with  base
  1264.               addresses starting at $100 and using IRQ5:
  1265.  
  1266.               Code := SioPorts(16,COM1,$107,BOCABOARD);
  1267.               Address := $100;                (* 1st DigiBoard UART address *)
  1268.               for Port:=COM1 to COM16 do      (* look at each port *)
  1269.                 begin
  1270.                   Code := SioUART(Port,Address);     (* set the UART address *)
  1271.                   Address := Address + 8;            (* next DigiBoard UART *)
  1272.                   Code := SioIRQ(Port,IRQ5);         (* set the IRQ & ISR *)
  1273.                 end
  1274.  
  1275.               BOCA  may  be  contacted at BOCA Research, Inc., 6413 Congress Avenue, Suite
  1276.               130, Boca Raton, FL 33487. Phone 407-241-8088, FAX 407-997-0918.
  1277.  
  1278.  
  1279.  
  1280.  
  1281.  
  1282.  
  1283.  
  1284.  
  1285.  
  1286.  
  1287.  
  1288.  
  1289.  
  1290.  
  1291.  
  1292.              PCL4 Users Manual                                                Page 19
  1293.               6.5 Transmitter Interrupts
  1294.  
  1295.  
  1296.               Beginning in version 4.0 of PCL4P, transmitter interrupts are  supported  by
  1297.               the   library.   Separate  libraries  are  provided,  one  with  transmitter
  1298.               interrupts enabled and one without.  When  transmitter  interrupts  are  NOT
  1299.               enabled, the following logic occurs everytime you call SioPutc:
  1300.  
  1301.                1.  Wait  for  transmit buffer to become empty. The transmit buffer may not
  1302.               be empty if the previous transmit is not completed (the UART breaks down the
  1303.               byte & sends 1 bit at a time). 2. When the transmit  buffer  is  empty,  the
  1304.               byte from the SioPutc call is loaded into the transmit buffer and control is
  1305.               returned to the caller.
  1306.  
  1307.               Note that you can not write to the UART any faster the the UART baud rate.
  1308.  
  1309.               When transmitter interrupts are enabled, the byte from SioPutc is put into a
  1310.               previously  prepared  (by SioTxQue) transmitter queue. The interrupt service
  1311.               routine fetches bytes from this queue as soon as the previous byte has  been
  1312.               sent.
  1313.  
  1314.               While  you  can  now call SioPutc faster than the baud rate, bytes are still
  1315.               transmitted at the given baud rate.
  1316.  
  1317.               The  above  sounds  like  transmitter  interrupts  are  the   way   to   go.
  1318.               Unfortunately, this is usually NOT the case.  Most applications will perform
  1319.               better if transmitter interrupts are NOT enabled.
  1320.  
  1321.               The  reason  is that transmitter interrupts double the amount of code in the
  1322.               time critical interrupt service routines.  While the library is processing a
  1323.               transmitter interrupt (which can take a while), incoming bytes  can  not  be
  1324.               processed.  What this means is that a given machine can run at a higher baud
  1325.               rate without transmitter interrupts. This problem is compounded when running
  1326.               multiple ports simultaniously.
  1327.  
  1328.               However, there are a few application areas where transmitter interrupts  are
  1329.               preferable.   If  your  application  will  be transmitting blocks of data at
  1330.               fairly slow baud rates you might profit from enabling transmitter interrupts
  1331.               provided that there is something else for the processor to do (which is  NOT
  1332.               the case in most protocols).
  1333.  
  1334.               To  create  PCL4P.TPU  with  TX  interrupts enabled, change "PCL4P_1.OBJ" to
  1335.               "PCL4P_2.OBJ" in MAKETPU.BAT and then execute MAKETPU.BAT.
  1336.  
  1337.  
  1338.  
  1339.  
  1340.  
  1341.  
  1342.  
  1343.  
  1344.  
  1345.  
  1346.  
  1347.  
  1348.  
  1349.  
  1350.  
  1351.  
  1352.  
  1353.  
  1354.  
  1355.  
  1356.  
  1357.  
  1358.  
  1359.  
  1360.              PCL4 Users Manual                                                Page 20
  1361.               6.6 RS-232 Signals
  1362.  
  1363.  
  1364.               RS-232 is the name of the serial data interface  standard  used  to  connect
  1365.               computers  to modems.  Most IBM compatible computers are built with at least
  1366.               one serial port and use either DB9 (9 pin) or DB25 (25 pin) connectors.
  1367.  
  1368.               A summary of these pins and  their  function  follows.   For  more  detailed
  1369.               information, refer to one of the many books dealing with RS-232 interfacing.
  1370.  
  1371.               Signal Ground Pin 7 (DB25), Pin 5 (DB9)
  1372.  
  1373.               The  SG  line  is  used  as  the  common  signal  ground, and must always be
  1374.               connected.
  1375.  
  1376.               Transmit Data Pin 2 (DB25), Pin 3 (DB9)
  1377.  
  1378.               The TX line is used to carry data from the computer to the modem.
  1379.  
  1380.               Receive Data Pin 3 (DB25), Pin 2 (DB9)
  1381.  
  1382.               The RX line is used to carry data from the modem to the computer.
  1383.  
  1384.               Data Terminal Ready Pin 20 (DB25), Pin 4 (DB9)
  1385.  
  1386.               The DTR line is used by the computer to signal the modem that it  is  ready.
  1387.               DTR should be set high when talking to a modem.
  1388.  
  1389.               Data Set Ready Pin 6 (DB25), Pin 6 (DB9)
  1390.  
  1391.               The DSR line is used by the modem to signal the computer that it is ready.
  1392.  
  1393.               Request to Send Pin 4 (DB25), Pin 7 (DB9)
  1394.  
  1395.               The  RTS  line  is used to "turn the line around" in half duplex modems, and
  1396.               for hardware flow control in most modems that require flow control.
  1397.  
  1398.               Clear to Send Pin 5 (DB25), Pin 8 (DB9)
  1399.  
  1400.               The CTS line is used to "turn the line around" in half  duplex  modems,  and
  1401.               for hardware flow control in most modems that require flow control.
  1402.  
  1403.               Data Carrier Detect Pin 8 (DB25), Pin 1 (DB9)
  1404.  
  1405.               The DCD line is used by the modem to signal the computer that a data carrier
  1406.               signal is present.
  1407.  
  1408.               Ring Indicator Pin 22 (DB25), Pin 9 (DB9)
  1409.  
  1410.               The RI line is asserted when a 'ring' occurs.
  1411.  
  1412.  
  1413.  
  1414.  
  1415.  
  1416.  
  1417.  
  1418.  
  1419.  
  1420.  
  1421.  
  1422.  
  1423.  
  1424.  
  1425.  
  1426.  
  1427.  
  1428.              PCL4 Users Manual                                                Page 21
  1429.               6.7 National INS8250, INS16450, and INS16550 UARTs
  1430.  
  1431.  
  1432.               The  Personal  Communications  Library  is  based  on  the standard National
  1433.               INS8250, INS16450, and INS16550 UARTs. The 8250 was the original  UART  used
  1434.               in  the IBM PC, whereas the 16450 is a faster version found on most 286 & up
  1435.               machines. The 16550 contains a 16 byte FIFO to further reduce communications
  1436.               overhead. These UARTs consists of 8 register ports as follows:
  1437.  
  1438.               Offset    R/W   Register
  1439.                 0       R/W   Receiver (read) / Transmitter (write)
  1440.                 1       R/W   Interrupt Enable (read)
  1441.                 2       R     Interrupt Identification
  1442.                 2       W     FIFO control (INS16550 only)
  1443.                 3       R/W   Data Format (Line Control)
  1444.                 4       R/W   RS-232 (Modem) Control
  1445.                 5       R/W   Line Status
  1446.                 6       R/W   RS-232 (Modem) Status
  1447.                 7       R/W   Not used.
  1448.  
  1449.               The UART registers are based at 3F8 (COM1), 2F8 (COM2), 3E8 (COM3), and  2E8
  1450.               (COM4).  COM1  and COM3 share interrupt vector 12 and interrupt request line
  1451.               IRQ4 while COM2 and COM4 share interrupt vector  11  and  interrupt  request
  1452.               line  IRQ3.   This  means that COM1 and COM3 cannot both be used at the same
  1453.               time. Similarly, COM2 and COM4 cannot both be used at the same time.
  1454.  
  1455.  
  1456.               Port     Reg Base   IRQ Line   Vector
  1457.               COM1        3F8H        4        12
  1458.               COM2        2F8H        3        11
  1459.               COM3        3E8H        4        12
  1460.               COM4        2E8H        3        11
  1461.  
  1462.               Four sources of interrupts  are  possible  with  the  8250  and  16550:  (1)
  1463.               receiver error or BREAK, (2) receiver data ready, (3) ready to transmit, and
  1464.               (4)  RS232  input.   These  four  sources  of  interrupts  are summarized as
  1465.               follows:
  1466.  
  1467.               Source of Interrupt        Action Required to Clear
  1468.               Receiver error or BREAK.   Read Line Status register.
  1469.               Receiver data.             Read data from data register.
  1470.               Transmitter Buffer Empty.  Write to data register or read IID reg.
  1471.               RS232 input.               Read Modem Status register.
  1472.  
  1473.               However, PCL4P only enables the receiving data interrupt.  This  means  that
  1474.               interrupts can only be caused by incoming data.
  1475.  
  1476.               If  you are not familiar with the INS8250, several good books are available.
  1477.               Refer to the Serial Communications chapter for recommendations.  Although  a
  1478.               knowledge  of the 8250 is not necessary to use PCL4P, a general knowledge of
  1479.               the theory of asynchronous serial communications is recommended.
  1480.  
  1481.  
  1482.  
  1483.  
  1484.  
  1485.  
  1486.  
  1487.  
  1488.  
  1489.  
  1490.  
  1491.  
  1492.  
  1493.  
  1494.  
  1495.  
  1496.              PCL4 Users Manual                                                Page 22
  1497.               6.8 Register Summary
  1498.  
  1499.  
  1500.               REG 0 : Data Register
  1501.  
  1502.               Reading from the data register fetches the  next  input  byte,  once  it  is
  1503.               ready.   Writing  to the data register transmits the byte written to it over
  1504.               the serial line.
  1505.  
  1506.               REG 1 : Interrupt Enable 
  1507.  
  1508.               The Interrupt Enable register enables each of four types of interrupts  when
  1509.               the appropriate bit is set to a one.
  1510.  
  1511.               bit 3 : Enable  interrupt  on  RS232  input.
  1512.               bit 2 : Enable interrupt on receiver error or break.
  1513.               bit 1 : Enable  interrupt  on  transmitter  buffer empty(TBE).
  1514.               bit 0 : Enable interrupt on received data (RxRDY).
  1515.  
  1516.               REG 2 : Interrupt Identification (IID)
  1517.  
  1518.               Reading  the Interrupt Identification (read only) register once an interrupt
  1519.               has occurred identifies the interrupt as follows:
  1520.  
  1521.               Bit 2  Bit 1  Bit 0  Priority    Interrupt
  1522.                 0      0      1      none      none
  1523.                 1      1      0      0 (high)  Serialization or break.
  1524.                 1      0      0      1         Received data.
  1525.                 0      1      0      2         Transmitter Buffer Empty.
  1526.                 0      0      0      3 (low)   RS232 Input.
  1527.  
  1528.               In the INS16650, REG 2 (write only)  is  also  the  FIFO  control  register.
  1529.               Writing bits 6 & 7 will set the FIFO trigger level (number of bytes received
  1530.               before an interrupt is generated).
  1531.  
  1532.               Bit 7  Bit 6   Trigger             Bit 7  Bit 6   Trigger
  1533.                0      0      1 byte               1      0      8 bytes
  1534.                0      1      4 bytes              1      1      14 bytes
  1535.  
  1536.               REG 3 : Line Control
  1537.  
  1538.               RS232 line parameters are selected by writing to this register.
  1539.  
  1540.               bit 7 : DLAB = 0
  1541.               bit 6 : BREAK on(1), off(0).
  1542.               bits 5-3: Parity None(000),ODD(001),EVEN(011),MARK(101),SPACE(111)
  1543.               bit 2 : One stop bit(0), two stop bits(1).
  1544.               bits 1-0: Data bits = 5 (00), 6(01), 7(10), 8(11).
  1545.  
  1546.               When  the Divisor Latch Access Bit (DLAB) is 1, registers 0 and 1 become the
  1547.               LS and MS bytes of the Baud Rate Divisor registers.
  1548.  
  1549.               Baud   Divisor      Baud  Divisor      Baud  Divisor
  1550.                300    0180        4800   0018       38400   0003
  1551.               1200    0060        9600   000C       57600   0002
  1552.               2400    0030       19200   0006      115200   0001
  1553.  
  1554.  
  1555.  
  1556.  
  1557.  
  1558.  
  1559.  
  1560.  
  1561.  
  1562.  
  1563.  
  1564.              PCL4 Users Manual                                                Page 23
  1565.               REG 4 : Modem Control
  1566.  
  1567.               RTS, DTR, loopback testing, and  General  Purpose  Outputs  #1  and  #2  are
  1568.               controlled by the Modem Control register as follows:
  1569.  
  1570.               bit 4 : Enable local loopback.
  1571.               bit 3 : Enable GP02. Necessary for 8250 interrupts.
  1572.               bit 2 : Enable GP01.
  1573.               bit 1 : Set / clear RTS.
  1574.               bit 0 : Set / clear DTR.
  1575.  
  1576.               REG 5 : Line Status
  1577.  
  1578.               Reading  the  Line Status register provides status information as follows (1
  1579.               for TRUE, 0 for FALSE) :
  1580.  
  1581.               bit 6 : Transmitter Empty.
  1582.               bit 5 : Transmitter Buffer Empty (TBE).
  1583.               bit 4 : BREAK detect.
  1584.               bit 3 : Framing error.
  1585.               bit 2 : Parity error.
  1586.               bit 1 : Overrun error.
  1587.               bit 0 : Data Ready.
  1588.  
  1589.               REG 6 : Modem Status
  1590.  
  1591.               Reading the Modem Status register provides the following status  information
  1592.               (1 for TRUE, 0 for FALSE) :
  1593.  
  1594.               bit 7 : DCD status.
  1595.               bit 6 : RI status.
  1596.               bit 5 : DSR status.
  1597.               bit 4 : CTS status.
  1598.               bit 3 : Delta DCD status.
  1599.               bit 2 : Delta RI status.
  1600.               bit 1 : Delta DSR status.
  1601.               bit 0 : Delta CTS status.
  1602.  
  1603.               The  delta  bits  (bits 0 through 3) are set whenever one of the status bits
  1604.               (bits 4 through 7) changes (from 0 to 1 or from 1 to 0) since the last  time
  1605.               that  the  Modem Status register was read. Reading the Modem Status register
  1606.               clear the delta bits.
  1607.  
  1608.               REG 7 : Scratch Register
  1609.  
  1610.               There is no function associated with register 7.  It does not exist in early
  1611.               versions of the 8250.
  1612.  
  1613.  
  1614.  
  1615.  
  1616.  
  1617.  
  1618.  
  1619.  
  1620.  
  1621.  
  1622.  
  1623.  
  1624.  
  1625.  
  1626.  
  1627.  
  1628.  
  1629.  
  1630.  
  1631.  
  1632.              PCL4 Users Manual                                                Page 24
  1633.               7.0 Terminal Emulator Example Program
  1634.  
  1635.  
  1636.               TERM is an communications program suitable for  calling  up  bulletin  board
  1637.               systems  (BBS)  and performing as a PC to PC file copy program.  TERM itself
  1638.               is not part of the communications library, but rather it is provided  as  an
  1639.               example of a communications application using PCL4P.
  1640.  
  1641.               TERM can send a standard Hayes standard AT command set string to your modem.
  1642.               An  initialization  string  is  sent by TERM provided that AT_COMMAND_SET is
  1643.               defined in DEFINES.PAS.
  1644.  
  1645.                    {$DEFINE AT_COMMAND_SET}
  1646.  
  1647.               Refer  to  the  chapter  "Modem  Initialization"   for   a   discussion   of
  1648.               initialization strings.
  1649.  
  1650.               TERM also supports hardware flow control (RTS/CTS). Hardware flow control is
  1651.               observed  provided  that the constant RTS_CTS_CONTROL is defined in the file
  1652.               DEFINES.PAS.
  1653.  
  1654.                    {$DEFINE RTS_CTS_CONTROL}
  1655.  
  1656.               Refer to the chapter "Flow  Control"  for  a  discussion  of  hardware  flow
  1657.               control.
  1658.  
  1659.               TERM  can  be  configured  to  run  script  files  (the  script  compiler  /
  1660.               interpreter is part of the registration package only) by setting
  1661.  
  1662.                    {$DEFINE SCRIPTS}
  1663.  
  1664.               in  DEFINES.PAS.  Registered  users  can  refer  to the SCRIPTS.DOC file for
  1665.               information on scripts.
  1666.  
  1667.               TERM  can  also  exchange files using XMODEM, YMODEM (batch capability), and
  1668.               YMODEM-G (streaming YMODEM used with error correcting modems) communications
  1669.               protocols.  TERM can accept wildcards in the filename so that multiple files
  1670.               can be sent using YMODEM and YMODEM-G.  The  protocol  timing  can  also  be
  1671.               adjusted   (this  should  not  be  necessary)  by  modifying  the  constants
  1672.               SHORT_WAIT and LONG_WAIT in the PCL4P.PAS file.
  1673.  
  1674.               TERM can also be used as a PC to PC transfer  program  using  a  null  modem
  1675.               cable.  In  this  case,  AT_COMMAND_SET  and  RTS_CTS_CONTROL  should not be
  1676.               defined in the file DEFINES.PAS:
  1677.  
  1678.               Be advised that most null modem cables are do NOT swap RTS and CTS, which is
  1679.               necessary for hardware flow control. This means that RTS_CTS_CONTROL  should
  1680.               never  be  defined  when  using a null modem cable unless you are absolutely
  1681.               sure that RTS and CTS are swapped.
  1682.  
  1683.               To start TERM, type TERM followed by the port (1 to 4)  and  the  baud  rate
  1684.               (300,  600,  1200,  2400,  4800,  9600, 19200, 38400, 57600, or 115200). For
  1685.               example, to start TERM at 2400 baud on port COM4:
  1686.  
  1687.                    TERM 4 2400
  1688.  
  1689.               The TERM program (but of course not the library itself)  is  placed  in  the
  1690.               public  domain  by  MarshallSoft Computing, Inc., and can be used in any way
  1691.               desired by the user.
  1692.  
  1693.  
  1694.  
  1695.  
  1696.  
  1697.  
  1698.  
  1699.  
  1700.              PCL4 Users Manual                                                Page 25
  1701.               8.0 Legal Issues
  1702.  
  1703.               8.1 Registration
  1704.  
  1705.  
  1706.               If you wish to register the EMS4C library, please send $65 plus $3  S&H  ($6
  1707.               outside of North America) to:
  1708.  
  1709.                        MarshallSoft Computing, Inc.
  1710.                        Post Office Box  4543
  1711.                        Huntsville AL 35815
  1712.  
  1713.               Multiple copies are available: $45 for 3 to 9, $35 for 10 to 19, and $25 for
  1714.               20  or  more.  A site license is also available for $495 (includes 5 sets of
  1715.               printed documentation). We pay shipping.
  1716.  
  1717.               We accept American Express (account number, expiration date, exact  name  on
  1718.               your card, and complete AmEx billing address required), checks in US dollars
  1719.               drawn  on  a  US  bank, purchase orders (POs) from recognized US schools and
  1720.               companies listed in Dun & Bradstreet, and  COD  (street  address  and  phone
  1721.               number  required)  within  the  USA  (plus a $3 COD charge).  Print the file
  1722.               PCL4P.INV if an invoice is needed.
  1723.  
  1724.               You can also order PCL4P from The Public Software Library  (PSL)  with  your
  1725.               MC,  Visa,  AmEx,  or  Discover card by calling 800-242-4PSL (from overseas:
  1726.               713-524-6394) or by FAX at 713-524-6398 or  by  CompuServe  at  [71355,470].
  1727.               THESE NUMBERS ARE FOR ORDERING ONLY. The product number for PCL4P is 10909.
  1728.  
  1729.               If  you  wish to update from an older version of PCL4P, send $15 plus $3 S&H
  1730.               ($6 outside of North  America).   Updates  must  be  ordered  directly  from
  1731.               MarshallSoft Computing.
  1732.  
  1733.               The registered package includes:
  1734.  
  1735.               o  Assembler source code for the library.
  1736.               o  Printed Users Manual.
  1737.               o  Printed Reference Manual.
  1738.               o  Telephone, FAX, BBS support for one year.
  1739.               o  Script compiler & interpreter.
  1740.               o  EXAMPORT - Free utility which displays  a  detailed  formatted
  1741.                  report  for  any  serial port.
  1742.               o  Script compiler (BUILDER) creates script binaries from source.
  1743.               o  Script interpreter (SI) executes script binaries.
  1744.  
  1745.               Print the file INVOICE.DOC if an invoice is needed. The registered user will
  1746.               receive the latest version of PCL4P shipped by two day priority mail (packet
  1747.               airmail  overseas).   A 5.25" diskette is provided unless a 3.5" diskette is
  1748.               requested.
  1749.  
  1750.  
  1751.  
  1752.  
  1753.  
  1754.  
  1755.  
  1756.  
  1757.  
  1758.  
  1759.  
  1760.  
  1761.  
  1762.  
  1763.  
  1764.  
  1765.  
  1766.  
  1767.  
  1768.              PCL4 Users Manual                                                Page 26
  1769.               8.3 License
  1770.  
  1771.  
  1772.               MarshallSoft  Computing,  Inc. grants the registered user of PCL4P the right
  1773.               to use one copy of the PCL4P library (in object form) on a  single  computer
  1774.               in  the  development  of  any software product (other than libraries such as
  1775.               PCL4P). The user may not use the library on more than one  computer  at  the
  1776.               same time.  The source code for the library (PCL4PLIB.ASM) is copyrighted by
  1777.               MarshallSoft  and  may  not  be  released  in  whole  or  in part.
  1778.  
  1779.               Products developed using PCL4P can include the object form  of  the  library
  1780.               and may be distributed without any royalty.
  1781.  
  1782.  
  1783.               8.4 Warranty
  1784.  
  1785.  
  1786.               MARSHALLSOFT COMPUTING, INC.  DISCLAIMS  ALL  WARRANTIES  RELATING  TO  THIS
  1787.               SOFTWARE,  WHETHER  EXPRESSED  OR  IMPLIED, INCLUDING BUT NOT LIMITED TO ANY
  1788.               IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR  PURPOSE,
  1789.               AND  ALL  SUCH WARRANTIES ARE EXPRESSLY AND SPECIFICALLY DISCLAIMED. NEITHER
  1790.               MARSHALLSOFT COMPUTING, INC. NOR ANYONE ELSE WHO HAS BEEN  INVOLVED  IN  THE
  1791.               CREATION,  PRODUCTION,  OR DELIVERY OF THIS SOFTWARE SHALL BE LIABLE FOR ANY
  1792.               INDIRECT, CONSEQUENTIAL, OR INCIDENTAL DAMAGES ARISING OUT  OF  THE  USE  OR
  1793.               INABILITY  TO  USE  SUCH  SOFTWARE EVEN IF MARSHALLSOFT COMPUTING, INC.  HAS
  1794.               BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES OR CLAIMS. IN NO EVENT SHALL
  1795.               MARSHALLSOFT COMPUTING, INC.'S LIABILITY FOR ANY SUCH  DAMAGES  EVER  EXCEED
  1796.               THE  PRICE  PAID FOR THE LICENSE TO USE THE SOFTWARE, REGARDLESS OF THE FORM
  1797.               OF THE CLAIM. THE PERSON USING THE SOFTWARE BEARS ALL RISK AS TO THE QUALITY
  1798.               AND PERFORMANCE OF THE SOFTWARE.
  1799.  
  1800.               Some states do not allow  the  exclusion  of  the  limit  of  liability  for
  1801.               consequential  or  incidental damages, so the above limitation may not apply
  1802.               to you.
  1803.  
  1804.               This agreement shall be governed by the laws of the  State  of  Alabama  and
  1805.               shall  inure  to  the  benefit  of  Marshallsoft  Computing,  Inc.   and any
  1806.               successors, administrators, heirs and  assigns.  Any  action  or  proceeding
  1807.               brought  by either party against the other arising out of or related to this
  1808.               agreement shall be brought only in a STATE or  FEDERAL  COURT  of  competent
  1809.               jurisdiction  located in Madison County, Alabama. The parties hereby consent
  1810.               to in personam jurisdiction of said courts.
  1811.  
  1812.  
  1813.  
  1814.  
  1815.  
  1816.  
  1817.  
  1818.  
  1819.  
  1820.  
  1821.  
  1822.  
  1823.  
  1824.  
  1825.  
  1826.  
  1827.  
  1828.  
  1829.  
  1830.  
  1831.  
  1832.  
  1833.  
  1834.  
  1835.  
  1836.              PCL4 Users Manual                                                Page 27
  1837.               9.0 Summary
  1838.  
  1839.               9.1 Revision History
  1840.  
  1841.  
  1842.               Version 1.0 - 14 January 1991 - original release.
  1843.  
  1844.               Version 1.1 - 11 March 1991
  1845.  
  1846.               o  Added SioUnGetc() function to library.
  1847.  
  1848.               Version 1.2 - 1 June 1991
  1849.  
  1850.               o  Name changed to Personal Communications Library.
  1851.               o  Minor bug fixes.
  1852.  
  1853.               Version 1.3 - 1 July 1991
  1854.  
  1855.               o  Added NORESET option to SioReset.
  1856.               o  Added SioDSR, SioCTS, SioDCD, and SioRI.
  1857.               o  Added SioLoopBack function to library.
  1858.               o  Added LOOPBACK.PAS example program.
  1859.  
  1860.               Version 2.0 - 1 Nov 1991
  1861.  
  1862.               o  All example code released in shareware package.
  1863.               o  Fixed bug due to Microsoft Assembler (MASM 5.0,5.1) error.
  1864.  
  1865.               Version 3.0 - 15 Jan 1991
  1866.  
  1867.               o  Added XMODEM & YMODEM to example code.
  1868.               o  Added SioUART function.
  1869.               o  Added "UART undefined" error code.
  1870.               o  Added "Bad or missing UART" error code.
  1871.               o  Added "Port already enabled" error code.
  1872.               o  Added "Cannot enable both COM1 & COM3 ..." error code.
  1873.               o  Fixed several minor bugs ( using new automated testing ).
  1874.  
  1875.               Version 3.1 - 1 March 1992
  1876.  
  1877.               o  Added SioFIFO ( INS16550 only ).
  1878.               o  Added SioIRQ function.
  1879.               o  Increased maximum receive buffer size to 32K bytes.
  1880.  
  1881.               Version 3.2 - 1 May 1992
  1882.  
  1883.               o  Modified SioReset so that it no longer clears DTR & RTS.
  1884.               o  Modified SioModel & renamed to SioInfo.
  1885.               o  Fixed bug in SioDone when using 2 ports simultaneously.
  1886.               o  Added SioFlow to library.
  1887.               o  Added YMODEM-G protocol to TERM program.
  1888.  
  1889.  
  1890.  
  1891.  
  1892.  
  1893.  
  1894.  
  1895.  
  1896.  
  1897.  
  1898.  
  1899.  
  1900.  
  1901.  
  1902.  
  1903.  
  1904.              PCL4 Users Manual                                                Page 28
  1905.               9.1 Revision History (continued)
  1906.  
  1907.  
  1908.               Version 3.3 - 3 August 1992
  1909.  
  1910.               o  Fixed bug in SioUnGet when using 2 ports simultaneously.
  1911.               o  Add SioRead function.
  1912.  
  1913.               Version 3.4 - 4 Jan 1993
  1914.  
  1915.               o  Library modified to use up to four ports simultaneously.
  1916.               o  SioIRQ was modified to include  third argument.
  1917.               o  EXAMPORT utility distributed to registered users.
  1918.  
  1919.               Version 3.5 - 15 May 1993
  1920.  
  1921.               o  Supports DigiBoard PC/4 and PC/8.
  1922.               o  Two new error traps added ("No such IRQ" & "No such ISR").
  1923.               o  ASCII file transfer protocol added to TERM (with XON/XOFF).
  1924.  
  1925.               Version 4.0 - 18 Oct 1993
  1926.  
  1927.               o  The library supports transmitter interrupts.
  1928.               o  Corrects bug in Ver 3.5 requiring calling SioIRQ for COM3/4.
  1929.               o  The SioIRQ function has been simplified.
  1930.  
  1931.               Version 4.1 - 1 May 1994
  1932.  
  1933.               o  Transmitter FIFO enabled.
  1934.               o  Minor internal modifications.
  1935.               o  Supports dumb BOCA boards (BB1004, BB1008, & BB2016).
  1936.               o  Port definition extended to COM16.
  1937.  
  1938.               Version 4.2 - 1 Sept 1994
  1939.  
  1940.               o  Flow contro bug fixed.
  1941.               o  Script compiler & interpreter added to registration package.
  1942.               o  SioGetDiv function added.
  1943.               o  SioRxBuf and SioTxBuf function modified.
  1944.  
  1945.  
  1946.  
  1947.  
  1948.  
  1949.  
  1950.  
  1951.  
  1952.  
  1953.  
  1954.  
  1955.  
  1956.  
  1957.  
  1958.  
  1959.  
  1960.  
  1961.  
  1962.  
  1963.  
  1964.  
  1965.  
  1966.  
  1967.  
  1968.  
  1969.  
  1970.  
  1971.  
  1972.              PCL4 Users Manual                                                Page 29
  1973.               9.2 Function Summary
  1974.  
  1975.  
  1976.               Refer to the PCL4P Reference Manual (PCL4P.REF) for detailed information  on
  1977.               the  communications  and  support  functions.  A  one  line  summary of each
  1978.               function follows:
  1979.  
  1980.  
  1981.               SioBaud     Sets the baud rate of the selected port.
  1982.               SioBrkKey   Returns non-zero if the Control-BREAK key was pressed.
  1983.               SioBrkSig   Asserts, cancels, or detects BREAK signal.
  1984.               SioCTS      Reads the Clear to Send (CTS) modem status bit.
  1985.               SioDCD      Reads the Data Carrier Detect (DCD) modem status bit.
  1986.               SioDelay    Delays one or more timer tics (18.2 tics per second).
  1987.               SioDone     Terminates further serial processing.
  1988.               SioDSR      Reads the Data Set Ready (DSR) modem status bit.
  1989.               SioDTR      Set, clear, or read the Data Terminal Ready (DTR) bit.
  1990.               SioError    Displays error in text.
  1991.               SioFIFO     Sets the interrupt level for the INS16550.
  1992.               SioFlow     Enables / disables hardware flow control.
  1993.               SioGetc     Reads the next character from the serial line.
  1994.               SioGetDiv   Reads the baud rate divisor.
  1995.               SioInfo     Returns library version number.
  1996.               SioIRQ      Assigns an IRQ line and interrupt service to a port.
  1997.               SioLine     Reads the line status register.
  1998.               SioLoopBack Performs a UART loopback test.
  1999.               SioModem    Reads the modem status register.
  2000.               SioParms    Sets parity, stop bits, and word length.
  2001.               SioPorts    Sets # ports, 1st DigiBoard / BOCA port & status reg.
  2002.               SioPutc     Transmit a character over a serial line.
  2003.               SioReset    Initialize a serial port for processing.
  2004.               SioRI       Reads the Ring Indicator (RI) modem status bit.
  2005.               SioRTS      Sets, clears, or reads the Request to Send (RTS) line.
  2006.               SioRxBuf    Sets up receive buffer.
  2007.               SioRxFlush  Flushes (clears) the receive buffer.
  2008.               SioRxQue    Returns the number of characters in the receive queue.
  2009.               SioTimer    Returns the number of system clock tics.
  2010.               SioTxBuf    Sets up transmit buffer.
  2011.               SioTxFlush  Flushes (clears) the transmit buffer.
  2012.               SioTxQue    Returns the number of characters in the transmit queue.
  2013.               SioUART     Sets the UART base address.
  2014.               SioUnGetc   "Un-gets" (puts back) a specified character.
  2015.  
  2016.  
  2017.               9.3 Further Reading
  2018.  
  2019.  
  2020.               The best way to learn about serial communications is to read a good book  on
  2021.               the  subject.  Several good texts are available.  Two that I like are (sorry
  2022.               but most communications books use C for their examples) :
  2023.  
  2024.               (1) C Programmers's Guide to Serial Communications by Joe Campbell (SAMS)
  2025.  
  2026.               (2) Mastering Serial Communications by Peter Gofton (SYBEX).
  2027.  
  2028.  
  2029.  
  2030.  
  2031.  
  2032.  
  2033.  
  2034.  
  2035.  
  2036.  
  2037.  
  2038.  
  2039.  
  2040.              PCL4 Users Manual                                                Page 30
  2041.               10.0 Other MarshallSoft Computing Products for Pascal
  2042.  
  2043.               10.1 The LZW Data Compression Library for Pascal
  2044.  
  2045.  
  2046.               LZW4P  consists  of  a  variable  code  size  implementation  of   the   LZW
  2047.               (Lempel-Ziv-Welch)  algorithm  for  compressing and decompressing data.  LZW
  2048.               does particularly  well  on  text  files,  achieving  better  than  a  50  %
  2049.               compression ratio for many files.
  2050.  
  2051.               The  LZW  algorithm  is  considered  to  be  one of the best general purpose
  2052.               algorithms  available  today.   The  new  high  speed  modems  that   employ
  2053.               on-the-fly  data  compression  (such as MNP 5.0 & the V.42 bis international
  2054.               standard) use the LZW algorithm, as well as such well known utility programs
  2055.               such as PKZIP.
  2056.  
  2057.               The LZW Data Compression Library for Pascal is available for $45 plus $3 S&H
  2058.               ($6 overseas).
  2059.  
  2060.  
  2061.  
  2062.  
  2063.  
  2064.  
  2065.  
  2066.  
  2067.  
  2068.  
  2069.  
  2070.  
  2071.  
  2072.  
  2073.  
  2074.  
  2075.  
  2076.  
  2077.  
  2078.  
  2079.  
  2080.  
  2081.  
  2082.  
  2083.  
  2084.  
  2085.  
  2086.  
  2087.  
  2088.  
  2089.  
  2090.  
  2091.  
  2092.  
  2093.  
  2094.  
  2095.  
  2096.  
  2097.  
  2098.  
  2099.  
  2100.  
  2101.  
  2102.  
  2103.  
  2104.  
  2105.  
  2106.  
  2107.  
  2108.              PCL4 Users Manual                                                Page 31
  2109.  
  2110.