home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 19 / CD_ASCQ_19_010295.iso / dos / prg / bas / pcl4b42 / pcl4busr.doc < prev    next >
Text File  |  1994-09-07  |  83KB  |  2,041 lines

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