home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / walnut-creek-CDROM / CPM / BDSC / BDSC-3 / V150-2.DQC / V150-2.DOC
Text File  |  2000-06-30  |  15KB  |  397 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.                                         
  14.                            New Features of BDS C v1.5:
  15.                     A Summary for Users of Pre-1.50 Versions
  16.  
  17.                                    Leor Zolman
  18.                                    BD Software
  19.                                    P.O. Box 9
  20.                          Brighton, Massachusetts, 02135
  21.                                  (617) 782-0836
  22.                                         
  23.  
  24.  
  25.          WARNING! Version 1.5 of the  BDS  C Compiler will not work under
  26.        pre-2.x versions of the CP/M  operating  system.  In order to take
  27.        full  advantage  of  CP/M 2.x I/O mechanisms  without  introducing
  28.        really  painful  configuration  complications, compatibility  with
  29.        CP/M  1.4 (or earlier versions) has been  sacrificed.   Users  who
  30.        cannot upgrade their  CP/M's to version 2.x must go on using v1.46
  31.        of the compiler.  Sorry about that.) 
  32.  
  33.  
  34.  
  35.  
  36.              You Can Now Get BDS C From Vendors Other Than Lifeboat
  37.  
  38.  
  39.     So  far,  the  only  definite alternative distributor is the BDS C  User's
  40.   Group.  I  am  at  a  very  flexible position  right  now  regarding  dealer
  41.   distribution    arrangements,   and   welcome   inquiries   from   potential
  42.   distributors.  I'm not going to go running  to  every outfit that advertises
  43.   in BYTE and beg them to sell the compiler, simply because  I'm  not sure how
  44.   much  of  a hassle I'd be signing up for by that behavior.  Rather, I'd like
  45.   to see small-scale hacker types involved in  distribution, so that end-users
  46.   can  have a prayer of receiving INTELLIGENT customer service.  Gads, anytime
  47.   I get  to  rambling  about  something interesting I begin to wonder if it is
  48.   bordering on a commercialistic exploitation of the ARPA net!????  To play it
  49.   safe: if anyone reading this paragraph objects  to the content, feel free to
  50.   delete it from this file. 
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                       - 1 -                                   
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.  
  75.  
  76.  
  77.                             New Command Line Options
  78.  
  79.  
  80.     CLINK now takes a new  option,  -n, which causes the resulting COM file to
  81.   not  perform  a  warm-boot  after  it  is finished executing.   This  option
  82.   performs the function that v1.46's  NOBOOT.C  program  had been doing.  Note
  83.   that when -n is used,  there  is approximately 2K less user memory available
  84.   because the CCP is not overwritten. 
  85.  
  86.     CC (formerly named  CC1) now takes the option -k, to activate the Kirkland
  87.   debugger  mechanism.  This  causes  a  special  symbol  table  file  (having
  88.   extension .CDB) to be written  to  disk, and causes the compiler to generate
  89.   special restart instructions at the  start  of  every  statement to interact
  90.   with David Kirkland's C debugger package.  The  debugger may not be included
  91.   on the distribution disk for  space limitation reasons, but is available for
  92.   nominal cost-of-media cost from the  BDS  C User's Group or from BD Software
  93.   (on 8" disk) via special arrangement. 
  94.  
  95.  
  96.  
  97.  
  98.                       Functional Changes to Major Commands
  99.  
  100.  
  101.     CLINK now automatically loads all functions, by  default,  from  each  CRL
  102.   given on the command line in a  linkage.   The  -f option is now reversed in
  103.   sense from previous versions, and operates  exactly  the  same  as  L2's  -l
  104.   option...i.e.,  -f  appearing on a CLINK command line causes all  CRL  files
  105.   named after it  to  be  scanned instead of loaded, while all CRL files named
  106.   before the  -f  flag  are  loaded.  This makes the general format of a CLINK
  107.   command line be:
  108.  
  109.           A>clink <main file> [<other files in prog>] [-f <lib files>] <cr>
  110.  
  111.   Other options may be interspersed in the command line, of course. 
  112.  
  113.  
  114.  
  115.  
  116.                          New Low-Level File I/O Features
  117.  
  118.  
  119.     -   All the low-level file I/O now uses the CP/M 2.2x  random-record  read
  120.        and  write  calls.  Therefore, files may be up to 8 megabytes in length
  121.        instead of only up to 256K bytes. 
  122.  
  123.     -  The "seek" function may be given an origin  code  of 2, meaning to seek
  124.        relative to the end of the file.  Note that the offset must be negative
  125.        in this case to make sense, since it is always added to the base, which
  126.  
  127.  
  128.  
  129.                                       - 2 -                                   
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139.        in this case is the end of the file.  For example, the  following  call
  140.        seeks to the next-to-last sector in the file:
  141.  
  142.                seek(fd, -2, 2);        /* seek to 2nd sector from end of file */
  143.  
  144.     -  User number prefixes are now accepted wherever a filename  argument  is
  145.        called for.  Such  a  prefix consists of a decimal number between 0 and
  146.        31, followed immediately by a slash (/) character and then the filename
  147.        (with or without an optional  disk  designator).   This causes the file
  148.        I/O mechanism to switch into the user area associated  with  each  file
  149.        for the duration  of any I/O operation involving that file, then switch
  150.        back  to  the current user area when done.  Any filename may  now  take
  151.        either an explicit disk designator, an explicit user area, or both.  If
  152.        both are given, then the  user area specification must precede the disk
  153.        designator.  Here is an example:
  154.  
  155.                if (open("0/A:DATABASE.DAT",2) == ERROR)
  156.                        exit(puts("Can't open the database, turkey. \n"));
  157.  
  158.        Note  that  this allows programs in separate user areas to manipulate a
  159.        common  data  file  kept  on  one  particular   drive  and  user  area,
  160.        eliminating the need to have a separate copy of the data file  in  each
  161.        user area  needing it.  If you are running the "ZCPR" public-domain CCP
  162.        replacement program for CP/M, or any shell  (such as "MicroShell") that
  163.        searches  special  drives  and  user areas for command files, then that
  164.        feature  combined  with the user-area  enhancements  to  the  file  I/O
  165.        library allow a very efficient utilization of the CP/M filesystem. 
  166.  
  167.     -  There are some new  functions  that  provide better diagnosis of errors
  168.        caused by low-level file I/O calls.  Whenever a call such as open, read
  169.        or  write  returns  a  value  of  -1 (ERROR), the errno function may be
  170.        called to return  a  more  detailed  error  description code explaining
  171.        exactly  what  went wrong.  The errmsg function may be used to return a
  172.        pointer to a string corresponding to the error value returned by errno.
  173.        A typical usage of these functions is as follows:
  174.  
  175.                i = read(fd, buffer, 20);       /* try to read 20 sectors */
  176.                if (i == ERROR) {               /* if an error occurred...*/
  177.                        printf("\n%s -- ABORTING THIS PROGRAM.",
  178.                                        errmsg(errno));
  179.                        exit();
  180.                }
  181.  
  182.  
  183.  
  184.  
  185.                      New Library File Searching Capabilities
  186.  
  187.  
  188.     Both the compiler and linker (CC and CLINK) now have the ability to search
  189.   for  library files in a default CP/M  drive  and  user  area,  sometimes  in
  190.   addition  to  the  currently-logged  drive  and  user  area.   If  the  user
  191.   configures CC and  CLINK  as  described  in the configuration section below,
  192.  
  193.  
  194.  
  195.                                       - 3 -                                   
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205.   then CC will know to search a default directory for included  files named in
  206.   angle  brackets,  and  CLINK  will  know to search a default  directory  for
  207.   library  files.   Also, if a CRL file is named on the CLINK command line and
  208.   CLINK cannot find that file in  the  current  drive  and user area, then the
  209.   default area (as configured) will be searched for that file. 
  210.  
  211.     CLINK now accepts user area prefixes on CRL filenames given on the command
  212.   line  (except  for  the  main  CRL file, which must be in the  current  user
  213.   area.)  If an explicit disk drive and/or user area specification is given on
  214.   the  CRL  filename  to  CLINK,  then the default area will not  be  searched
  215.   automatically.  This is so that if an  explicit user area is given for a new
  216.   test  version  of a CRL file, and a similarly named CRL file exists  in  the
  217.   default library area, then the one in the default area will not be  used  if
  218.   the explicitly named one is not found. 
  219.  
  220.  
  221.  
  222.  
  223.                                   Configuration
  224.  
  225.  
  226.     BDS  C  commands should simply come up  running  under  any  CP/M  system,
  227.   without  any  special  configuration procedure necessary.  There are several
  228.   optional  features  of the compiler and linker that may be configured by the
  229.   user to increase the flexibility  of  the package.  This subsection explains
  230.   each of those options and how to select them. 
  231.  
  232.  
  233.  
  234.  
  235.   If Running MPM II:
  236.  
  237.  
  238.     If you are running BDS C under  MP/M II, you must re-assemble the run-time
  239.   package  with  the  "MPM2" symbol equated to 1 (it comes configured  to  0).
  240.   Simply edit the CCC.ASM file,  assemble  it  using  ASM,  use LOAD to create
  241.   CCC.COM, then rename that to C.CCC.
  242.  
  243.  
  244.  
  245.  
  246.   CC and CLINK configuration
  247.  
  248.  
  249.     There  are  several  user-configurable  features in CC.COM  and  CLINK.COM
  250.   controlled by a specific bytes of memory very close to the beginning of each
  251.   command  file.  In order to change these features, use DDT or  SID  to  read
  252.   CC.COM  or CLINK.COM into memory (noting the length of the file printed upon
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.                                       - 4 -                                   
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271.  
  272.   successful loading 1),  make the changes using the s command, hit control-C,
  273.   and  use the CP/M SAVE command to write the modified command back to  disk. 
  274.   Make sure to have your master distribution disk safely tucked away somewhere
  275.   before attempting these modifications! 
  276.  
  277.     Both  CC.COM  and  CLINK.COM  contain  an identically structured four-byte
  278.   configuration block.  The base address of the block for CC.COM is 0155h, and
  279.   for CLINK it is 0103h. The contents of the block are as follows:
  280.  
  281.           Addr.   Function                                Default value
  282.  
  283.           base+0  Default library disk                      FF  (current)
  284.  
  285.           base+1  Default library user area                 FF  (current)
  286.  
  287.           base+2  Disk where SUBMIT files are processed     00  (disk A)
  288.  
  289.           base+3  Poll console for interrupts (0 or 1)      01  (enabled)
  290.  
  291.     Note that each item in the block is exactly one byte in length.  The first
  292.   two items specify a default disk and user area  to  be treated as a "library
  293.   directory" by CC and CLINK. For CC, the library directory specifies where to
  294.   find the files named in #include directives when the filename is enclosed in
  295.  
  296.   angle  brackets  2,  and also where to find CC2.COM for the second phase  of
  297.   compilation.   For  CLINK,  this  says  where  to  find  the files DEFF.CRL,
  298.   DEFF2.CRL, DEFF3.CRL (if present) and C.CCC.
  299.  
  300.     For the  default library disk, a value of 0 specifies drive A, 1 specifies
  301.   drive  B,  etc.,  and  a  value  of  FFh  (255 decimal) specifies  that  the
  302.   currently-logged  disk is to be used as the default library disk.   For  the
  303.   default  library  user  area,  the values 0-15 denote the corresponding user
  304.   area, and  a value of FFh (255 decimal) specifies that the current user area
  305.   is to be the default library user area.  Both the library disk and user area
  306.   come configured to FFh; thus, the distribution version of the v1.50 compiler
  307.   and linker behave the same as earlier versions, in  which  the current drive
  308.   and user area were always assumed to contain the library files by default. 
  309.  
  310.  
  311.  
  312.   ----------
  313.  
  314.   1. To convert the hex address printed  by DDT or SID for the last address of
  315.   the  file into the decimal number you must give to the SAVE command, use the
  316.   following algorithm: take the leftmost  two  hex  digits,  and compute their
  317.   decimal equivalent (e.g.,  3C80  yields  3C,  which  is  60 decimal).  Then,
  318.   subtract 1 from that if the rightmost two digits are 00. The final result is
  319.   the number to give SAVE.
  320.  
  321.   2.  Filenames  enclosed in double quotes always cause the #include directive
  322.   to   search  the  current  directory  for  the  named  file,  regardless  of
  323.   configuration
  324.  
  325.  
  326.  
  327.                                       - 5 -                                   
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  
  335.  
  336.  
  337.     The third location designates which CP/M drive contains the  $$$.SUB  file
  338.   that exists during  "Submit  File"  processing.  CLINK always tries to erase
  339.   pending submit files when an error occurs, while CC only tries to do so when
  340.   the -x option is given.  Since most systems always place the $$$.SUB file on
  341.   drive  A,  that is the way CC and CLINK come configured by default.  But, if
  342.   the user  has  customized  his system to put the $$$.SUB file on the current
  343.   drive  instead of always on A:, then the byte pointed to by the  address  in
  344.   these locations should be changed from 01 to 00.
  345.  
  346.     The  fourth and final location in the configuration block is a simple flag
  347.   telling CC or CLINK whether or not  the  system console should be polled for
  348.   the  interrupt  character  (^C) during execution of the command.  If enabled
  349.   (non-zero), then any input typed on the console by the user during execution
  350.   of the command will be ignored unless ^C is typed, in which case the command
  351.   will be immediately aborted  and  control  will return to command level.  If
  352.   disabled  (zero), then the console will never be polled.  This is useful for
  353.   certain interrupt driven systems that  need  to recognize type-ahead and can
  354.   handle  interruption  on  their  own  without  needing  to be polled by  the
  355.   currently executing transient command. 
  356.  
  357.     This configuration scheme allows  users  with large-capacity disks to pick
  358.   some particular drive and user area in which to keep all standard header and
  359.   library  files.  The library disk and user area bytes should  be  considered
  360.   together as a unit; if you change one,  you'll  probably  want to change the
  361.   other also. 
  362.  
  363.     Note that CC2.COM does not need to be configured; CC.COM passes it all the
  364.   relevant information upon transfer of control. 
  365.  
  366.  
  367.  
  368.  
  369.  
  370.  
  371.  
  372.  
  373.  
  374.  
  375.  
  376.  
  377.  
  378.  
  379.  
  380.  
  381.  
  382.  
  383.  
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393.                                       - 6 -                                   
  394.  
  395.  
  396.  
  397.