home *** CD-ROM | disk | FTP | other *** search
/ Beijing Paradise BBS Backup / PARADISE.ISO / software / BBSDOORW / PCL4C50.ZIP / PCL4CUSR.DOC < prev    next >
Encoding:
Text File  |  1995-11-20  |  80.9 KB  |  2,381 lines

  1.  
  2.  
  3.                        Personal Communications Library
  4.  
  5.                              For the C Language
  6.  
  7.  
  8.                                   (PCL4C)
  9.  
  10.  
  11.  
  12.                               USERS MANUAL
  13.  
  14.  
  15.  
  16.  
  17.  
  18.                                 Version 5.0
  19.  
  20.                              November 20, 1995
  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) 1995
  32.                             All rights reserved
  33.  
  34.  
  35.  
  36.                          MarshallSoft Computing, Inc.
  37.                             Post Office Box 4543
  38.                             Huntsville AL 35815
  39.  
  40.  
  41.                          Voice : 205-881-4630
  42.                            FAX : 205|880|0925
  43.                            BBS : 205-880-9748
  44.                          email : msc@traveller.com
  45.                       Anon FTP : ftp.traveller.com  /pub/users/msc
  46.                            web : www.traveller.com/~msc/
  47.  
  48.  
  49.                                   _______
  50.                              ____|__     |                (R)
  51.                           --+       |    +-------------------
  52.                             |   ____|__  |  Association of
  53.                             |  |       |_|  Shareware
  54.                             |__|   o   |    Professionals
  55.                           --+--+   |   +---------------------
  56.                                |___|___|    MEMBER
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68. PCL4C 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 Memory Models..........................................10
  91.      3.2 Protected Mode.........................................11
  92.      3.3 Compilers Supported....................................13
  93.      3.4 Using the Library......................................13
  94.      3.5 Application Notes......................................14
  95.          3.5.1 Terminal Programs................................14
  96.          3.5.2 Door Programs....................................14
  97.          3.5.3 BBS Programs.....................................14
  98.      3.6 Compiling & Linking....................................15
  99.  4.0 Talking to Your Modem......................................16
  100.      4.1 Modem Standards........................................16
  101.      4.2 Flow Control...........................................17
  102.          4.2.1 Software Flow Control (XON/XOFF).................17
  103.          4.2.2 Hardware Flow Control (RTS/CTS)..................17
  104.      4.3 MODEM_IO functions.....................................17
  105.      4.4 Modem Initialization...................................18
  106.  5.0 Problems...................................................19
  107.  6.0 Serial Communications......................................20
  108.      6.1 Communications Basics..................................20
  109.      6.2 Standard Port Addresses................................21
  110.      6.3 Running 3 or 4 Ports Concurrently......................22
  111.      6.4 Using Multiport Cards..................................23
  112.          6.4.1 The DigiBoard....................................23
  113.          6.4.2 The BOCA Board...................................23
  114.      6.5 Transmitter Interrupts.................................24
  115.      6.6 RS232 Signals..........................................25
  116.      6.7 National INS8250, INS16450, and INS16550 UARTs.........26
  117.      6.8 Register Summary.......................................27
  118.  7.0 Example Programs...........................................29
  119.      7.1 MINIMAL................................................29
  120.      7.1 SIMPLE.................................................29
  121.      7.2 LOGIN..................................................29
  122.      7.3 SPAWN & DOOR...........................................29
  123.      7.4 SELFTEST...............................................29
  124.  8.0 Legal Issues...............................................30
  125.      8.1 Registration...........................................30
  126.      8.2 License................................................30
  127.      8.3 Warranty...............................................31
  128.  9.0 Summary....................................................32
  129.      9.1 Revision History.......................................32
  130.      9.2 Function Summary.......................................34
  131.      9.3 Further Reading........................................34
  132. 10.0 Other MarshallSoft Computing products for C................35
  133.      10.1 The Personal Protocol Library for C...................35
  134.      10.2 The EMS Expanded Memory Library for C.................35
  135.  
  136. PCL4C Users Manual                                                  Page 2
  137. 1.0 Introduction
  138.  
  139.  
  140. The   Personal  Communications  Library  for  the  C  Language  (PCL4C)  is  an
  141. asynchronous  communications  library   designed   for   experienced   software
  142. developers  programming  in  C/C++.  Five compilers are supported: Microsoft C,
  143. Quick C, Borland C, Turbo C, and MIX Power C.  An IBM PC/XT/AT or compatible is
  144. required.  The PCL features:
  145.  
  146.    o Supports PROTECTED MODE.
  147.    o SMALL, COMPACT, MEDIUM, and LARGE memory models.
  148.    o 38 communications and support functions.
  149.    o Supports the high performance 16550 UART.
  150.    o Supports the PC/4 and PC/8 DigiBoard.
  151.    o Supports the BOCA BB1004, BB1008, and BB2016 boards.
  152.    o Supports hardware (RTS/CTS) flow control.
  153.    o Interrupt driven transmitter & receiver.
  154.    o Supports 300 baud to 115,200 baud.
  155.    o Use IRQ2 through IRQ15 with any UART address.
  156.    o Supports COM1 through COM8 (through COM20 with multiport boards)
  157.    o Adjustable receive queues from 8 bytes to 32 KB.
  158.    o Control-BREAK error exit.
  159.    o 18 communications error conditions trapped.
  160.    o Allows 4 ports to run concurrently (more with multiport boards).
  161.    o Complete modem control & status.
  162.    o Written in assembly language for small size & high speed.
  163.    o Terminal program featuring ASCII (with XON/XOFF), XMODEM,
  164.      YMODEM, & YMODEM-G.
  165.  
  166.    Why should you buy PCL4C ?  Several good reasons are:
  167.  
  168.      COMPLETE - PCL4C is complete since it provides  absolute  control  of  the
  169.                 serial ports (including the high performance INS16550).
  170.  
  171.       COMPACT - PCL4C  is  very  compact at less than 10 KB.   Your application
  172.                 doesn't carry a lot of excess code.
  173.  
  174.          FAST - PCL4C is fast since it will run at 38400 baud on even slow 8088
  175.                 PCs (4.77 MHZ) and at 115200 baud on most everything else.
  176.  
  177.       SUPPORT - If you get stuck, you talk to the  programmer  that  wrote  the
  178.                 code, not a person hired to answer the phone.
  179.  
  180.           BBS - A BBS is available (2400 to 14400 baud, N81) in order to provide
  181.                 immediate support as necessary.
  182.  
  183.   NEWSLETTER  - We publish a quarterly newsletter "Comm Talk",   which discusses
  184.                 serial communications problems and solutions.
  185.  
  186.         PRICE - You get PCL4C for a very reasonable price!
  187.  
  188.      UPGRADES - Once you buy PCL4C, you can always update to  the  most  recent
  189.                 version very inexpensively ($20 plus shipping).
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204. PCL4C Users Manual                                                  Page 3
  205. 1.1 User Support
  206.  
  207.  
  208. We  want  you  to be successful in developing your applications using PCL4C! 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. We provide customer support for registered customers by voice, FAX, BBS, email,
  215. and US mail.  We provide limited  support  for  unregistered  users  by  voice,
  216. email, and BBS only.
  217.  
  218. If you are having a problem using PCL4C, call us at 205-881-4630  between  1:30
  219. PM  and  9:30  PM (CST) Monday through Friday. You can also call at other times
  220. and leave a message, and call back later for a reply. Registered  users  (ONLY)
  221. can also FAX us at 205-880-0925 at any time (24 hours).
  222.  
  223. However,  we can only answer questions with respect to using the PCL4C library.
  224. We cannot help you program your application, but we'll be glad  to  discuss  it
  225. with you.
  226.  
  227. You  may  also call our User Support BBS (2400 to 14400 baud, no parity, 8 data
  228. bits, 1 stop bit) at 205-880-9748 and  leave  a  message  (address  it  to  the
  229. SYSOP).  We will usually have a reply ready for you within 24 hours.
  230.  
  231. The  BBS  is  available 24 hours per day. All files are in standard ZIP format.
  232. The BBS will contain the latest shareware version of all MarshallSoft Computing
  233. products as well as related files such as:
  234.  
  235.        BUGS.ZIP     -  Bug report.
  236.        PRODUCTS.ZIP -  List of all shareware products.
  237.  
  238. The  MarshallSoft  Computing,  Inc.   newsletter  "Comm  Talk"   is   published
  239. quarterly.   It  discusses  various communications problems and solutions using
  240. PCL4C as well as related information.
  241.  
  242. The latest copy of our newsletter can be found on our  support  BBS,  anonymous
  243. FTP site, or on our Web site.
  244.  
  245.    BBS      : 205-880-9748            (look in file area "Newsletters")
  246.    Anon FTP : ftp.traveller.com       (directory  /pub/users/msc)
  247.    Web site : www.traveller.com/~msc/
  248.  
  249.  
  250. 1.2 ASP Ombudsman
  251.  
  252.  
  253. MarshallSoft  Computing,  Inc.   is  a  member  of the Association of Shareware
  254. Professionals (ASP).  ASP wants to make sure that the shareware principle works
  255. for you.  If you are unable to resolve a shareware-related problem with an  ASP
  256. member  by  contacting  the  member  directly, ASP may be able to help. The ASP
  257. Ombudsman can help you resolve a dispute or problem with  an  ASP  member,  but
  258. does  not  provide technical support for members' products. Please write to the
  259. ASP  Ombudsman  at  545  Grover  Road,  Muskegon,  MI   USA   49442-9427,   Fax
  260. 616-788-2765, or send a CompuServe message via CompuServe Mail to ASP Ombudsman
  261. 70007,3536.
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271.  
  272. PCL4C Users Manual                                                  Page 4
  273. 1.3 A Typical Application
  274.  
  275.  
  276. In  general,  there  are  two classes of applications that use a communications
  277. library like PCL4C - those that use a modem to connect to the outside world and
  278. those that connect directly to a peripheral device. In either case,  a  typical
  279. application program using PCL4C might look like the following code outline:
  280.  
  281.  
  282.  
  283. +---------------------------------------------------+
  284. | #include  "pcl4c.h"                               |
  285. |                                                   |
  286. | void main(void)                                   |
  287. | {                                                 |
  288. |  ...                                              |
  289. |                                                   |
  290. |  /* initialize serial comm  system  */            |
  291. |  SioRxBuf(Port,AllocSeg(1024),Size1024);          |
  292. |  SioTxBuf(Port,AllocSeg(128),Size128);            |
  293. |  SioParms(Port,NoParity,OneStopBit,WordLength8);  |
  294. |  SioReset(Port,Baud2400);                         |
  295. |                                                   |
  296. |  ...application code...                           |
  297. |                                                   |
  298. |  /* terminate serial comm system  */              |
  299. |  SioDone(Port);                                   |
  300. | }                                                 |
  301. +---------------------------------------------------+
  302.  
  303.  
  304.  
  305. In  the  above  example,  SioRxBuf  is called to set up the a 1024 byte receive
  306. buffer; SioTxBuf is called to set up a 128 byte transmit  buffer;  SioParms  is
  307. called  to  set  up  the  parity,  stop bit count, and word length; SioReset is
  308. called to set the baud rate to 2400 and reset the UART  (Univeral  Asynchronous
  309. Receiver / Transmitter).
  310.  
  311. The  function AllocSeg allocates a buffer of specified size on the far heap and
  312. returns the segment SEG such that SEG:0 points to  the  buffer.   The  function
  313. AllocSeg is part of the example code and can be found in the file ALLOCSEG.C.
  314.  
  315. Before  leaving  your application, SioDone is called to restore the prior state
  316. of the serial communications system.
  317.  
  318. If you are using a modem, you also need to be concerned about initializing your
  319. modem correctly and handling any required flow control.  Refer to the  "Talking
  320. to Your Modem" chapter for detailed information.
  321.  
  322. The communication library has been pre-assembled to library files:
  323.  
  324.    PCL4C_S.LIB : Small memory model.
  325.    PCL4C_C.LIB : Compact memory model.
  326.    PCL4C_M.LIB : Medium memory model.
  327.    PCL4C_L.LIB : Large memory model.
  328.    PCL4C_P.LIB : Protected mode. [Large model].
  329.    PCL4C_S.MIX : MIX PowerC small memory model.
  330.    PCL4C_M.MIX : MIX PowerC medium memory model.
  331.    PCL4C_L.MIX : MIX PowerC large memory model.
  332.  
  333.  
  334.  
  335.  
  336.  
  337.  
  338.  
  339.  
  340. PCL4C Users Manual                                                  Page 5
  341. 1.4 Installation
  342.  
  343.  
  344. (1)  Before  installation of PCL4C, your C compiler should already be installed
  345. on your system and tested. If you are not familiar  with  makefiles,  refer  to
  346. your  compiler manual. If you are using the interactive environment for Quick C
  347. or Turbo C, be sure to compile with the memory model corresponding to the PCL4C
  348. library used, and include the correct library in the project file.  Examine the
  349. file "FILES.LST" for a list of all the distribution files.
  350.  
  351. (2)  Make  a  backup  copy  of  your  distribution  disk.   Put  your  original
  352. distribution disk in a safe place.
  353.  
  354. (3)  Create  a  work directory on your work disk (normally your harddisk).  For
  355. example, to create a work directory named PCL4C, we first  log  onto  the  work
  356. disk and then type:
  357.  
  358.                     MKDIR PCL4C
  359.  
  360. (4)  Copy  all the files from your backup copy of the distribution disk to your
  361. work directory.  For example, to copy from the A: drive to your work directory,
  362. we type:
  363.  
  364.                    CD PCL4C
  365.                    COPY A:*.*
  366.  
  367. (5) [OPTIONAL] Delete the makefiles that you won't need.  For example,  if  you
  368. use  the Microsoft C compiler, then you want to keep all makefiles ending *._M_
  369. but can delete those for Turbo C (*._T_), Quick C  (*._Q_),  and  MIX  Power  C
  370. (*.PRJ).  You may also delete any libraries that you won't need.
  371.  
  372. (6)  Compile  SIMPLE.C and link with the appropriate PCL4C library (PCL4C_S.LIB
  373. for all but Power C which must use PCL4C_S.MIX). Makefiles (or  project  files)
  374. are provided for each of the supported compilers.
  375.  
  376.         a) Microsoft C/C++: Type "MAKE SIMPLE._M_"
  377.  
  378.         b) Microsoft Quick C: Type "MAKE SIMPLE._Q_"
  379.  
  380.         c) Borland C/C++: Type "MAKE -fSIMPLE._B_"
  381.  
  382.         d) Turbo C/C++: Type "MAKE -fSIMPLE._T_"
  383.  
  384.         e) MIX Power C: Type "PC/E SIMPLE.PRJ"
  385.  
  386. SIMPLE.C should compile without any problems  as  all  example  code  has  been
  387. tested with each of the supported compilers.
  388.  
  389. (7)  The recommended way to test SIMPLE is to run it on two computers connected
  390. by a null modem cable.  Whatever is typed on one computer should  be  displayed
  391. on the other.
  392.  
  393. SIMPLE can also be tested by connecting your port to a  modem.  Transmitting  a
  394. "AT" to the modem should result in an "OK" being received.
  395.  
  396.  
  397.  
  398.  
  399.  
  400.  
  401.  
  402.  
  403.  
  404.  
  405.  
  406.  
  407.  
  408. PCL4C Users Manual                                                  Page 6
  409. 2.0 Library Organization
  410.  
  411.  
  412. The  PCL4C library is organized into six categories of functions.  Refer to the
  413. PCL Reference Manual (PCL4C.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 the
  421. UART base address for a communications port to a  non-standard  address,  while
  422. SioIRQ  is  used  to  assign a nonstandard IRQ line to a port.  (See chapter 6,
  423. Serial Communications for more details  on  standard  UART  addresses  and  IRQ
  424. 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  (except
  436. 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 your
  444. serial communications system.  Your application must call SioRxBuf and SioTxBuf
  445. before calling SioReset, and SioReset must be  called  before  any  serial  I/O
  446. processing can be done.
  447.  
  448. After  initialization,  SioParms  and  SioBaud  can  be  called  to  change the
  449. communications parameters without resetting the serial port.   SioFlow  can  be
  450. called  to  enable  hardware  flow  control.   SioFIFO can be called to set the
  451. interrupt level for the 16550 FIFO.
  452.  
  453. Before exiting from your application, SioDone must be called. Failure  to  call
  454. SioDone can crash your system later.
  455.  
  456. SioRxBuf   : Sets up receive buffer.
  457. SioTxBuf   : Sets up transmitter buffer.
  458. SioFIFO    : Sets the interrupt level for the INS16550.
  459. SioParms   : Sets parity, stop bits, and word length.
  460. SioReset   : Initialize a serial port for processing.
  461. SioDone    : Terminates further serial processing.
  462. SioBaud    : Sets the baud rate of the selected port.
  463. SioFlow    : Enables / disables hardware flow control.
  464.  
  465.  
  466.  
  467.  
  468.  
  469.  
  470.  
  471.  
  472.  
  473.  
  474.  
  475.  
  476. PCL4C 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 provide
  481. your application with complete control over the status and control bits of your
  482. modem.
  483.  
  484. There  are  two modem control bits, "Data Terminal Ready" (DTR) and "Request To
  485. Send" (RTS).  These bits can be read, set, or cleared by SioDTR and SioRTS.
  486.  
  487. There are four modem status bits, "Data  Set  Ready"  (DSR),  "Clear  To  Send"
  488. (CTS),  "Ring  Indicator"  (RI), and "Data Carrier Detect" (DCD).  SioModem can
  489. read any of the modem status bits.  SioDSR, SioCTS, SioRI, and SioDCD can  only
  490. read  their  respective modem status bit. SioGetDiv reads the baud rate divisor
  491. register so the baud rate can be determined.
  492.  
  493. Refer to the chapter entitled "RS232 Signals" for a discussion of each  of  the
  494. control and status bits.
  495.  
  496. SioDTR    : Set, clear, or read the Data Terminal Ready (DTR) bit.
  497. SioRTS    : Sets, clears, or reads the Request to Send (RTS) line.
  498. SioModem  : Reads the modem status register.
  499. SioDSR    : Reads the Data Set Ready (DSR) modem status bit.
  500. SioCTS    : Reads the Clear to Send (CTS) modem status bit
  501. SioDCD    : Reads the Data Carrier Detect (DCD) modem status bit.
  502. SioRI     : Reads the Ring Indicator (RI) modem status bit.
  503. SioRead   : Reads the contents of the 7 UART registers.
  504. SioGetDiv : Reads the baud rate divisor registers.
  505.  
  506.  
  507. 2.4 Serial I/O
  508.  
  509.  
  510. There are eleven library functions in the serial I/O category.  Together, these
  511. functions give the programmer complete control over serial I/O.   Higher  level
  512. functions  such  as  protocols and smart modem communications can be completely
  513. implemented in terms of these functions.  Refer to the example code.
  514.  
  515. SioGetc, SioGets, SioPutc, and SioPuts  perform  all  the  actual  serial  I/O.
  516. SioUnGetc  "ungets"  the  last serial byte read.  SioRxClear clears the receive
  517. queue while SioTxClear clears  the  transmit  queue.   SioTxFlush  flushes  the
  518. transmit  queue.  SioLine can be used to test for UART errors. SioRxQue returns
  519. the number of bytes in the receive queue while SioTxQue returns the  number  of
  520. bytes in the transmit queue.
  521.  
  522. SioGetc    : Reads the next character from the serial line.
  523. SioGets    : Reads a buffer of characters from the serial line.
  524. SioLine    : Reads the line status register.
  525. SioPutc    : Transmit a character over a serial line.
  526. SioPuts    : Transmit a buffer of characters over a serial line.
  527. SioRxClear : Clears the receive buffer.
  528. SioRxQue   : Returns the number of characters in the RX queue.
  529. SioTxClear : Clears the transmit buffer.
  530. SioTxFlush : Flushes the transmit buffer by restarting transmitter interrupts.
  531. SioTxQue   : Returns the number of characters in the TX queue.
  532. SioUnGetc  : "Un:gets" (puts back) a specified character.
  533.  
  534.  
  535.  
  536.  
  537.  
  538.  
  539.  
  540.  
  541.  
  542.  
  543.  
  544. PCL4C 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 can
  550. make your application significantly more robust.
  551.  
  552. SioBrkKey can be used as an "emergency" exit from your  application.  SioBrkSig
  553. can  read  or  modify  the  UART  break bit.  This is useful for signalling the
  554. remote system that a fatal condition has occurred. SioLoopBack can be  used  to
  555. test   the   integrity  of  your  UART.   SioError  displays  a  error  message
  556. corresponding to an error code returned from  a  PCL4C  function  (every  PCL4C
  557. 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  three  functions  in  the  general  support  category.  They are as
  569. follows:
  570.  
  571. SioInfo     : Returns library information such as version number.
  572. SioDelay    : Delays one or more tics (18.2 tics per second).
  573. SioTimer    : Returns the number of system clock tics.
  574.  
  575.  
  576.  
  577.  
  578.  
  579.  
  580.  
  581.  
  582.  
  583.  
  584.  
  585.  
  586.  
  587.  
  588.  
  589.  
  590.  
  591.  
  592.  
  593.  
  594.  
  595.  
  596.  
  597.  
  598.  
  599.  
  600.  
  601.  
  602.  
  603.  
  604.  
  605.  
  606.  
  607.  
  608.  
  609.  
  610.  
  611.  
  612. PCL4C Users Manual                                                  Page 9
  613. 3.0 Library Organization
  614.  
  615.  
  616. 3.1 Memory Models
  617.  
  618.  
  619. Because of the segmented architecture of the INTEL CPU, there are  four  memory
  620. organizations  possible  for  computer  programs.   These  are named the SMALL,
  621. COMPACT, MEDIUM,  and  LARGE  memory  models,  which  correspond  to  the  four
  622. combinations of "near" and "far" addresses for code and data.
  623.  
  624. Each  executable  is  composed  of one or more segments, where each segment can
  625. occupy from one byte to 64 KB of memory.  A "near" address is a 16  bit  offset
  626. in  a  segment, whereas a "far" address consists of both a 16 bit segment value
  627. and a 16 bit offset.
  628.  
  629. In the small memory model, code and data each occupy one  segment.  Thus,  near
  630. addresses are allocated for both code and data.
  631.  
  632. In  the  compact  memory model, code occupies one segment while data may occupy
  633. multiple segments.  Near addresses are allocated for code but far addresses are
  634. allocated for data.
  635.  
  636. In the medium memory model, data occupies one segment  while  code  may  occupy
  637. multiple segments.  Near addresses are allocated for data but far addresses are
  638. allocated for code.
  639.  
  640. In  the  large  memory model, data and code each occupy multiple segments.  Far
  641. addesses are allocated for both code and data. Thus, both code and data can use
  642. as many segments as required.
  643.  
  644. Refer to your compiler manual for a discussion of the memory  models  supported
  645. by your compiler.
  646.  
  647. PCL4C  is  organized  as  four  separate  libraries  (PCL4C_S.LIB, PCL4C_C.LIB,
  648. PCL4C_M.LIB and PCL4C_L.LIB) corresponding to the four standard memory  models.
  649. For the MIX Power C compiler, the small, medium, and large models are provided.
  650. Lastly, there is the "protected mode" model which is linked into protected mode
  651. applications such as those created by the Borland PowerPack.
  652.  
  653.    MODEL      CODE      DATA     Library
  654.    Small      Near      Near     PCL4C_S.LIB & PCL4C_S.MIX
  655.    Compact    Near      Far      PCL4C_C.LIB
  656.    Medium     Far       Near     PCL4C_M.LIB & PCL4C_M.MIX
  657.    Large      Far       Far      PCL4C_L.LIB & PCL4C_L.MIX
  658.    Protected  Far       Far      PCL4C_P.LIB [PM only].
  659.  
  660. However, one can always use the large memory model library PCL4C_L.LIB with any
  661. memory model application code by explicitly declaring the PCL4C  procedures  to
  662. be  FAR  (by  prefixing  "far"  before the name of each function in the PCL4C.H
  663. file) and declaring your receive buffer to be FAR.  If you are  compiling  with
  664. the HUGE memory mode, link with PCL4C_L.LIB.
  665.  
  666.  
  667.  
  668.  
  669.  
  670.  
  671.  
  672.  
  673.  
  674.  
  675.  
  676.  
  677.  
  678.  
  679.  
  680. PCL4C Users Manual                                                  Page 10
  681. 3.2 Protected Mode
  682.  
  683.  
  684. Protected mode programming takes advantage of the segmented architecture of 286
  685. and  up  Intel  processors.   In contrast to normal real mode programming which
  686. limits programs to an address space of 1 MB (1024 KB),  protected  mode  allows
  687. up  to  16  MB  on  286  machines  and  4  GB (4096 MB) on 386 and up machines.
  688. Protected mode also offers some measure  of  protection  of  one  program  from
  689. another.
  690.  
  691. A program that can excecute in protected mode under DOS requires three modules:
  692.  
  693. (1) A DPMI (DOS Protected Mode Interface) driver loaded in memory.
  694.  
  695. (2) A protected mode runtime C library linked to your program.
  696.  
  697. (3) A runtime module which provides protected mode equivalents of:
  698.  
  699.     a) A subset of DOS interrupt 21H calls.
  700.     b) A subset of BIOS calls.
  701.     c) Additional functions such as protected mode memory management.
  702.  
  703. The  Personal Communications Library (PCL4C_P.LIB) supports protected mode. The
  704. application program must be  compiled  with  a  C/C++  compiler  that  supports
  705. protected  mode.   The  Borland  PowerPack  for  DOS  provides all the required
  706. modules, although the library can be used by any DOS extender that provides the
  707. three required components as outlined above.
  708.  
  709. Examine the example program PMSIMPL.C, which is a protected mode version of the
  710. normal DOS based SIMPLE.C. Compare  it  to  SIMPLE.C  to  see  the  differences
  711. necessary to run in protected mode.
  712.  
  713. In particular, note the manner in which memory is allocated for use in PCL. The
  714. transmit and receive buffers must be allocated in conventional DOS memory  (the
  715. first  1MB)  since  serial  interrupts can occur during both protected mode and
  716. real mode.
  717.  
  718.         long hRxMem;
  719.         int  RxSelector = 0;
  720.         /* setup 128 byte receive buffer */
  721.         hRxMem = (long) GlobalDosAlloc( 128L );
  722.         if(hRxMem)
  723.            {/* get selector & lock page */
  724.             RxSelector = LOWORD(hRxMem);
  725.             GlobalPageLock(RxSelector);
  726.            }
  727.         else
  728.            {/* fails */
  729.             ...
  730.            }
  731.         SioRxBuf(Port,RxSelector,Size128);
  732.  
  733. Also  notice  that  memory  should  be  free  after  calling SioDone but before
  734. exiting:
  735.  
  736.         /* clean up PCL & free memory */
  737.         SioDone(Port)
  738.         GlobalPageUnlock(RxSelector);
  739.         GlobalDosFree(RxSelector);
  740.  
  741.  
  742.  
  743.  
  744.  
  745.  
  746.  
  747.  
  748. PCL4C Users Manual                                                  Page 11
  749. 3.2 Protected Mode (continued)
  750.  
  751.  
  752. The makefile (PMSIMPLE._B_)  used  to  compile  PMSIMPLE.C  using  the  Borland
  753. compiler and PowerPack for DOS is as follows:
  754.  
  755. -------------------------------------------------------------------------------
  756.  
  757.    #
  758.    # Borland C makefile for PMSIMPLE.C (protected mode)
  759.    #
  760.  
  761.    .c.obj:
  762.      bcc -ml -c -WX $<
  763.  
  764.    pmsimple.exe: pmsimple.obj use_dpmi.obj pcl4c_p.lib
  765.      tlink -Txe c0x pmsimple use_dpmi,pmsimple,,dpmi16 emux mathwl cwl pcl4c_p.lib
  766.  
  767.    msimple.obj: pmsimple.c pcl4c.h
  768.  
  769.    use_dpmi.obj: use_dpmi.asm use_dpmi.h
  770.      masm /MX use_dpmi.asm;
  771.  
  772. -------------------------------------------------------------------------------
  773.  
  774. The files USE_DPMI.ASM and USE_DPMI.OBJ are provided along with the PCL4C_P.LIB
  775. library.
  776.  
  777. The program SELFTEST.C can also be compiled for protected  mode  by  using  the
  778. makefile PM_SELF._B_.
  779.  
  780. For  more information on protected mode, refer to your DOS extender such as the
  781. Borland Power Pack.
  782.  
  783.  
  784.  
  785.  
  786.  
  787.  
  788.  
  789.  
  790.  
  791.  
  792.  
  793.  
  794.  
  795.  
  796.  
  797.  
  798.  
  799.  
  800.  
  801.  
  802.  
  803.  
  804.  
  805.  
  806.  
  807.  
  808.  
  809.  
  810.  
  811.  
  812.  
  813.  
  814.  
  815.  
  816. PCL4C Users Manual                                                  Page 12
  817. 3.3 Compilers Supported
  818.  
  819.  
  820. At this time, five C compilers are supported by PCL4C.
  821.  
  822.    (1)  Microsoft (Optimizing) C Compiler.
  823.  
  824.    (2)  Quick C Compiler.
  825.  
  826.    (3)  Turbo C Compiler.
  827.  
  828.    (4)  Borland C Compiler.
  829.  
  830.    (5)  MIX Power C Compiler
  831.  
  832. The  Microsoft  Optimizing  C  Compiler  supports  all  memory models.  Just be
  833. careful to link with the PCL4C library that corresponds  to  the  memory  model
  834. used.   Recall  that the small memory model is the default.  Examine the (small
  835. model) makefiles *._M_ for the Microsoft compiler.
  836.  
  837. The Microsoft Quick C Compiler supports all memory models, but  be  careful  to
  838. link with the PCL4C library that corresponds with the memory model used. Recall
  839. that  the small memory model is the default for the command line compiler (QCL)
  840. while the medium memory model is  the  default  for  the  interactive  compiler
  841. environment.  Examine the (small model) makefiles *._Q_ for the Microsoft Quick
  842. C compiler.
  843.  
  844. The  Borland  and  Turbo C Compilers also support all memory models. Be sure to
  845. link with the correct PCL4C library corresponding to  the  memory  model  used.
  846. Examine the (small model) makefiles *._T_ for the Turbo C compiler.
  847.  
  848. The  MIX  Power C Compiler supports the small, medium, and large memory models.
  849. However, older versions of Power C only support the small model.   Examine  the
  850. (small model) project batch files *.PRJ for the Power C Compiler.
  851.  
  852. Other  compilers may also work with one or more of the PCL4C libraries but have
  853. not been tested.  Since registered users have the source code to  the  library,
  854. it  should  not be difficult to modify PCL4C for use with any MSDOS C compiler.
  855. Give us a call if you have any difficulty.
  856.  
  857.  
  858. 3.4 Using the Library
  859.  
  860.  
  861. The PCL4C has been tested on a Tandy 1000 (4.77 MHZ 8088 IBM PC clone), a Tandy
  862. 3000 (80286 IBM AT clone), a Tandy 1400LT (IBM XT clone), a  Gateway  2000  386
  863. (25  MHZ  80386-DX),  and  a Gateway 2000 486 (66MHZ 80486-DX).  PCL4C has also
  864. been tested under MSDOS 2.11, 3.2, 3.3, 4.01, 5.0, 6.0 and 6.2.
  865.  
  866. Please examine the PCL4C.H file. Note that COM1 is defined as  port  zero,  not
  867. port  one.   The  user  must  assume  the responsibilty for passing the correct
  868. information when calling PCL4C functions.
  869.  
  870. If there are any  conflicts  between  PCL4C  definitions  and  those  in  other
  871. libraries,  the  PCL4C  definitions  can be changed in the PCL4C.H file and any
  872. file that uses the definition. There is no change  necessary  for  the  library
  873. code itself.
  874.  
  875. The  PCL4C libraries contain no references to any runtime libraries.  Only BIOS
  876. and MSDOS functions are called.
  877.  
  878.  
  879.  
  880.  
  881.  
  882.  
  883.  
  884. PCL4C Users Manual                                                  Page 13
  885. 3.5 Application Notes
  886.  
  887.  
  888. 3.5.1 Terminal Programs
  889.  
  890.  
  891. The "terminal program" is the most common class of communications program.   It
  892. is  used  to  call  up  a  BBS  or  on-line service such as CompuServe, America
  893. On-Line, etc.  Refer to the programs SIMPLE and LOGIN in section 7 for examples
  894. of simple terminal programs.
  895.  
  896. A more sophisticated terminal program  featuring  ASCII,  XMODEM,  YMODEM,  and
  897. ZMODEM  protocol  file  transfers  can  be  found  in our sister product -- The
  898. Personal Protocol Libray (PPL4C).  Source code is  included  in  the  shareware
  899. distribution for everything except ZMODEM and the script intepreter.
  900.  
  901.  
  902. 3.5.2 Door Programs
  903.  
  904.  
  905. In order to write a door program which  "takes  over"  a  serial  port  without
  906. resetting the port or changing the baud rate, call SioReset with NORESET as the
  907. second  argument rather than the baud rate. Call SioGetDiv to get the baud rate
  908. divisor if the baud rate must be determined. Be sure to call  SioDone  before
  909. returning  to  the  invoking  program.  Refer to the SPAWN.C and DOOR.C example
  910. programs.  Also be sure to free any memory that you may have allocated in  your
  911. door program before exiting.
  912.  
  913.  
  914. 3.5.3 BBS Programs
  915.  
  916.  
  917. If  you  are  designing  a  BBS program (also known as HOST programs), consider
  918. using 16550 UARTS.  You should  also  choose  a  multiport  card  such  as  the
  919. DigiBoard or BOCA board if you wish to run more than 4 ports simultaneously.
  920.  
  921. If you are using an error correcting modem, then you should be sure to set flow
  922. control  and  fix  your  baud rate at the highest possible transfer rates.  For
  923. 14,400 modems, this means 19200 or 38400. You may need a 16550 UART in order to
  924. run at the higher speed.
  925.  
  926. If you are using an older multi-speed modem (say 1200, 2400, 4800,  9600)  that
  927. doesn't use flow control, you should change your baud rate to match the CONNECT
  928. message baud rate.
  929.  
  930.  
  931.  
  932.  
  933.  
  934.  
  935.  
  936.  
  937.  
  938.  
  939.  
  940.  
  941.  
  942.  
  943.  
  944.  
  945.  
  946.  
  947.  
  948.  
  949.  
  950.  
  951.  
  952. PCL4C Users Manual                                                  Page 14
  953. 3.6 Compiling and Linking
  954.  
  955.  
  956. Registered users may wish to assemble PCL4C.ASM.  Use the /MX switch  in  order
  957. to  disable  automatic  conversion  from  lower case to upper case.  If the /MX
  958. switch is not used, then all PCL4C function references in C  code  must  be  in
  959. upper case. To assemble using the Microsoft assembler:
  960.  
  961.    Model    Command
  962.  
  963.    Small    MASM PCL4C /DSMALL_MODEL   /MX;
  964.    Compact  MASM PCL4C /DCOMPACT_MODEL /MX;
  965.    Medium   MASM PCL4C /DMEDIUM_MODEL  /MX;
  966.    Large    MASM PCL4C /DLARGE_MODEL   /MX;
  967.  
  968. To disable transmitter interrupts, add "/DNO_TBE" to  each  MASM  command  line
  969. above.
  970.  
  971. For example, to make the (small) model PCL4C.OBJ into a library file:
  972.  
  973.          DEL PCL4C_S.LIB
  974.          LIB PCL4C_S.LIB+PCL4C,PCL4C.MAP;
  975.  
  976. If you are using the MIX Power C Compiler, create the MIX object file (you will
  977. need version 1.3 of MIX which has the /_ switch):
  978.  
  979.          MIX /_ PCL4C_S
  980.  
  981. Similarly   with  the  other  memory  model  libaries.   See  the  batch  files
  982. MAKE_S.BAT,   MAKE_C.BAT,   MAKE_M.BAT,   and   MAKE_L.BAT.    Similiarly   for
  983. MAKE_ST.BAT, MAKE_CT.BAT, MAKE_MT.BAT, and MAKE_LT.BAT.
  984.  
  985. To compile and link (small model) using Microsoft C:
  986.  
  987.          CL /AS SIMPLE.C /LINK PCL4C_S.LIB
  988.  
  989. To compile and link (small model) using Microsoft Quick C:
  990.  
  991.          QCL /AS SIMPLE.C /LINK PCL4C_S.LIB
  992.  
  993. To compile and link (small model) using Borland C:
  994.  
  995.          BCC -ms SIMPLE.C PCL4C_S.LIB
  996.  
  997. To compile and link (small model) using Turbo C:
  998.  
  999.          TCC -ms SIMPLE.C PCL4C_S.LIB
  1000.  
  1001. To compile and link (small model) using Power C:
  1002.  
  1003.          PC /ms SIMPLE.C
  1004.          PCL SIMPLE PCL4C_S.MIX
  1005.  
  1006. Makefiles  or  project  files  are  provided  for  all  example  code.  Borland
  1007. makefiles end with  the  extension  '._B_',  Turbo  C  makefiles  with  '._T_',
  1008. Microsoft  C  makefiles  end with '._M_', Microsoft Quick C makefiles files end
  1009. with '._Q_', and Power C project batch files end with '.PRJ'.
  1010.  
  1011. The PCL4C libraries may also be used with integrated development  environments.
  1012. Place  all  required  files  along with the library corresponding to the memory
  1013. model being used into the project file.  Be  sure  to  select  the  appropriate
  1014. memory model, and turn off case sensitivity.
  1015.  
  1016.  
  1017.  
  1018.  
  1019.  
  1020. PCL4C Users Manual                                                  Page 15
  1021. 4.0 Talking to Your Modem
  1022.  
  1023.  
  1024. A  modem is used to extend the distance over which you may communicate. Without
  1025. a modem, your RS232 cable is limited to a maximum of approximately 50 feet. But
  1026. with a modem, you can communicate literally around the world.
  1027.  
  1028. Also refer to Section 4.3 for details on MODEM_IO functions.   These  functions
  1029. faciliate communications with modems.
  1030.  
  1031.  
  1032. 4.1 Modem Standards
  1033.  
  1034.  
  1035. Two  modems  can  communicate over a telephone line only if they are both using
  1036. the same signaling frequencies and modulation, which are determined by the  the
  1037. modem  standards  used.   Modem  standards  can be divided into three sets: (1)
  1038. speed, (2) data compression used, and (3) error control.
  1039.  
  1040. The  Bell  standards  (103  &  212A)  are  those  of  AT&T.   The  CCITT   (The
  1041. International Consultative Committee for Telephone and Telegraph) standards are
  1042. designated as "V. ".
  1043.  
  1044.  
  1045.    Speed
  1046.  
  1047.  
  1048.    Bell 103  :   300 baud
  1049.    Bell 212A :  1200 baud
  1050.    V.21      :   300 baud
  1051.    V.22bis   :  1200 & 2400 baud
  1052.    V.32      :  4800 & 9600 baud
  1053.    V.32bis   :  4800, 7200, 9600, 12000, and 14400 baud
  1054.    V.34      :  through 28800 baud
  1055.  
  1056.    Data Compression
  1057.  
  1058.  
  1059.    MNP 5     :  Microcom Networking Protocol (proprietary).
  1060.    V.42bis   :  International data compression standard.
  1061.  
  1062.  
  1063.    Error Control
  1064.  
  1065.  
  1066.    MNP 2,3,4 :  Three level error correction (public domain).
  1067.    V.42      :  International error correction standard.
  1068.  
  1069.  
  1070. Most  of  the  newer  high  speed  modems  use  several of the above standards.
  1071. However, not all combinations of  modem  makes  communicate  easily  with  each
  1072. other, especially at high speeds (9600 and up).
  1073.  
  1074.  
  1075.  
  1076.  
  1077.  
  1078.  
  1079.  
  1080.  
  1081.  
  1082.  
  1083.  
  1084.  
  1085.  
  1086.  
  1087.  
  1088. PCL4C Users Manual                                                  Page 16
  1089. 4.2 Flow Control
  1090.  
  1091.  
  1092. With  modems  using data compression, the modem to modem connection will run at
  1093. various speeds depending on the quality of the line.   The  computer  to  modem
  1094. connection  will  be at a fixed baud rate. Therefore, a protocol (flow control)
  1095. is necessary to synchronize the data flow between a modem and the  computer  to
  1096. which  it  is  connected.   Refer  to your modem manual for information on flow
  1097. control protocols supported by your modem.
  1098.  
  1099. Two flow control protocols are used  by  modems  which  require  flow  control.
  1100. Software  flow control is called "XON/XOFF" and hardware flow control is called
  1101. "RTS/CTS".  Most modems which require flow control enable hardware flow control
  1102. by default.
  1103.  
  1104.  
  1105. 4.2.1 Software Flow Control (XON/XOFF)
  1106.  
  1107.  
  1108. In XON/XOFF (software) flow control, the computer suspends transmitting data if
  1109. it  receives  a  XOFF  character  (13  hex)  from  the  modem,  and   continues
  1110. transmitting  when  it  receives  a  XON  character  (11 hex).  Similiarly, the
  1111. computer can signal the modem not to send any more data by transmitting a  XOFF
  1112. to it, and can tell the modem to continue transmission be sending a XON.
  1113.  
  1114. Software  flow control cannot be used to transfer binary data since binary data
  1115. may have hex 11 or hex 13 bytes embedded in it. The  ASCII  protocol  typically
  1116. uses XON/XOFF to control display flow while the modem may be using RTS/CTS.
  1117.  
  1118. XON/XOFF is implemented in the module XONOFF.C.
  1119.  
  1120.  
  1121. 4.2.2 Hardware Flow Control (RTS/CTS)
  1122.  
  1123.  
  1124. In  RTS/CTS  (hardware)  flow  control, the RTS line is used by the computer to
  1125. signal the modem , while the CTS line is  used  by  the  modem  to  signal  the
  1126. computer.  The RTS line is set OFF by the computer to tell the modem to suspend
  1127. transmission,  and  set  to ON to tell the modem to continue transmission.  The
  1128. CTS line is set to OFF by the modem to tell the computer to stop  transmitting,
  1129. and set to ON to tell the computer to continue transmitting.
  1130.  
  1131. Given  the  choice,  always  choose  hardware  flow  control over software flow
  1132. control so that all data transmission is transparent.  If hardware flow control
  1133. is not the default (which it almost always is), you should  modify  your  modem
  1134. initialization string to turn hardware flow control on.
  1135.  
  1136. Hardware  flow  control is internal to the PCL4C library and is selected by the
  1137. SioFlow function.
  1138.  
  1139.  
  1140. 4.3 MODEM_IO Functions
  1141.  
  1142.  
  1143. The file MODEM_IO.C contains several functions  that  ease  communicating  with
  1144. your  modem.   Look  in  the LOGIN.C code for examples of their use. Registered
  1145. users can also see examples in the script interpreter SI.C.
  1146.  
  1147. ModemSendTo   : Sends string (including control chars) to the modem.
  1148. ModemWaitFor  : Waits for a string from the modem, passing all else through.
  1149. ModemQuiet    : Waits for continuous quiet of specified duration.
  1150. ModemHangup   : Hangs up the modem.
  1151. ModemCmdState : Goes into the modem's command state.
  1152. ModemEcho     : Echos all serial incoming bytes to the display.
  1153.  
  1154.  
  1155.  
  1156. PCL4C Users Manual                                                  Page 17
  1157. 4.4 Modem Initialization
  1158.  
  1159.  
  1160. If your application uses a modem (as opposed to using a null modem cable), then
  1161. you should always send an initialization string  to  your  modem  if  it  is  a
  1162. programmable modem such as those made by Hayes.  Communication programs such as
  1163. PROCOMM and TELIX always send such a string automatically as soon as they start
  1164. up.
  1165.  
  1166. The  particular  initialization  string  depends  on  the  make  of your modem.
  1167. Virtually all modems implement the basic Hayes AT command set,  and  add  their
  1168. own  "extended"  AT  commands.  These  extended  AT  commands  vary among modem
  1169. manufacturers.
  1170.  
  1171. For AT command set modems the following string (followed by a carriage  return)
  1172. may work:
  1173.  
  1174.         AT E1 S7=60 S11=60 V1 X1 Q0 S0=0
  1175.  
  1176. Refer  to  your  Modem User's Guide for a full discussion of these commands.  A
  1177. brief description is as follows:
  1178.  
  1179.    AT     : Modem attention command.
  1180.    E1     : Modem will echo what you send to it.
  1181.    S7=60  : Wait 60 seconds for carrier and/or dial tone.
  1182.    S11=60 : Use 60 milliseconds for tone dialing duration & spacing.
  1183.    V1     : Display result code as words (not numbers).
  1184.    X1     : Use the extended result message (CONNECT XXXX) set.
  1185.    Q0     : Modem returns result codes.
  1186.    S0=0   : Do not answer RING.
  1187.  
  1188. If your application will answer incoming calls, then set the S0 register to the
  1189. ring on which to automatically answer. Alternatively, use the  ATA  command  to
  1190. explicitly answer the modem after detecting the RING.
  1191.  
  1192. If you send the above codes by using SioPutc (as opposed to  typing  them  from
  1193. the keyboard), then follow these guidelines:
  1194.  
  1195. (1) Send an initial carriage return before the initialization string.
  1196.  
  1197. (2) Pause at least two tics (18 tics to the second) after each  character  sent
  1198. as  your  modem  needs the time to perform its own internal processing. Pause a
  1199. little longer if your modem is not accepting your initialization string.
  1200.  
  1201. (3) Pause one and a half seconds after sending any initialization command  such
  1202. as ATZ or AT&F since your modem must do quite a bit of processing.
  1203.  
  1204. If  you  experience  any  problems in initializing your modem, you should first
  1205. reset it to factory settings by sending:
  1206.  
  1207.         AT&F
  1208.  
  1209. Your modem may require more initialization than presented above.  Refer to your
  1210. modem manual for details. If you have a communications program such as  ProComm
  1211. or Telix that is known to initialize your modem correctly, then you may wish to
  1212. use the same initialization string.
  1213.  
  1214. Refer to the LOGIN.C program (and functions ModemSendTo and ModemWaitFor in the
  1215. file MODEM_IO.C) for an example of sending an initialization string to a modem.
  1216.  
  1217.  
  1218.  
  1219.  
  1220.  
  1221.  
  1222.  
  1223.  
  1224. PCL4C Users Manual                                                  Page 18
  1225. 5.0 Problems
  1226.  
  1227.  
  1228. Before  developing  your application, you should run the example programs. They
  1229. should all execute correctly.
  1230.  
  1231. If you have two ports on your computer, connect them together with a null modem
  1232. cable and run SELFTEST.C. If SELFTEST does not execute properly then  there  is
  1233. something  wrong with either (1) your serial port hardware, (2) your null modem
  1234. cable, or (3) you selected ports that are  not  connected  by  the  null  modem
  1235. cable.
  1236.  
  1237. Another  easy  test is to connect the serial port to a modem, and use SIMPLE to
  1238. send a "AT" to the modem, which should respond with a "OK". If you  cannot  get
  1239. your  application  to run properly, first compile and run the terminal emulator
  1240. program SIMPLE provided on your distribution disk.
  1241.  
  1242. If your application does not run but the example programs run  correctly,  then
  1243. you   have  most  likely  made  a  programming  mistake  in  your  application.
  1244. MarshallSoft Computing cannot  debug  your  application,  especially  over  the
  1245. telephone!  However, consider each of the following when searching for an error
  1246. in your application.
  1247.  
  1248. 1.  Have you included the file PCL4C.H in your application ?
  1249.  
  1250. 2.  Did you link with the correct PCL4C library ?  This is  the  most  probable
  1251. cause if your application 'hangs' as soon as it starts and you must reboot. The
  1252. function  SioInfo('M')  returns  the  model  ID  under  which  the  library was
  1253. assembled.
  1254.  
  1255. 3.   Is  your  receive buffer large enough ? If you are using 1K data blocks in
  1256. YMODEM, then your receive buffer should be at least 1K (2K if baud rates  above
  1257. 19200 are to be used).
  1258.  
  1259. 4.   Have  you selected too high a baud rate (if you are using a slow PC) ?  If
  1260. only one COM port is being run, you should be able to run at 38400 baud on 8088
  1261. machines and 115200 on most 286 and all 386 and 486 machines.
  1262.  
  1263. 5.  Are you attempting to run another application  in  the  background  ?   Try
  1264. running  without  any  other programs running in the background (unload all TSR
  1265. programs).
  1266.  
  1267. 6.  If you are running two COM ports simultaneously,  are  you  using  separate
  1268. receive and transmit buffers ? (you should).
  1269.  
  1270. 7.   Did  SioReset  return  a zero value ?  If not, then you must call SioReset
  1271. again. See SIMPLE.C for an example.
  1272.  
  1273. 8.  Did you send the proper initialization string to your modem ?  Did you  set
  1274. DTR and RTS ? (you should).
  1275.  
  1276. 9.   Do you have more than one COM1 port, etc.  For example, if you have a COM1
  1277. port on your motherboard, you cannot add another COM1 port or modem board  that
  1278. uses COM1 without first disabling the COM1 on the motherboard.
  1279.  
  1280. 10.  Are you passing the proper segment of the receive (and  transmit)  buffer?
  1281. See SIMPLE.C for an example.
  1282.  
  1283.  
  1284.  
  1285.  
  1286.  
  1287.  
  1288.  
  1289.  
  1290.  
  1291.  
  1292. PCL4C Users Manual                                                  Page 19
  1293. 6.0 Serial Communications
  1294.  
  1295.  
  1296. 6.1 Communications Basics
  1297.  
  1298.  
  1299. The heart of serial communications is the UART (Universal Asynchronous Receiver
  1300. Transmitter).  The IBM PC/XT/AT and compatibles use the INS8250,  INS16450,  or
  1301. the INS16550 UART.  The purpose of the UART is:
  1302.  
  1303. (1)  To  convert  bytes  from  the CPU (Central Processing Unit), into a serial
  1304. format by adding the necessary start, stop, and parity bits to each byte before
  1305. transmission, and to then transmit each bit at the correct baud rate.
  1306.  
  1307. (2) To convert the incoming stream (at a specified baud rate)  of  serial  bits
  1308. into  bytes  by  removing  the  start,  stop, and parity bits before being made
  1309. available to the CPU.
  1310.  
  1311. The UART is part of the serial interface circuitry which allows the CPU to send
  1312. and receive signals over the RS232 lines. This can be diagrammed as follows:
  1313.  
  1314.  
  1315.                       Serial Interface
  1316.                    +-------------------+
  1317.                    |                   |
  1318. +-----+  Data Bus  |     +------+      |    RS232 Signals
  1319. | CPU +------------+     | UART |      +----------------*
  1320. +-----+            |     +------+      |
  1321.                    |                   |
  1322.                    +-------------------+
  1323.  
  1324.  
  1325. The INS8250/16450/16550 UART is capable of  operating  in  one  of  two  modes,
  1326. "polled"  and  "interrupt  driven".  The serial communications functions in the
  1327. BIOS uses the polled method.  In this approach, the CPU is typically in a  loop
  1328. asking  the  UART  over and over again if it has a byte ready.  If it does, the
  1329. polling code returns the byte.  But, if the  next  byte  comes  in  before  the
  1330. polling code is executing again, then that byte is lost.
  1331.  
  1332. In  the  interrupt  driven  approach,  when  a byte is received by the UART, an
  1333. interrupt is generated and the "Interrupt Service Routine"  (ISR)  is  executed
  1334. immediately,  suspending  temporarily whatever else is executing.  The ISR then
  1335. moves the byte to the receive buffer so that your application program can later
  1336. read it.
  1337.  
  1338. When a byte is to be transmitted,  it  is  moved  to  the  transmit  queue  and
  1339. transmitter  interrupts  are  "kickstarted",  which  causes  an interrupt to be
  1340. generated each time the transmitter buffer becomes empty. The ISR  is  invoked,
  1341. which  removes  the  byte  from the transmitter queue and writes it to the UART
  1342. transmit buffer.
  1343.  
  1344. Refer  to  section  6.5  "Transmitter Interrupts", section 6.6 "RS232 Signals",
  1345. and section 6.7 "National INS8250, INS16450 and  INS16550  UARTs"  for  further
  1346. information on these topics.
  1347.  
  1348.  
  1349.  
  1350.  
  1351.  
  1352.  
  1353.  
  1354.  
  1355.  
  1356.  
  1357.  
  1358.  
  1359.  
  1360. PCL4C Users Manual                                                  Page 20
  1361. 6.2 Standard Port Addresses
  1362.  
  1363.  
  1364. There are a few things to know about how serial communications ports  are  used
  1365. by   IBM   PC/XT/AT  and  compatible  computers.   The  standard  IBM  PC/XT/AT
  1366. configuration values are as follows:
  1367.  
  1368.    Port    Reg.   IRQ  Vector
  1369.    COM1    3F8H    4     12
  1370.    COM2    2F8H    3     11
  1371.    COM3    3E8H    4     12
  1372.    COM4    2E8H    3     11
  1373.  
  1374. (Refer to your DigiBoard manual for DigiBoard addresses,  or  your  BOCA  board
  1375. manual for BOCA port addresses).
  1376.  
  1377. PCL4C  assumes  the  above  values.  If necessary, the UART base address can be
  1378. changed by SioUART, and IRQ lines can be re-assigned by SioIRQ.  Remember  that
  1379. each  port  to  be used concurrently must have a unique IRQ line.  Refer to the
  1380. PCL4C Reference Manual for specific details.
  1381.  
  1382. When  installing  new  communications  cards,  the  following  guidelines   are
  1383. recommended:
  1384.  
  1385. (1) Be sure to read the documentation for the hardware you are installing.  Pay
  1386. special  attention to UART base addresses and IRQ lines, particularly if trying
  1387. to set up a non-standard configuration.
  1388.  
  1389. (2) If you have a choice  in  base  addresses  and  IRQ  lines,  always  choose
  1390. standard values as defined above.
  1391.  
  1392. (3)  The first port should be COM1, the second COM2, etc.  Do not skip over any
  1393. port number if possible.
  1394.  
  1395. (4) Use SioUART to zero all unused ports (for example, call SioUART(COM4,0)  if
  1396. there is no COM4 port installed).
  1397.  
  1398. (5)  Be  carefull  not  to  configure  two ports for the same address.  This is
  1399. easier to do than you may believe.
  1400.  
  1401. (6) Choose an external modem over an internal one.  It is much easier to  debug
  1402. problems with an external modem than an internal one.
  1403.  
  1404. (7)  Select  hardware  flow  control  (RTS/CTS) if flow control is required and
  1405. hardware flow control is not the default.
  1406.  
  1407. (8) Always test your port as soon as it is installed. Try several programs that
  1408. use the communications ports.
  1409.  
  1410. (9) If your serial card has two or more ports, run SELFTEST  after  configuring
  1411. it for your new card.
  1412.  
  1413.  
  1414.  
  1415.  
  1416.  
  1417.  
  1418.  
  1419.  
  1420.  
  1421.  
  1422.  
  1423.  
  1424.  
  1425.  
  1426.  
  1427.  
  1428. PCL4C Users Manual                                                  Page 21
  1429. 6.3 Running 3 or 4 Ports Concurrently
  1430.  
  1431.  
  1432. PCL4C  supports  up  to 4 serial ports running concurrently (more if you have a
  1433. DigiBoard or BOCA board).  One free interrupt for each port is required.  Refer
  1434. to the next section if you have a DigiBoard or BOCA board.
  1435.  
  1436. Interrupts  IRQ4  and  IRQ3  are  dedicated  to  the  communications ports in a
  1437. standard IBM PC/XT/AT configuration.  IRQ4 is  shared  between  COM1  and  COM3
  1438. while  IRQ3  is  shared between COM2 and COM4.  This means that you can run two
  1439. ports simultaneously provided that they don't share an interrupt.
  1440.  
  1441. Suppose that you wish to run 3 ports simultaneously. To begin, you must have  3
  1442. UARTs  (serial ports) installed on your computer.  Assume, for purposes of this
  1443. discussion, that COM1 is installed on  your  motherboard,  and  that  you  have
  1444. purchased a new 2 port serial communications board.
  1445.  
  1446. You should be able to configure the first serial board port as COM2, which uses
  1447. IRQ3.  Refer to the manual that came with your serial board.
  1448.  
  1449. In  order  to  run  the  third  serial port concurrently with the first two, an
  1450. unused interrupt must be found.  If your serial card  can  use  only  IRQ3  and
  1451. IRQ4, then there is no way to run a third line since IRQ4 and IRQ3 are used for
  1452. COM1 and COM2.
  1453.  
  1454. However,  many  serial  cards  can use other IRQs, typically IRQ2 through IRQ7.
  1455. Many of the newer serial cards can  use  IRQs  through  IRQ15.  Since  IRQ5  is
  1456. normally  used  for a second printer port, it is a good candidate for COM3.  To
  1457. use IRQ5 for the third serial port, first set your serial card to use IRQ5  for
  1458. COM3 (refer to your serial card manual) and then add the following line to your
  1459. applications code before calling SioReset:
  1460.  
  1461.           SioIRQ(COM3,IRQ5);
  1462.  
  1463. Don't  forget  to  disable  any  device  that  might use IRQ5, such as a second
  1464. printer port or a music card.  Unfortunately, there is no easy way to determine
  1465. that you have no conflicts until you actually attempt to use the IRQ.  If there
  1466. are conflicts, your system will probably hang and you will have to reboot.
  1467.  
  1468. To run a fourth serial port, another free IRQ must be found.  On some  systems,
  1469. IRQ7 can be used. To use IRQ7 for the fourth serial port, first set your serial
  1470. card to use IRQ7 for COM4 and then add:
  1471.  
  1472.           SioIRQ(COM4,IRQ7);
  1473.  
  1474. Also  note that conflicts are possible with port addresses. You cannot have two
  1475. cards using the same port address. This problem most often occurs when adding a
  1476. multiport board since each UART uses 8 consecutive port addresses.
  1477.  
  1478. Of  course,  you  can select any IRQ and UART address that your serial card can
  1479. generate. Just be carefull about IRQ and port address conflicts.
  1480.  
  1481. To  summarize, your serial card must be able to generate the correct IRQ, which
  1482. is not already being used. Refer to the entry for the SioIRQ  function  in  the
  1483. PCL4C Reference Manual.
  1484.  
  1485.  
  1486.  
  1487.  
  1488.  
  1489.  
  1490.  
  1491.  
  1492.  
  1493.  
  1494.  
  1495.  
  1496. PCL4C Users Manual                                                  Page 22
  1497. 6.4 Using Multiport Cards
  1498.  
  1499.  
  1500. The  PCL4C  library supports the dumb Digiboard (PC/4 & PC/8) and the dumb BOCA
  1501. board (BB1004, BB1008, and BB2016).
  1502.  
  1503. 6.4.1 The DigiBoard
  1504.  
  1505. PCL4C supports the DigiBoard PC/4 and PC/8. In order to use the DigiBoard,  you
  1506. must configure PCL4C using the SioPorts, SioUART, and SioIRQ functions.
  1507.  
  1508. Your  PC's  ports  must  be  partitioned into "standard" PC ports and dumb card
  1509. ports.  Remember that standard PC ports cannot share IRQs  like  the  DigiBoard
  1510. (or  BOCA board) can. If you are using IRQ4 and IRQ3 for standard PC ports COM1
  1511. and COM2, then you cannot use either for DigiBoard ports (try IRQ5 or IRQ7).
  1512.  
  1513. Suppose that COM1 through COM2 are standard PC ports (using IRQ4 and IRQ3)  and
  1514. you have installed a PC/8 DigiBoard that you wish to use for COM3 through COM10
  1515. using  interrupt  line  IRQ5.  You choose to use the recommended DigiBoard UART
  1516. addresses starting at 0x100:
  1517.  
  1518. -------------------------------------------------------------------------------
  1519.  
  1520.   SioPorts(10,COM3,0x140,DIGIBOARD);/* COM3 = 1st DigiBoard port */
  1521.   Address = 0x100;                  /* 1st DigiBoard UART address */
  1522.   for(Port=COM3;Port<=COM10;Port++) /* look at each port */
  1523.     {SioUART(Port,Address);         /* set the UART address */
  1524.      Address += 8;                  /* compute next address */
  1525.      SioIRQ(Port,IRQ5);             /* set the DigiBoard IRQ */
  1526.     }
  1527.  
  1528. -------------------------------------------------------------------------------
  1529.  
  1530. The  DigiBoard  uses  0x140 for the status address for odd interrupts and 0x141
  1531. for even interrupts [the status address is set on the board itself].
  1532.  
  1533. Digiboard may be contacted at 6400 Flying Cloud Drive, Eden Prairie, MN  55344.
  1534. Telephone 612-943-9020 or FAX 612-943-5398.
  1535.  
  1536. 6.4.2 The BOCA Board
  1537.  
  1538. PCL4C  supports the dumb BOCA board.  As with the DigiBoard, you must configure
  1539. PCL4C before using the BOCA board.
  1540.  
  1541. For example, to configure the BOCA BB2016 to  use  COM1  to  COM16,  with  base
  1542. addresses starting at 0x100 and IRQ5:
  1543.  
  1544. -------------------------------------------------------------------------------
  1545.  
  1546.   SioPorts(16,COM1,0x107,BOCABOARD);/* COM3 = 1st BOCA board port */
  1547.   Address = 0x100;                  /* 1st BOCA UART address */
  1548.   for(Port=COM1;Port<=COM16;Port++) /* look at each port    */
  1549.     {SioUART(Port,Address);         /* set the UART address */
  1550.      Address += 8;                  /* compute next address */
  1551.      SioIRQ(Port,IRQ15);            /* set the BOCA IRQ */
  1552.     }
  1553.  
  1554. -------------------------------------------------------------------------------
  1555.  
  1556. BOCA may be contacted at BOCA Research, Inc., 6413 Congress Avenue, Suite  130,
  1557. Boca Raton, FL 33487.  Phone 407-241-8088, FAX 407-997-0918.
  1558.  
  1559.  
  1560.  
  1561.  
  1562.  
  1563.  
  1564. PCL4C Users Manual                                                  Page 23
  1565. 6.5 Transmitter Interrupts
  1566.  
  1567.  
  1568. PCL4C  comes  assembled  for  all  memory  models  with  transmitter interrupts
  1569. enabled. PCL4C can also be assembled without transmitter interrupts enabled  by
  1570. including "/DNO_TBE" on the MASM line.
  1571.  
  1572. When  transmitter  interrupts  are  NOT  enabled,  the  following  logic occurs
  1573. everytime SioPutc or SioPuts is called:
  1574.  
  1575. 1.  Wait for the UART transmit  buffer  to  become  empty.  The  UART  transmit
  1576. buffer  may  not  be  empty if the previous transmit is not completed (the UART
  1577. breaks down the byte & sends 1 bit at a time).
  1578.  
  1579. 2.  When the UART transmit buffer is  empty,  the  byte  from  the  SioPutc  or
  1580. SioPuts  call  is  loaded into the UART transmit buffer and control is returned
  1581. to the caller.
  1582.  
  1583. Note that you can not write to the UART any faster than the UART baud rate.
  1584.  
  1585. Transmitter  interrupts  provide a way for your application program to write to
  1586. the serial port faster than the baud rate, but transmitter interrupts  do  have
  1587. several  caveats.  To begin, they are slower than polled transmission, although
  1588. not significantly.  Secondly, they are  more  complex  and  thus  result  in  a
  1589. slightly larger library.
  1590.  
  1591. The increased complexity of transmitter interrupts is due to the fact that even
  1592. though transmitter interrupts are enabled, a transmitter  interrupt  can  occur
  1593. only  when the UART transmitter register transitions from not-empty to empty (a
  1594. byte has just been transmitted). To start the  transmitter  interrupt  process,
  1595. the  first  byte  in the PCL4C transmitter queue must be transmitted by SioPutc
  1596. (or SioPuts) rather than by the Interrupt Service Routine (ISR).  The remainder
  1597. of the bytes in the PCL4C transmit queue are transmitted by the  ISR  when  the
  1598. transmitter  interrupt  occurs.  This  process  is  called  "kickstarting"  the
  1599. transmitter interrupts.
  1600.  
  1601. When transmitter interrupts are enabled, the following logic  occurs  everytime
  1602. SioPutc or SioPuts is called:
  1603.  
  1604. 1.  The byte from SioPutc  or  bytes  from  SioPuts  are  put  into  the  PCL4C
  1605. transmitter queue.
  1606.  
  1607. 2.  If  there  is  no  byte  presently  being transmitted, then the transmitter
  1608. interrupt process is kickstarted.
  1609.  
  1610. 3.   Each  time  a transmitter interrupt occurs, the ISR gains control, removes
  1611. the next byte from the PCL4C transmitter queue and puts it in the UART transmit
  1612. register.
  1613.  
  1614. While you can now call SioPutc and SioPuts faster than the baud rate, bytes are
  1615. still transmitted at the given baud rate. The advantage  of  using  transmitter
  1616. interrupts  is  that  an application program can write a string of bytes to the
  1617. serial transmit queue without having to wait for those bytes to be  transmitted
  1618. before regaining control.
  1619.  
  1620. When   running   a   streaming   protocol   (one  that  doesn't  wait  for  any
  1621. acknowledgement from the other side), be sure to check for  transmitter  buffer
  1622. overflow (eg, SioPutc returns -1).
  1623.  
  1624.  
  1625.  
  1626.  
  1627.  
  1628.  
  1629.  
  1630.  
  1631.  
  1632. PCL4C Users Manual                                                  Page 24
  1633. 6.6 RS-232 Signals
  1634.  
  1635.  
  1636. RS-232 is the name of the  serial  data  interface  standard  used  to  connect
  1637. computers to modems.  Most IBM compatible computers are built with at least one
  1638. serial port and use either DB9 (9 pin) or DB25 (25 pin) connectors.
  1639.  
  1640. A  summary  of  these  pins  and  their  function  follows.   For more detailed
  1641. information, refer to one of the many books dealing with RS-232 interfacing.
  1642.  
  1643. Signal Ground Pin 7 (DB25), Pin 5 (DB9)
  1644.  
  1645. The SG line is used as the common signal ground, and must always be connected.
  1646.  
  1647. Transmit Data Pin 2 (DB25), Pin 3 (DB9)
  1648.  
  1649. The TX line is used to carry data from the computer to the modem.
  1650.  
  1651. Receive Data Pin 3 (DB25), Pin 2 (DB9)
  1652.  
  1653. The RX line is used to carry data from the modem to the computer.
  1654.  
  1655. Data Terminal Ready Pin 20 (DB25), Pin 4 (DB9)
  1656.  
  1657. The  DTR line is used by the computer to signal the modem that it is ready. DTR
  1658. should be set high when talking to a modem.
  1659.  
  1660. Data Set Ready Pin 6 (DB25), Pin 6 (DB9)
  1661.  
  1662. The DSR line is used by the modem to signal the computer that it is ready.
  1663.  
  1664. Request to Send Pin 4 (DB25), Pin 7 (DB9)
  1665.  
  1666. The RTS line is used to "turn the line around" in half duplex modems,  and  for
  1667. hardware flow control in most modems that require flow control.
  1668.  
  1669. Clear to Send Pin 5 (DB25), Pin 8 (DB9)
  1670.  
  1671. The  CTS  line is used to "turn the line around" in half duplex modems, and for
  1672. hardware flow control in most modems that require flow control.
  1673.  
  1674. Data Carrier Detect Pin 8 (DB25), Pin 1 (DB9)
  1675.  
  1676. The DCD line is used by the modem to signal the computer that  a  data  carrier
  1677. signal is present.
  1678.  
  1679. Ring Indicator Pin 22 (DB25), Pin 9 (DB9)
  1680.  
  1681. The RI line is asserted when a 'ring' occurs.
  1682.  
  1683.  
  1684.  
  1685.  
  1686.  
  1687.  
  1688.  
  1689.  
  1690.  
  1691.  
  1692.  
  1693.  
  1694.  
  1695.  
  1696.  
  1697.  
  1698.  
  1699.  
  1700. PCL4C Users Manual                                                  Page 25
  1701. 6.7 National INS8250, INS16450, and INS16550 UARTs
  1702.  
  1703.  
  1704. The Personal Communications Library is based on the standard National  INS8250,
  1705. INS16450,  and  INS16550  UARTs. The 8250 was the original UART used in the IBM
  1706. PC, whereas the 16450 is a faster version found on most 286 & up machines.  The
  1707. 16550 contains a 16 byte FIFO to further reduce communications overhead.  These
  1708. UARTs consists of 8 register ports as follows:
  1709.  
  1710.    Offset    R/W   Register
  1711.      0       R/W   Receiver (read) / Transmitter (write)
  1712.      1       R/W   Interrupt Enable (read)
  1713.      2       R     Interrupt Identification
  1714.      2       W     FIFO control (INS16550 only)
  1715.      3       R/W   Data Format (Line Control)
  1716.      4       R/W   RS-232 (Modem) Control
  1717.      5       R/W   Line Status
  1718.      6       R/W   RS-232 (Modem) Status
  1719.      7       R/W   Not used.
  1720.  
  1721. For the standard PC ports (not DigiBoard or BOCA ports), the UART registers are
  1722. based at 3F8h (COM1), 2F8h (COM2), 3E8h (COM3), and 2E8h (COM4).  COM1 and COM3
  1723. share  interrupt request line IRQ4 while COM2 and COM4 share request line IRQ3.
  1724. This means that COM1 and COM3 can't be used concurrently.  Similarly  for  COM2
  1725. and COM4.
  1726.  
  1727. If  you  have  a  DigiBoard  (or BOCA board) installed, you will have 4 or more
  1728. additional ports using INS16450 or INS16550 UARTS.  The default  DigiBoard  and
  1729. BOCA board ports are located at 100h, 108h, 110h, etc.  Refer to your DigiBoard
  1730. (or BOCA board) manual.
  1731.  
  1732. Four  sources  of interrupts are possible with the 8250 and 16550: (1) receiver
  1733. error or BREAK, (2) receiver data ready, (3) ready to transmit, and  (4)  RS232
  1734. input.  These four sources of interrupts are summarized as follows:
  1735.  
  1736. Source of Interrupt        Action Required to Clear
  1737. Receiver error or BREAK.   Read Line Status register.
  1738. Receiver data.             Read data from data register.
  1739. Transmitter Buffer Empty.  Write to data register or read IID reg.
  1740. RS232 input.               Read Modem Status register.
  1741.  
  1742. However,  PCL4C  only  enables  transmitter and receiver interrupts.
  1743.  
  1744. If  you  are  not  familiar with the INS8250, several good books are available.
  1745. Refer to the Serial Communications chapter  for  recommendations.   Although  a
  1746. knowledge of the 8250 is not necessary to use PCL4C, a general knowledge of the
  1747. theory of asynchronous serial communications is recommended.
  1748.  
  1749.  
  1750.  
  1751.  
  1752.  
  1753.  
  1754.  
  1755.  
  1756.  
  1757.  
  1758.  
  1759.  
  1760.  
  1761.  
  1762.  
  1763.  
  1764.  
  1765.  
  1766.  
  1767.  
  1768. PCL4C Users Manual                                                  Page 26
  1769. 6.8 Register Summary
  1770.  
  1771.  
  1772. REG 0 : Data Register
  1773.  
  1774. Reading  from  the data register fetches the next input byte, once it is ready.
  1775. Writing to the data register transmits the byte written to it over  the  serial
  1776. line.
  1777.  
  1778. REG 1 : Interrupt Enable 
  1779.  
  1780. The Interrupt Enable register enables each of four types of interrupts when the
  1781. appropriate bit is set to a one.
  1782.  
  1783. bit 3 : Enable interrupt on RS232 input.
  1784. bit 2 : Enable interrupt on receiver error or break.
  1785. bit 1 : Enable interrupt on transmitter buffer empty (TBE).
  1786. bit 0 : Enable interrupt on received data (RxRDY).
  1787.  
  1788. REG 2 : Interrupt Identification (IID)
  1789.  
  1790. Reading the Interrupt Identification (read only) register once an interrupt has
  1791. occurred identifies the interrupt as follows:
  1792.  
  1793. Bit 2  Bit 1  Bit 0  Priority    Interrupt
  1794.   0      0      1      none      none
  1795.   1      1      0      0 (high)  Serialization or break.
  1796.   1      0      0      1         Received data.
  1797.   0      1      0      2         Transmitter Buffer Empty.
  1798.   0      0      0      3 (low)   RS232 Input.
  1799.  
  1800. In the INS16650, REG 2 (write only) is also the FIFO control register.  Writing
  1801. bits  6 & 7 will set the FIFO trigger level (number of bytes received before an
  1802. interrupt is generated).
  1803.  
  1804. Bit 7  Bit 6   Trigger             Bit 7  Bit 6   Trigger
  1805.  0      0      1 byte               1      0      8 bytes
  1806.  0      1      4 bytes              1      1      14 bytes
  1807.  
  1808. REG 3 : Line Control
  1809.  
  1810. RS232 line parameters are selected by writing to this register.
  1811.  
  1812. bit 7    : DLAB = 0
  1813. bit 6    : BREAK on(1), off(0).
  1814. bits 5-3 : Parity None(000),ODD(001),EVEN(011),MARK(101),SPACE(111)
  1815. bit 2    : One stop bit(0), two stop bits(1).
  1816. bits 1-0 : Data bits = 5 (00), 6(01), 7(10), 8(11).
  1817.  
  1818. When the Divisor Latch Access Bit (DLAB) is 1, registers 0 and 1 become the  LS
  1819. and MS bytes of the Baud Rate Divisor registers.
  1820.  
  1821. Baud   Divisor      Baud  Divisor      Baud  Divisor
  1822.  300    0180        4800   0018       38400   0003
  1823. 1200    0060        9600   000C       57600   0002
  1824. 2400    0030       19200   0006      115200   0001
  1825.  
  1826.  
  1827.  
  1828.  
  1829.  
  1830.  
  1831.  
  1832.  
  1833.  
  1834.  
  1835.  
  1836. PCL4C Users Manual                                                  Page 27
  1837. REG 4 : Modem Control
  1838.  
  1839. RTS,  DTR,  loopback  testing,  and  General  Purpose  Outputs  #1  and  #2 are
  1840. controlled by the Modem Control register as follows:
  1841.  
  1842. bit 4 : Enable local loopback.
  1843. bit 3 : Enable GP02. Necessary for 8250 interrupts.
  1844. bit 2 : Enable GP01.
  1845. bit 1 : Set / clear RTS.
  1846. bit 0 : Set / clear DTR.
  1847.  
  1848. REG 5 : Line Status
  1849.  
  1850. Reading the Line Status register provides status information as follows (1  for
  1851. TRUE, 0 for FALSE) :
  1852.  
  1853. bit 6 : Transmitter Empty.
  1854. bit 5 : Transmitter Buffer Empty (TBE).
  1855. bit 4 : BREAK detect.
  1856. bit 3 : Framing error.
  1857. bit 2 : Parity error.
  1858. bit 1 : Overrun error.
  1859. bit 0 : Data Ready.
  1860.  
  1861. REG 6 : Modem Status
  1862.  
  1863. Reading  the Modem Status register provides the following status information (1
  1864. for TRUE, 0 for FALSE) :
  1865.  
  1866. bit 7 : DCD status.
  1867. bit 6 : RI status.
  1868. bit 5 : DSR status.
  1869. bit 4 : CTS status.
  1870. bit 3 : Delta DCD status.
  1871. bit 2 : Delta RI status.
  1872. bit 1 : Delta DSR status.
  1873. bit 0 : Delta CTS status.
  1874.  
  1875. The delta bits (bits 0 through 3) are set whenever one of the status bits (bits
  1876. 4 through 7) changes (from 0 to 1 or from 1 to 0) since the last time that  the
  1877. Modem  Status  register  was  read. Reading the Modem Status register clear the
  1878. delta bits.
  1879.  
  1880. REG 7 : Scratch Register
  1881.  
  1882. There is no function associated with register 7.  It does not  exist  in  early
  1883. versions of the 8250.
  1884.  
  1885.  
  1886.  
  1887.  
  1888.  
  1889.  
  1890.  
  1891.  
  1892.  
  1893.  
  1894.  
  1895.  
  1896.  
  1897.  
  1898.  
  1899.  
  1900.  
  1901.  
  1902.  
  1903.  
  1904. PCL4C Users Manual                                                  Page 28
  1905. 7.0 Example Programs
  1906.  
  1907. Six  example  programs  are  include  with  PCL4C.   In  addition, the Personal
  1908. Protocol Library for  C  (PPL4C)  includes  the  terminal  program  TERM  which
  1909. features ASCII, XMODEM, YMODEM, and ZMODEM protocol transfers.  Complete source
  1910. code is included in the shareware product for all of the protocols above except
  1911. ZMODEM.  In order to get ZMODEM source, PPL4C must be registered.
  1912.  
  1913. 7.1 MINIMAL
  1914.  
  1915. MINIMAL is the simpliest possible communications program. It  displays  on  the
  1916. screen  what  it  reads from the serial port and transmits over the serial line
  1917. what is typed at  the  keyboard.   COM1  and  9600  baud  are  hard  coded  for
  1918. simplicity.
  1919.  
  1920. 7.2 SIMPLE
  1921.  
  1922. SIMPLE is a simple terminal program. It operates like MINIMAL, except that both
  1923. a port and a baud rate can be specified. For example.
  1924.  
  1925.        SIMPLE 1 9600
  1926.  
  1927. 7.3 LOGIN
  1928.  
  1929. LOGIN is programmed to dial our support BBS (205-880-9748) and log on as GUEST.
  1930. Start LOGIN like SIMPLE by providing a COM port and a baud rate. For example,
  1931.  
  1932.       LOGIN 1 38400
  1933.  
  1934. 7.4 SPAWN and DOOR
  1935.  
  1936.  
  1937. The SPAWN program is the same as the SIMPLE program except that it spawns  DOOR
  1938. when the user types a '$'. For example, to start SPAWN on COM3, type
  1939.  
  1940.       SPAWN 3
  1941.  
  1942. The  DOOR  program  is also the same as SIMPLE except that it can "take over" a
  1943. serial port without changing any of the port parameter. Exiting DOOR returns to
  1944. the invoking program (SPAWN).
  1945.  
  1946. 7.5 SELFTEST
  1947.  
  1948. The SELFTEST.C program is designed to test serial ports provided that two ports
  1949. are avaiable which can be connected together with a null modem cable.  SELFTEST
  1950. can also be used to test your multiport board.
  1951.  
  1952. For example, to test PC port COM1 against COM2, type:
  1953.  
  1954.       SELFTEST PC 1 2
  1955.  
  1956. SELFTEST may need to be configured for non-standard PC ports or your  multiport
  1957. board. Refer to the SELFTEST source code for more information.
  1958.  
  1959.  
  1960.  
  1961.  
  1962.  
  1963.  
  1964.  
  1965.  
  1966.  
  1967.  
  1968.  
  1969.  
  1970.  
  1971.  
  1972. PCL4C Users Manual                                                  Page 29
  1973. 8.0 Legal Issues
  1974.  
  1975. 8.1 Registration
  1976.  
  1977.  
  1978. If  you  wish  to  register the PCL4C library, please send $75 plus $5 S&H ($10
  1979. outside of North America) to:
  1980.  
  1981.             MarshallSoft Computing, Inc.
  1982.             Post Office Box  4543
  1983.             Huntsville AL 35815
  1984.  
  1985. Multiple copies are available: $55 for 3 to 9, $45 for 10 to 19, and $35 for 20
  1986. or more. A site license is also available for $675 (includes 20 sets of printed
  1987. documentation). We pay shipping.
  1988.  
  1989. We  accept  American  Express, MasterCard, and VISA (account number, expiration
  1990. date, exact name on your card, and complete  card  billing  address  required),
  1991. checks  in US dollars drawn on a US bank, purchase orders (POs) from recognized
  1992. US schools and companies listed in Dun & Bradstreet, and  COD  (street  address
  1993. and phone number required) within the USA (plus an additional $3 COD charge).
  1994.  
  1995. You  can  also  order  PCL4C  from The Public Software Library (PSL) in Houston
  1996. Texas with your American Express, MasterCard, VISA, or Discover card by calling
  1997. 800-242-4PSL (from overseas: 713-524-6394) or by  FAX  at  713-524-6398  or  by
  1998. CompuServe  at  [71355,470].   THESE NUMBERS ARE FOR ORDERING ONLY. The product
  1999. number for PCL4C is 10908. Please have your credit card billing address ready.
  2000.  
  2001. If you wish to update from an older version of PCL4C, send $20 plus $5 S&H ($10
  2002. outside  of North America).  Updates must be ordered directly from MarshallSoft
  2003. Computing.
  2004.  
  2005. The registered package includes:
  2006.  
  2007. o  Small,Compact,Medium,Large & PM libs w/o shareware screens.
  2008. o  Assembler source code for the library.
  2009. o  Laser printed Users and Reference Manuals.
  2010. o  Telephone, FAX, and BBS support for one year.
  2011.  
  2012. Print the file INVOICE.DOC if an invoice is needed. The  registered  user  will
  2013. receive  the  latest  version of PCL4C shipped by two day priority mail (packet
  2014. airmail overseas).  A 3.5" diskette is provided  unless  a  5.25"  diskette  is
  2015. requested.
  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. PCL4C Users Manual                                                  Page 30
  2041. 8.2 License
  2042.  
  2043.  
  2044. MarshallSoft  Computing,  Inc. grants the registered user of PCL4C the right to
  2045. use one copy of the PCL4C library (in object form) on a single computer in  the
  2046. development  of any software product (other than libraries such as PCL4C).  The
  2047. user may not use the library on more than one computer at the same  time.   The
  2048. source  code  for  the  library  (PCL4C.ASM)  is  copyrighted  by  MarshallSoft
  2049. Computing and may not be released in whole or in part.
  2050.  
  2051. Products developed using PCL4C can include the object form of the  library  and
  2052. may be distributed without any royalty.
  2053.  
  2054.  
  2055. 8.3 Warranty
  2056.  
  2057.  
  2058. MARSHALLSOFT  COMPUTING,  INC.   DISCLAIMS  ALL  WARRANTIES  RELATING  TO  THIS
  2059. SOFTWARE, WHETHER EXPRESSED OR  IMPLIED,  INCLUDING  BUT  NOT  LIMITED  TO  ANY
  2060. IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, AND
  2061. ALL   SUCH  WARRANTIES  ARE  EXPRESSLY  AND  SPECIFICALLY  DISCLAIMED.  NEITHER
  2062. MARSHALLSOFT COMPUTING, INC. NOR ANYONE ELSE  WHO  HAS  BEEN  INVOLVED  IN  THE
  2063. CREATION,  PRODUCTION,  OR  DELIVERY  OF  THIS SOFTWARE SHALL BE LIABLE FOR ANY
  2064. INDIRECT, CONSEQUENTIAL, OR INCIDENTAL  DAMAGES  ARISING  OUT  OF  THE  USE  OR
  2065. INABILITY  TO  USE SUCH SOFTWARE EVEN IF MARSHALLSOFT COMPUTING, INC.  HAS BEEN
  2066. ADVISED OF THE POSSIBILITY OF  SUCH  DAMAGES  OR  CLAIMS.  IN  NO  EVENT  SHALL
  2067. MARSHALLSOFT  COMPUTING,  INC.'S LIABILITY FOR ANY SUCH DAMAGES EVER EXCEED THE
  2068. PRICE PAID FOR THE LICENSE TO USE THE SOFTWARE, REGARDLESS OF THE FORM  OF  THE
  2069. CLAIM.  THE  PERSON  USING  THE  SOFTWARE  BEARS ALL RISK AS TO THE QUALITY AND
  2070. PERFORMANCE OF THE SOFTWARE.
  2071.  
  2072. Some states  do  not  allow  the  exclusion  of  the  limit  of  liability  for
  2073. consequential  or  incidental damages, so the above limitation may not apply to
  2074. you.
  2075.  
  2076. This agreement shall be governed by the laws of the State of Alabama and  shall
  2077. inure  to  the  benefit  of  Marshallsoft  Computing, Inc.  and any successors,
  2078. administrators, heirs and assigns.  Any action or proceeding brought by  either
  2079. party  against  the  other arising out of or related to this agreement shall be
  2080. brought only in a STATE or FEDERAL COURT of competent jurisdiction  located  in
  2081. Madison County, Alabama. The parties hereby consent to in personam jurisdiction
  2082. of said courts.
  2083.  
  2084.  
  2085.  
  2086.  
  2087.  
  2088.  
  2089.  
  2090.  
  2091.  
  2092.  
  2093.  
  2094.  
  2095.  
  2096.  
  2097.  
  2098.  
  2099.  
  2100.  
  2101.  
  2102.  
  2103.  
  2104.  
  2105.  
  2106.  
  2107.  
  2108. PCL4C Users Manual                                                  Page 31
  2109. 9.0 Summary
  2110.  
  2111.  
  2112. 9.1 Revision History
  2113.  
  2114.  
  2115. Version 1.0 - 14 January 1991 - original release.
  2116.  
  2117. Version 1.1 - 11 March 1991
  2118.  
  2119. o  Added SioUnGetc function to library.
  2120.  
  2121. Version 1.2 - 1 June 1991
  2122.  
  2123. o  SioParms bug - could not call before SioReset.
  2124. o  SioReset bug - was not saving & restoring all regs.
  2125.  
  2126. Version 1.3 - 1 July 1991
  2127.  
  2128. o  Added NORESET option to SioReset.
  2129. o  Added SioDSR, SioCTS, SioDCD, SioLoopBack, and SioRI.
  2130.  
  2131. Version 2.0 - 1 Nov 1991
  2132.  
  2133. o  Reorganized as four memory model libraries.
  2134. o  Added SioModel function to library.
  2135. o  Added support for Quick C and Power C.
  2136.  
  2137. Version 2.1 - 1 Dec 1991
  2138.  
  2139. o  Fixed bug due to Microsoft Assembler (MASM 5.0,5.1) error.
  2140.  
  2141. NOTE:  MarshallSoft incorporated as "MarshallSoft Computing, Inc."
  2142. on December 23rd, 1991.
  2143.  
  2144. Version 3.0 - 15 Jan 1992
  2145.  
  2146. o  Added SioUART function.
  2147. o  Added "UART undefined" error code.
  2148. o  Added "Bad or missing UART" error code.
  2149. o  Added "Port already enabled" error code.
  2150. o  Added "Cannot enable both COM1 & COM3 ..." error code.
  2151. o  Fixed several minor bugs (using new automated testing).
  2152.  
  2153. Version 3.1 - 1 March 1992
  2154.  
  2155. o  Added SioFIFO (INS16550 support).
  2156. o  Added SioIRQ function.
  2157. o  Increased maximum receive buffer size to 32K bytes.
  2158.  
  2159. Version 3.2 - 1 May 1992
  2160.  
  2161. o  Modified SioReset so that it no longer clears DTR & RTS.
  2162. o  Modified SioModel & renamed to SioInfo.
  2163. o  Fixed bug in SioDone when using 2 ports simultaneously.
  2164. o  Added SioFlow to library.
  2165. o  Added YMODEM-G protocol to TERM program.
  2166.  
  2167.  
  2168.  
  2169.  
  2170.  
  2171.  
  2172.  
  2173.  
  2174.  
  2175.  
  2176. PCL4C Users Manual                                                  Page 32
  2177. 9.1 Revision History (continued)
  2178.  
  2179. Version 3.3 - 3 August 1992
  2180.  
  2181. o  Fixed bug in SioUnGet when using 2 ports simultaneously.
  2182. o  Add SioRead function.
  2183.  
  2184. Version 3.4 - 4 Jan 1993
  2185.  
  2186. o  Library modified to use up to four ports simultaneously.
  2187. o  SioIRQ was modified to include a third argument.
  2188. o  EXAMPORT utility distributed to registered users.
  2189.  
  2190. Version 3.5 - 15 May 1993
  2191.  
  2192. o  Supports dumb DigiBoards ( PC/4 and PC/8).
  2193. o  Two new error traps added ("No such IRQ" & "No such ISR").
  2194. o  ASCII file transfer protocol added to TERM (with XON/XOFF).
  2195.  
  2196. Version 4.0 - 18 Oct 1993
  2197.  
  2198. o  The library supports transmitter interrupts.
  2199. o  Corrects bug in Ver 3.5 requiring calling SioIRQ for COM3/4.
  2200. o  All example code compiles with supported C++ compilers.
  2201. o  The SioIRQ function has been simplified.
  2202.  
  2203. Version 4.1 - 1 May 1994
  2204.  
  2205. o  Transmitter FIFO enabled.
  2206. o  Minor internal modifications.
  2207. o  Supports dumb BOCA boards (BB1004, BB1008, & BB2016).
  2208. o  Port definition extented to COM16.
  2209.  
  2210. Version 4.2 - 1 Sept 1994
  2211.  
  2212. o  A flow control bug was fixed.
  2213. o  SioGetDiv function added.
  2214. o  SioRxBuf & SioTxBuf function modified.
  2215.  
  2216. Version 4.3 - 15 March 1995
  2217.  
  2218. o  BREAK detection bug fixed,
  2219. o  Port definitions extended to COM20.
  2220. o  Support for IRQ8 through IRQ15.
  2221. o  Line status bits preserved.
  2222.  
  2223. (The TERM program moved to PPL4C)
  2224.  
  2225. Version 5.0 - 20 November 1995
  2226.  
  2227. o  Supports Protected Mode
  2228. o  Renamed SioRxFlush to SioRxClear.
  2229. o  Renamed SioTxFlush to SioTxClear.
  2230. o  Added SioTxFlush
  2231. o  Added more choices in SioInfo.
  2232. o  Removed SioCrtWrite (use putch instead).
  2233. o  Removed SioKeyPress (use kbhit instead).
  2234. o  Removed SioKeyRead  (use getch instead).
  2235. o  Added SioGets.
  2236. o  Added SioPuts.
  2237.  
  2238.  
  2239.  
  2240.  
  2241.  
  2242.  
  2243.  
  2244. PCL4C Users Manual                                                  Page 33
  2245. 9.2 Function Summary
  2246.  
  2247.  
  2248. Refer to the PCL4C Reference Manual (PCL4C.REF) for detailed information on the
  2249. communications  and  support  functions.   A  one line summary of each function
  2250. follows:
  2251.  
  2252.  
  2253. SioBaud     Sets the baud rate of the selected port.
  2254. SioBrkKey   Returns non-zero if the Control-BREAK key was pressed.
  2255. SioBrkSig   Asserts, cancels, or detects BREAK signal.
  2256. SioCTS      Reads the Clear to Send (CTS) modem status bit.
  2257. SioDCD      Reads the Data Carrier Detect (DCD) modem status bit.
  2258. SioDelay    Delays one or more tics (18 tics per second).
  2259. SioDone     Terminates further serial processing.
  2260. SioDSR      Reads the Data Set Ready (DSR) modem status bit.
  2261. SioDTR      Set, clear, or read the Data Terminal Ready (DTR) bit.
  2262. SioError    Displays error in text.
  2263. SioFIFO     Sets the interrupt level for the INS16550.
  2264. SioFlow     Enables / disables hardware flow control.
  2265. SioGetc     Reads the next character from the serial line.
  2266. SioGets     Reads a buffer of characters from the serial line.
  2267. SioGetDiv   Reads the baud rate divisor registers.
  2268. SioInfo     Returns library information (version number, etc.)
  2269. SioIRQ      Assigns an IRQ line to a port.
  2270. SioLine     Reads the line status register.
  2271. SioLoopBack Performs a UART loopback test.
  2272. SioModem    Reads the modem status register.
  2273. SioParms    Sets parity, stop bits, and word length.
  2274. SioPorts    Sets # ports, 1st DigiBoard / BOCA port & status reg.
  2275. SioPutc     Transmits a character over a serial line.
  2276. SioPuts     Transmits a buffer of characters over a serial line.
  2277. SioRead     Reads any of 7 UART ports.
  2278. SioReset    Initialize a serial port for processing.
  2279. SioRI       Reads the Ring Indicator (RI) modem status bit.
  2280. SioRTS      Sets, clears, or reads the Request to Send (RTS) line.
  2281. SioRxClear  Clears the receive buffer.
  2282. SioRxBuf    Sets up receive buffer.
  2283. SioRxQue    Returns the number of characters in the receive queue.
  2284. SioTimer    Returns the number of system clock tics.
  2285. SioTxBuf    Sets up transmit buffer.
  2286. SioTxClear  Clears the transmit buffer.
  2287. SioTxFlush  Restarts transmitter interrupts thus flushing the TX queue.
  2288. SioTxQue    Returns the number of characters in the transmit queue.
  2289. SioUART     Sets the UART base address.
  2290. SioUnGetc   "Un-gets" (puts back) a specified character.
  2291.  
  2292.  
  2293. 9.3 Further Reading
  2294.  
  2295.  
  2296. The best way to learn about serial communications is to read a good book on the
  2297. subject. Several good texts are available.  Two that I like are:
  2298.  
  2299. (1) C Programmers's Guide to Serial Communications by Joe Campbell  (SAMS)
  2300.  
  2301. (2) Mastering Serial Communications by Peter Gofton (SYBEX).
  2302.  
  2303.  
  2304.  
  2305.  
  2306.  
  2307.  
  2308.  
  2309.  
  2310.  
  2311.  
  2312. PCL4C Users Manual                                                  Page 34
  2313. 10.0 Other MarshallSoft Computing Products
  2314.  
  2315.  
  2316. 10.1 The Personal Protocol Library for C/C++
  2317.  
  2318.  
  2319. The Personal Protocol Library for  C  (PPL4C)  consists  of  a  C/C++  language
  2320. library  which  implements  XMODEM,  XMODEM-CRC,  XMODEM-1K,  XMODEM-G, YMODEM,
  2321. YMODEM-G,  and  ZMODEM  file  transfer  protocols.   A  script   compiler   and
  2322. interpreter  is  also  included which is capable of such tasks as automatically
  2323. logging onto a BBS and downloading a file or  retrieving  mail.  Three  example
  2324. script programs are included.
  2325.  
  2326. The protocol library (PPL4C) requires the Personal Communications Library for C
  2327. (PCL4C).
  2328.  
  2329. The  Personal  Protocol  Library for C is available for $40 plus $3 S&H ($6 S&H
  2330. overseas).
  2331.  
  2332.  
  2333. 10.2 The EMS Expanded Memory Library
  2334.  
  2335.  
  2336. The EMS4C library implements version 3.2  of  the  LIM  (Lotus-Intel-Microsoft)
  2337. specification  for  expanded memory. It will run with either version 3.2 or 4.0
  2338. of the LIM specification.
  2339.  
  2340. The EMM4C library (included with the  EMS4C  library)  is  an  expanded  memory
  2341. manager  which  allows C programmers to allocate and free EMS (expanded) memory
  2342. similiar to malloc and free in the standard C runtime library.  Both  EMM4C
  2343. and  EMS4C  require  that your system be configured with expanded (EMS) memory.
  2344. But, 386 & up systems can use extended memory as expanded memory.
  2345.  
  2346. The EMS Expanded Memory Library for C is available for $35 plus $3 S&H ($6  S&H
  2347. overseas).
  2348.  
  2349.  
  2350.  
  2351.  
  2352.  
  2353.  
  2354.  
  2355.  
  2356.  
  2357.  
  2358.  
  2359.  
  2360.  
  2361.  
  2362.  
  2363.  
  2364.  
  2365.  
  2366.  
  2367.  
  2368.  
  2369.  
  2370.  
  2371.  
  2372.  
  2373.  
  2374.  
  2375.  
  2376.  
  2377.  
  2378.  
  2379.  
  2380. PCL4C Users Manual                                                  Page 35
  2381.