home *** CD-ROM | disk | FTP | other *** search
/ Collection of Hack-Phreak Scene Programs / cleanhpvac.zip / cleanhpvac / FAQSYS18.ZIP / FAQS.DAT / COMP2805.94 < prev    next >
Text File  |  1996-08-02  |  136KB  |  2,902 lines

  1. msdos-programmer-faq/faq
  2. Comp-os-msdos-programmer-archive-name: dos-faq
  3. Posting-frequency: monthly
  4. Last-modified: 28 May 1994
  5.  
  6. Copyright (C) 1994  Stan Brown, Oak Road Systems.  All rights reserved.
  7. This article is not in the public domain, but it may be redistributed so
  8. long as this notice, the acknowledgments, and the information on
  9. obtaining the latest copy of this list are retained and no fee is
  10. charged.  The code fragments may be used freely; credit would be polite.
  11.  
  12.     Special note:  Maintenance on this file is minimal because I have
  13.     limited time (and, lately, limited interest) in this area.  Someone
  14.     with a more active interest in DOS programming could do the net a
  15.     great service by taking over this list; send me email if interested.
  16.  
  17.  
  18. Subject:  Table of Contents
  19.  
  20. section 0. Introduction to this article
  21.         001. What is this article? (rev: 19 Apr 1994)
  22.     002. Why is this article? (rev: 20 Mar 1994)
  23.     003. How can I search this article for a particular topic? (rev: 20
  24.          Mar 1994)
  25.     004. Who has contributed to this article?
  26.     005. Are the answers guaranteed correct and complete? (rev: 20 Mar
  27.          1994)
  28. section 1. General questions
  29.     101. Why won't my code work?
  30.     102. What is this newsgroup about? (rev: 11 Sep 1993)
  31.     103. Is comp.os.msdos.programmer just for C programmers? (rev: 20
  32.          Mar 1994)
  33.     104. What's the difference from comp.sys.ibm.pc.programmer?
  34.     105. Is comp.os.msdos.programmer available as a mailing list? (new:
  35.          2 Feb 1993)
  36.     106. What's this "netiquette"? (rev: 20 Mar 1994)
  37.     107. How can I learn more about Usenet? (new: 7 Aug 1993)
  38.     108. What other technical newsgroups should I know about? (rev: 6
  39.                  Apr 1994)
  40. section 2. Compile and link
  41.     201. What the heck is "DGROUP > 64K"? (rev: 18 Apr 1993)
  42.     202. How do I fix "automatic data segment exceeds 64K" or "stack
  43.          plus data exceed 64K"?
  44.     203. Will Borland C code and Microsoft C code link together? (rev:
  45.          15 Aug 1993)
  46.     204. Why did my program bomb at run time with "floating point
  47.          formats not linked" or "floating point not loaded"? (rev: 20
  48.          March 1994)
  49.     205. How can I change the stack size in Borland's C compilers? (rev:
  50.          24 March 1994)
  51.     206. What's the format of an .OBJ file? (rev: 24 Mar 1994)
  52.     207. What's the format of an .EXE header?
  53.     208. What's the difference between .COM and .EXE formats?
  54. section 3. Keyboard
  55.     301. How can I read a character without echoing it to the screen,
  56.          and without waiting for the user to press the Enter key?
  57.         302. How can I find out whether a character has been typed, without
  58.          waiting for one?
  59.     303. How can I disable Ctrl-C/Ctrl-Break and/or Ctrl-Alt-Del? (rev:
  60.          11 Sep 1993)
  61.     304. How can I disable the print screen function?
  62.     305. How can my program turn NumLock (CapsLock, ScrollLock) on or
  63.          off?
  64.     306. How can I speed up the keyboard's auto-repeat? (rev: 24 Mar
  65.          1994)
  66.     307. What is the SysRq key for?
  67.     308. How can my program tell what kind of keyboard is on the system?
  68.     309. How can I tell if input, output, or stderr has been redirected?
  69.          (rev: 24 Mar 1994)
  70.     310. How can I increase the size of the keyboard buffer? (new: 20
  71.          June 1993)
  72.     311. How can I stuff characters into the keyboard buffer? (new: 15
  73.          Aug 1993)
  74. section 4. Disks and files
  75.         401. What drive was the PC booted from?
  76.     402. How can I boot from drive b:? (rev: 24 Mar 1994)
  77.     403. Which real and virtual disk drives are valid? (rev: 15 Aug
  78.          1993)
  79.     404. How can I make my single floppy drive both a: and b:?
  80.     405. How can I disable access to a drive? (new: 15 Aug 1993)
  81.     406. How can a batch file test existence of a directory? (rev: 28
  82.          May 1994)
  83.     407. Why won't my C program open a file with a path?
  84.     408. How can I redirect printer output to a file? (rev: 16 Aug 1993)
  85.     409. How can I redirect the output of a batch file? (rev: 24 Mar
  86.          1994)
  87.     410. How can I redirect stderr? (rev: 24 Mar 1994)
  88.     411. How can my program open more files than DOS's limit of 20?
  89.          (rev: 12 Sep 1993)
  90.     412. How can I read, create, change, or delete the volume label?
  91.     413. How can I get the disk serial number?
  92.     414. What's the format of .OBJ, .EXE., .COM files?
  93.         415. How can I flush the software disk cache?
  94. section 5. Serial ports (COM ports)
  95.     501. How do I set my machine up to use COM3 and COM4?
  96.     502. How do I find the I/O address of a COM port? (rev: 24 Mar 1994)
  97.     503. But aren't the COM ports always at I/O addresses 3F8, 2F8, 3E8,
  98.          and 2E8?
  99.     504. How do I configure a COM port and use it to transmit data?
  100.          (rev: 17 Sep 1993)
  101. section 6. Other hardware questions and problems
  102.     601. Which 80x86 CPU is running my program? (rev: 24 Mar 1994)
  103.     602. How can a C program send control codes to my printer?
  104.     603. How can I redirect printer output to a file?
  105.     604. Which video adapter is installed?
  106.     605. How do I switch to 43- or 50-line mode?
  107.     606. How can I find the Microsoft mouse position and button status?
  108.     607. How can I access a specific address in the PC's memory? (rev:
  109.          24 March 1994)
  110.     608. How can I read or write my PC's CMOS memory? (rev: 24 Mar 1994)
  111.         609. How can I access memory beyond 640K? (rev: 24 Mar 1994)
  112. section 7. Other software questions and problems
  113.     701. How can a program reboot my PC? (rev: 24 Mar 1994)
  114.     702. How can I time events with finer resolution than the system
  115.          clock's 55 ms (about 18 ticks a second)? (rev: 24 Mar 1994)
  116.     703. How can I find the error level of the previous program? (rev:
  117.          24 Mar 1994)
  118.     704. How can a program set DOS environment variables? (rev: 24 Mar
  119.          1994)
  120.     705. How can I change the switch character to - from /? (rev: 20 Mar
  121.          1994)
  122.     706. Why does my interrupt function behave strangely? (rev: 24 Sep
  123.          1993)
  124.     707. How can I write a TSR (terminate-stay-resident utility)? (rev:
  125.          24 Mar 1994)
  126.     708. How can I write a device driver?
  127.     709. What can I use to manage versions of software? (rev: 21 Aug
  128.          1993)
  129.     710. What's this "null pointer assignment" after my C program
  130.          executes? (rev: 20 Mar 1994)
  131.     711. How can a batch file tell whether it's being run in a DOS box
  132.          under Windows? (new: 20 Mar 1994)
  133.     712. How can my program tell if it's running under Windows? (rev: 20
  134.          Mar 1994)
  135.     713. How can a program tell whether ANSI.SYS is installed? (new: 20
  136.          Apr 1994)
  137.     799. How do I copyright software that I write? (rev: 9 Sep 1993)
  138. section A. Downloading
  139.     A01. What are SimTel, Garbo, and wustl? (rev: 6 Apr 1994)
  140.     A02. I have no ftp access.  How can I get files from the archives?
  141.          (rev: 14 June 1993)
  142.     A03. Can I get archives on CD-ROM? (rev: 24 May 1993)
  143.     A04. Where do I find program <mumble>? (rev: 7 Aug 1993)
  144.     A05. How can I check SimTel or Garbo before I post a request for a
  145.          program? (rev: 24 Mar 1994)
  146.     A06. How do I download and decode a program I found? (rev: 7 Aug
  147.          1993)
  148.     A07. Where is UUDECODE?
  149.     A08. Why do I get errors when extracting from a ZIP file I
  150.          downloaded? (rev: 20 Mar 1994)
  151. section B. Vendors and products
  152.     B01. How can I contact Borland? (rev: 6 Sep 1993)
  153.     B02. How can I contact Microsoft? (rev: 18 Sep 1993)
  154.     B03. What's the current version of UNZIP? (rev: 17 Mar 1994)
  155.     B04. What is the phone number for a vendor's BBS? (rev: 24 Mar 1994)
  156. section C. More information
  157.     C01. Are there any good on-line references for PC hardware
  158.          components? (rev: 28 July 1993)
  159.     C02. Are there any good on-line references for PC interrupts?
  160.     C03. What and where is "Ralf Brown's interrupt list"? (rev: 5 Apr
  161.          1994)
  162.     C04. Where can I find lex, yacc, and language grammars?
  163.     C05. What's the best book to learn programming?
  164.     C06. Where are FAQ lists archived? (rev: 29 Mar 1994)
  165.     C07. Where can I get the latest copy of this FAQ list? (rev: 30 Mar
  166.          1994)
  167.     C08. How do I use ftp? (rev: 6 Apr 1994)
  168.  
  169.  
  170. section 0. Introduction to this article
  171. =======================================
  172.  
  173. Subject:  001. What is this article? (rev: 19 Apr 1994)
  174.  
  175.     This is the FAQ list (Frequently Asked Questions list) for the
  176.     newsgroup comp.os.msdos.programmer.  Starting 2 Feb 1993, new
  177.     questions and questions with revised answers are marked with "new:"
  178.     or "rev:" and the change date.  A separate article, containing just
  179.     the changes, is posted with subject line "comp.os.msdos.programmer
  180.     FAQ diffs".
  181.  
  182.     If the posting date shown above is much more than a month in the
  183.     past, see "C07. Where can I get the latest copy of this FAQ list?"
  184.  
  185. Subject:  002. Why is this article? (rev: 20 Mar 1994)
  186.  
  187.     FAQ lists are intended to reduce the noise level in their newsgroups
  188.     that results from the repetition of the same questions, correct
  189.     answers, wrong answers, corrections to the wrong answers,
  190.     corrections to the corrections, debate, etc.
  191.  
  192.     This list should serve as a repository of the canonical "best"
  193.     answers to the questions in it.  The names of folks who have helped
  194.     to improve this FAQ list are listed in "004. Who has contributed to
  195.     this article?"
  196.  
  197. Subject:  003. How can I search this article for a particular topic?
  198.                (rev: 20 Mar 1994)
  199.  
  200.     This list is in digest format.
  201.  
  202.     To skip one topic and go to the next:  Search for "Subject" starting
  203.     in column 1.  In trn and similar newsreaders, the command
  204.     "g^Subject", or a simple Ctrl-G, does that.
  205.  
  206.     To search for specific topics:  In the Table of Contents (above),
  207.     locate the question you need.  Then search for that question number.
  208.     For example, while you're reading this list, the trn newsreader
  209.     command "g  203" (note the two spaces) goes to question 203.
  210.  
  211.     If your newsreader doesn't support searches, you can extract these
  212.     articles to a file and use your favorite editor's search commands.
  213.  
  214. Subject:  004. Who has contributed to this article?
  215.  
  216.     This list is edited by Stan Brown, Oak Road Systems, Cleveland,
  217.     Ohio, the "I" or "me" in some answers.
  218.  
  219.     Many articles posted in comp.os.msdos.programmer sparked ideas or
  220.     provided information for the first version of this list.  Though
  221.     they are not responsible for any errors, thanks are due to the
  222.     following persons for posted articles or private email that led to
  223.     improvements in this FAQ list:
  224.  
  225.     Jamshid Afshar, Mark Aitchison, Sanjay Aiyagari, George Almasi,
  226.     Aaron Auseth, Robert Baker, Preston Bannister, Scott Barman, Denis
  227.     Beauregard, Per Bergland, Mike Black, Chris Blum, Ron Bodkin, Mark
  228.     Brader, Jon Brinkmann, Andrew James Bromage, Glynn Brooks, Paul
  229.     Brooks, Ralf Brown, Shaun Burnett, Raymond Chen, Denny de Jonge,
  230.     Eric DeVolder, Alan Drew, Paul Ducklin, Gary Dueck, Roland Eriksson,
  231.     Mark Evans, Markus Fischer, George Forsman, Roger Fulton, Vincent
  232.     Giovannone, Robert Grunloh, B.Haible, Janos Haide, Klaus Hartnegg,
  233.     Kris Heidenstrom, Tom Haapanen, Joel Hoffman, Ari Hovila, Chin
  234.     Huang, Joe Huffman, Michael Holin, Mike Iarrobino, Byrial Jensen,
  235.     Rune Jorgensen, Ajay Kamdar, Everett Kaser, Jeff Kellam, Jen Kilmer,
  236.     Reinhard Kirchner, Dave Kirsch, Chad Knudsen, Samuel Ko, Benjamin
  237.     Lee, Stephen Lee, Jim Lynch, Greg Malknecht, Sidney Markowitz, Jim
  238.     Marks, Dimitri Matzarakis, Fred McCall, Ken McKee, Doug Merrett, Tom
  239.     Milner, Bill Moore, Duncan Murdoch, Steve Murphy, Daniel Neri, Mert
  240.     Nickerson, David Nugent, John Oldenburg, David Pape, Keith Petersen,
  241.     Karl Riedling, Arthur Rubin, Gerald Ruderman, Timo Salmi, Tapio
  242.     Sand, John Schmid, Russell Schulz, Huseyin Sevay, Ajay Shah, Bob
  243.     Smith, Sean Sullivan, Steve Summit, Tom Swingle, Anders Thulin, Curt
  244.     Tilmes, Rick Watkins, Ya-Gui Wei, Joe Wells, Scott Winder, Gregory
  245.     Youngblood, khill@vax1.umkc.edu
  246.  
  247.     New contributor: Sean Sullivan
  248.  
  249. Subject:  005. Are the answers guaranteed correct and complete? (rev: 20
  250.                Mar 1994)
  251.  
  252.     I've tried to check all facts, but THERE IS NO WARRANTY ON THE CODE
  253.     OR ON THE TECHNIQUES DESCRIBED HEREIN.  Please send corrections to
  254.     brown@ncoast.org.  All the code has been tested; but the testing may
  255.     not have been perfect, and machines and configurations vary.
  256.     (Except where otherwise noted, C code was tested with both BC++ 2.0
  257.     and MSC 5.0.)
  258.  
  259.     The mention of particular books or programs must not be construed to
  260.     reflect unfavorably on any that are not mentioned.
  261.  
  262.  
  263. section 1. General questions
  264. ============================
  265.  
  266. Subject:  101. Why won't my code work?
  267.  
  268.     First you need to try to determine whether the problem is in your
  269.     use of the programming language or in your use of MS-DOS and your PC
  270.     hardware.  (Your manual should tell you which features are standard
  271.     and which are vendor- or MS-DOS- or PC-specific.  You _have_ read
  272.     your manual carefully, haven't you?)
  273.  
  274.     If the feature that seems to be working wrong is something related
  275.     to your PC hardware or to the internals of MS-DOS, this group is the
  276.     right place to ask.  (Please check this FAQ list first, to make sure
  277.     your question isn't already answered here.)
  278.  
  279.     On the other hand, if your problem is with the programming language,
  280.     the comp.lang hierarchy (including comp.lang.pascal and comp.lang.c)
  281.     is probably a better resource.  Please read the other group's FAQ
  282.     list thoroughly before posting.  (These exist in comp.lang.c,
  283.     comp.lang.c++, comp.lang.modula3, comp.lang.lisp, comp.lang.perl;
  284.     they may exist in other groups as well.)  It's almost never a good
  285.     idea to crosspost between comp.os.msdos.programmer and a language
  286.     group.
  287.  
  288.     Before posting in either place, try to make your program as small as
  289.     possible while still exhibiting the bad behavior.  Sometimes this
  290.     alone is enough to show you where the trouble is.  Also edit your
  291.     description of the problem to be as short as possible.  This makes
  292.     it look more like you tried to solve the problem on your own, and
  293.     makes people more inclined to try to help you.  See also "106.
  294.     What's this "netiquette"?"
  295.  
  296. Subject:  102. What is this newsgroup about? (rev: 11 Sep 1993)
  297.  
  298.     comp.os.msdos.programmer (comp.sys.ibm.pc.programmer until September
  299.     1990) concerns programming for MS-DOS systems.  The article "USENET
  300.     Readership report for Aug 93" in news.lists shows 78,000 readers of
  301.     this newsgroup worldwide.  Traffic (exclusive of crossposts) was 813
  302.     articles aggregating 1604 Kbytes.
  303.  
  304.     Much of our traffic is about language products (chiefly from Borland
  305.     and Microsoft).  More programming topics focus on C than on any one
  306.     other language, but we are not just for C programmers (see "103. Is
  307.     comp.os.msdos.programmer just for C programmers?").
  308.  
  309.     Since most MS-DOS systems run on hardware that is roughly compatible
  310.     with the IBM PC, on Intel 8088, 80188, or 80x86 chips, we tend to
  311.     get a lot of questions and answers about programming other parts of
  312.     the hardware.
  313.  
  314. Subject:  103. Is comp.os.msdos.programmer just for C programmers? (rev:
  315.                20 Mar 1994)
  316.  
  317.     No, it is for all programmers who want to share information about
  318.     programming in MS-DOS and DOS replacements like 4DOS.  Programs and
  319.     questions are also posted in Pascal, assembly, and other languages
  320.     (including MS-DOS batch programming.)
  321.  
  322.     Why does the newsgroup seem to be so C-oriented sometimes?  There
  323.     are two reasons.  First, comp.lang.c and comp.lang.pascal have
  324.     evolved in different directions.  comp.lang.pascal welcomes vendor-
  325.     specific discussion, such as Turbo Pascal.  Since so many of TP's
  326.     features are tailored to programming on PCs and in MS-DOS, Turbo
  327.     Pascal programmers tend to find DOS questions welcomed there, so
  328.     that comp.os.msdos.programmer gets less of the "DOS in Turbo Pascal"
  329.     traffic.  On the other hand, comp.lang.c has stayed closer to
  330.     talking only about the C language, and vendor-specific or operating-
  331.     system-specific questions are not welcome.  This tends to push
  332.     questions about disks, DOS file structure, video, the keyboard,
  333.     TSRs, etc. to comp.os.msdos.programmer even when those programs are
  334.     written in C.
  335.  
  336.     This FAQ is definitely C-oriented, not because that's necessarily
  337.     best but because I tried to stick to what I could verify personally.
  338.     As a C programmer (with some assembler), I could most carefully
  339.     verify solutions in C or assembler.  I felt that short, clear
  340.     programs could be published in just one language and programmers
  341.     could translate them into their languages of choice.  But the FAQ
  342.     list also contains several long programs written only in C; this is
  343.     a defect with no obvious remedy.  Most answers that point to source
  344.     code at archive sites include both C- and Pascal-language source
  345.     when available.
  346.  
  347. Subject:  104. What's the difference from comp.sys.ibm.pc.programmer?
  348.  
  349.     c.s.i.p.programmer is the old name of comp.os.msdos.programmer, and
  350.     has been obsolete since September 1990.  However, many systems have
  351.     not removed the old group, or have removed it but aliased it to the
  352.     new name.  This means that some people still think they're posting
  353.     to c.s.i.p.programmer even though they're actually posting to
  354.     comp.os.msdos.programmer.
  355.  
  356.     You can easily verify the non-existence of c.s.i.p.programmer by
  357.     reference to the "List of Active Newsgroups" posted to news.groups.
  358.     It's available as /pub/usenet/news.answers/active-newsgroups/part1
  359.     from the archives (see "C06. Where are FAQ lists archived?").
  360.  
  361. Subject:  105. Is comp.os.msdos.programmer available as a mailing list?
  362.                (new: 2 Feb 1993)
  363.  
  364.     Sorry, no.
  365.  
  366. Subject:  106. What's this "netiquette"? (rev: 20 Mar 1994)
  367.  
  368.     Netiquette is good Usenet etiquette.  It includes basic rules like
  369.     the ones below.  (See also "107. How can I learn more about
  370.     Usenet?")
  371.  
  372.     - Always read a newsgroup for a reasonable time before you post an
  373.       article to it.
  374.  
  375.     - Pick the one right group for your article; don't crosspost unless
  376.       absolutely necessary.  If you absolutely must post an article to
  377.       more than one group, do crosspost it and don't post the same
  378.       article separately to each group.  See "108. What other technical
  379.       newsgroups should I know about?" when considering where to post an
  380.       article.
  381.  
  382.     - Before you post a question, make sure you're posting to the right
  383.       newsgroup; the best way to do that is to observe the preceding
  384.       rule.  Check the group's FAQ list (if it has one) to make sure
  385.       that your question isn't already answered there; see "C06. Where
  386.       are FAQ lists archived?".
  387.  
  388.     - When you post a question, if you ask for email responses then
  389.       promise to post a summary.  Keep your promise.  And make it a real
  390.       summary: don't just append all the email you got.  Instead, write
  391.       your own (brief) description of the solution:  this is the best
  392.       way to make sure you really understand it.
  393.  
  394.     - Before you post a follow-up, read the other follow-ups.  Very
  395.       often you'll find that someone else has already made the point you
  396.       had in mind.
  397.  
  398.     - When someone posts a question, if you want to know the answer
  399.       don't post a "me, too".  Instead send email to the poster asking
  400.       him or her to share responses with you.
  401.  
  402.     - When posting a follow-up to another posted article, remove all
  403.       headers and signature lines from the old article; just keep the
  404.       line "In <article>, so-and-so writes:".  Also cut the original
  405.       article down as much as possible; just keep enough of it to remind
  406.       readers of the context.
  407.  
  408.     - Keep lines in posted articles to 72-75 characters.  Many
  409.       newsreaders chop off column 81 or arbitrarily insert a newline
  410.       there, which makes longer lines difficult or impossible to read.
  411.       But you need to keep well below 80 characters per line to allow
  412.       for the > characters that get inserted when other people post
  413.       follow-ups to your article.
  414.  
  415.     - Keep your signature to 4 lines or less (including any graphics),
  416.       and for heaven's sake make sure it doesn't get posted twice in
  417.       your article.
  418.  
  419.     - Don't post email without first obtaining the permission of the
  420.       sender.
  421.  
  422. Subject:  107. How can I learn more about Usenet? (new: 7 Aug 1993)
  423.  
  424.     There are two important newsgroups for learning about how Usenet and
  425.     newsreader software works:
  426.  
  427.     - news.announce.newusers contains periodic postings that everybody
  428.       is asked to read before posting anything to Usenet.  (In theory,
  429.       all new users are subscribed to news.announce.newusers
  430.       automatically.  But in practice not all newsreader software does
  431.       that, so that many people violate the guidelines given there
  432.       simply because they don't know about them.)
  433.  
  434.     - news.newusers.questions is described as "Q & A for users new to
  435.       the Usenet".  But new and long-time users can ask or answer
  436.       questions about Usenet and newsreader software there.  There's an
  437.       important article, "Welcome to news.newusers.questions! (weekly
  438.       posting)", that everyone is asked to read before posting to
  439.       news.newusers.questions.  (See below for ways to get a copy of
  440.       that article.)
  441.  
  442.     The following postings in news.announce.newusers might be considered
  443.     the "mandatory course" for new users:
  444.  
  445.         Introduction to news.announce.newusers
  446.         What is Usenet?
  447.         Answers to Frequently Asked Questions
  448.         Rules for posting to Usenet
  449.         A Primer on How to Work With the Usenet Community
  450.         Hints on writing style for Usenet
  451.         Emily Postnews Answers Your Questions on Netiquette
  452.  
  453.     The articles mentioned above are downloadable via ftp from
  454.     rtfm.mit.edu in the following files:
  455.  
  456.         /pub/usenet/news.answers/news-newusers-intro
  457.             Welcome to news.newusers.questions! (weekly posting)
  458.         /pub/usenet/news.answers/news-announce-intro/part1
  459.             Introduction to news.announce.newusers
  460.         /pub/usenet/news.answers/what-is-usenet/part1
  461.             What is Usenet?
  462.         /pub/usenet/news.answers/usenet-faq/part1
  463.             Answers to Frequently Asked Questions
  464.         /pub/usenet/news.answers/posting-rules/part1
  465.             Rules for posting to Usenet
  466.         /pub/usenet/news.answers/usenet-primer/part1
  467.             A Primer on How to Work With the Usenet Community
  468.         /pub/usenet/news.answers/usenet-writing-style/part1
  469.             Hints on writing style for Usenet
  470.         /pub/usenet/news.answers/emily-postnews/part1
  471.             Emily Postnews Answers Your Questions on Netiquette
  472.  
  473.     For rtfm.mit.edu instructions, see "C06. Where are FAQ lists
  474.     archived?"
  475.  
  476. Subject:  108. What other technical newsgroups should I know about?
  477.                (rev: 6 Apr 1994)
  478.  
  479.     Caution:  Some of these newsgroups have specialized charters; you'll
  480.     probably get flamed (and deserve it) if you post to an inappropriate
  481.     group.  Most groups have FAQ lists that will tell you what's
  482.     appropriate.  Don't post a request for the FAQ list; instead,
  483.     retrieve it yourself: see "C06. Where are FAQ lists archived?"
  484.  
  485.     - misc.forsale.computers.d and misc.forsale.computers.pc-clone are
  486.       where you post notices of equipment, software, or computer books
  487.       that you want to sell.  Please don't post or crosspost those
  488.       notices to comp.os.msdos.programmer.
  489.  
  490.     - comp.os.ms-windows.programmer.* groups (formerly part of
  491.       comp.windows.ms.programmer):  Similar to comp.os.msdos.programmer,
  492.       but focus on programming for the MS-Windows platform.
  493.  
  494.     - comp.sys.ibm.pc.hardware is for more hardware-oriented discussions
  495.       of the machines that run DOS.
  496.  
  497.     - the various comp.lang.* groups for articles and questions on the
  498.       programming languages.  Caution:  some groups welcome discussions
  499.       that are operating-system dependent or vendor specific; others do
  500.       not.  For example, comp.lang.c is definitely _not_ for questions
  501.       about programming DOS or PC system features, even if the programs
  502.       are written in C.  On the other hand, comp.lang.pascal contains
  503.       much discussion that is specific to Turbo Pascal.
  504.  
  505.     - comp.binaries.ibm.pc.wanted: AFTER you have looked in the other
  506.       groups, this is the place to post a request for a particular
  507.       binary program.
  508.  
  509.     - comp.archives.msdos.announce (moderated) explains how to use the
  510.       archive sites, especially Garbo and SimTel, and lists files
  511.       uploaded to them.  Discussions belong in comp.archives.msdos.d,
  512.       which replaced comp.binaries.ibm.pc.archives in December 1992.
  513.  
  514.     - MSDOS-Ann mailing list, for those who cannot subscribe to the
  515.       comp.archives.msdos.announce newsgroup, lists SimTel and Garbo
  516.       uploads in digest format.  Instructions are downloadable as
  517.  
  518.         /pc/MSDOSANN.ZIP from Garbo
  519.         /pub/msdos/info/msdosann.zip from SimTel.
  520.  
  521.     - comp.binaries.ibm.pc.d is for discussions about programs posted in
  522.       comp.binaries.ibm.pc, and only those programs.  This is a good
  523.       place to report bugs in the programs, but not to ask where to find
  524.       them (see cbip.wanted, above).  cbip.d is NOT supposed to be a
  525.       general PC discussion group.
  526.  
  527.     - comp.sources.misc: a moderated group for source code for many
  528.       computer systems.  It tends to get lots of Unix stuff, but you may
  529.       also pick up some DOS-compatible code here.
  530.  
  531.     - alt.sources: an unmoderated group for source code.  Guidelines are
  532.       posted periodically.
  533.  
  534.     - comp.os.msdos.programmer.turbovision is specifically for
  535.       programming in Turbo Vision.
  536.  
  537.  
  538. section 2. Compile and link
  539. ===========================
  540.  
  541. Subject:  201. What the heck is "DGROUP > 64K"? (rev: 18 Apr 1993)
  542.  
  543.     This Q explains the problem; the next Q gives some remedies.
  544.  
  545.     DGROUP is a link-time group of data segments, and the compiler
  546.     typically generates code that expects DS to be pointing to DGROUP.
  547.     (Exception:  Borland's huge model has no DGROUP.)
  548.  
  549.     Here's what goes into DGROUP:
  550.  
  551.     - tiny model (all pointers near):  DGROUP holds the entire program.
  552.  
  553.     - small and medium models (data pointers near):  DGROUP holds all
  554.       globals and static variables including string literals, plus the
  555.       stack and the heap.
  556.  
  557.     - large, compact, and huge models in Microsoft (data pointers far):
  558.       DGROUP holds only initialized globals and static variables
  559.       including string literals, plus the stack and the near heap.
  560.  
  561.     - large and compact models in Borland (data pointers far): DGROUP
  562.       holds initialized and uninitialized globals and static variables
  563.       including string literals, but not the stack or heap.
  564.  
  565.     - huge model in Borland (data pointers far): there is no DGROUP, so
  566.       the 64K limit doesn't apply.
  567.  
  568.     In all of the above, which is to say all six models in Microsoft C
  569.     and all but huge in Borland C, DGROUP is limited to 64K including
  570.     string literals (which are treated as static data).  This limitation
  571.     is due to the Intel CPU's segmented architecture.
  572.  
  573.     For more information, see topics like "memory models" and "memory
  574.     management" in the index of your compiler manual.  Also see
  575.     TI738.asc, downloadable as part of
  576.  
  577.         /pub/msdos/turbo-c/bchelp10.zip at SimTel
  578.         /pc/turbopas/bchelp10.zip at Garbo,
  579.  
  580.     for an extended general discussion of memory usage in Borland C
  581.     programs, of which much applies to any C compiler in DOS.
  582.  
  583. Subject:  202. How do I fix "automatic data segment exceeds 64K" or
  584.                "stack plus data exceed 64K"?
  585.  
  586.     These messages are a variation of "DGROUP > 64K".  For causes,
  587.     please see the preceding Q.
  588.  
  589.     If you get this error in tiny model, your program is simply too big
  590.     and you must use a different memory model.  If you get this link
  591.     error in models S, C, M, L, or Microsoft's H, there are some things
  592.     you can do.  (This error can't occur in Borland's huge model.)
  593.  
  594.     If you have one or two big global arrays, simply declare them far.
  595.     The compiler takes this to mean that any references to them will use
  596.     32-bit pointers, so they'll be in separate segments and no longer
  597.     part of DGROUP.
  598.  
  599.     Or you can use the /Gt[number] option with Microsoft or -Ff[=size]
  600.     with Borland C++ 2.0 and up.  This will automatically put variables
  601.     above a certain size into their own segments outside of DGROUP.
  602.  
  603.     Yet another option is to change global arrays to far pointers.  Then
  604.     at the beginning of your program, allocate them from the far heap
  605.     (_fmalloc() in Microsoft, farmalloc() in Borland).
  606.  
  607.     Finally, you can change to huge model (with Borland compilers, not
  608.     Microsoft).  Borland's H model still uses far pointers by default,
  609.     but "sets aside the [64K] limit" and has no DGROUP group, according
  610.     to the BC++ 2.0 Programmer's Guide.  Microsoft's H model does use
  611.     huge data pointers by default but retains DGROUP and its 64K limit,
  612.     so switching to the H model doesn't buy you anything if you have
  613.     DGROUP problems.
  614.  
  615. Subject:  203. Will Borland C code and Microsoft C code link together?
  616.                (rev: 15 Aug 1993)
  617.  
  618.     Typically this question is asked by someone who owns compiler A and
  619.     is trying to write code to link with a third-party library that was
  620.     compiled under compiler B.
  621.  
  622.     The answer to the question is, Not in general.  Here are some of the
  623.     reasons:
  624.  
  625.     - "Helper" functions (undocumented functions for stack checking,
  626.       floating-point arithmetic, and operations on longs) differ between
  627.       the two compilers.
  628.  
  629.     - The compilers may embed instructions in the object code that tell
  630.       the linker to look for their own run-time libraries.  You can use
  631.       the linker option that says to ignore such instructions: /n in
  632.       TLINK, /NOD in the Microsoft linker (the one that comes with the C
  633.       compiler, not the one that used to come with DOS).  But getting
  634.       around this problem will very likely just reveal other problems,
  635.       like different helper functions, that have no easy solution.
  636.  
  637.     Those problems will generate link-time errors.  Others may not show
  638.     up until run time:
  639.  
  640.     - Borland's compact, large, and huge models don't assume DS=SS, but
  641.       Microsoft's do.  The -Fs option on the Borland compiler, or one of
  642.       the /A options on Microsoft, should take care of this problem--
  643.       once you know that's what's going on.
  644.  
  645.     - Check conventions for ordering and packing structure members, and
  646.       for alignment of various types on byte, word, paragraph, or other
  647.       boundaries.  Again, you can generally adjust your code to match if
  648.       you know what conventions were used in compiling the "foreign"
  649.       libraries.
  650.  
  651.     - Check the obvious and make sure that your code was compiled under
  652.       the same memory model as the code you're trying to link with.
  653.       (That's necessary, but no guarantee.  Microsoft and Borland don't
  654.       use exactly the same conventions for segments and groups,
  655.       particularly in the larger memory models.)
  656.  
  657.     That said, there are some circumstances where you can link hybrids.
  658.     Your best chance of success comes if you compile in large model with
  659.     the compiler switch that says to reload DS on entry to each
  660.     function, avoid longs and floating point, use only 16-bit pointers,
  661.     suppress stack checking, and specify all libraries used in the link.
  662.  
  663. Subject:  204. Why did my program bomb at run time with "floating point
  664.                formats not linked" or "floating point not loaded"? (rev:
  665.                20 March 1994)
  666.  
  667.     These messages look similar but have very different causes.
  668.  
  669.     "floating point not loaded" is Microsoft C's run-time message when
  670.     the code requires a numeric coprocessor but your computer doesn't
  671.     have one installed.  If the program is yours, relink it using the
  672.     xLIBCE or xLIBCA library (where x is the memory model).
  673.  
  674.     "floating point formats not linked" is a Borland run-time error
  675.     (Borland C or C++, Turbo C or C++).  Borland's compilers try to be
  676.     smart and not link in the floating-point (f-p) library unless you
  677.     need it.  Alas, they all get the decision wrong.  One common case is
  678.     where you don't call any f-p functions, but you have %f or other f-p
  679.     formats in scanf() or printf() calls.  The cure is to call an f-p
  680.     function, or at least force one to be present in the link.
  681.  
  682.     To do that, define this function somewhere in a source file but
  683.     don't call it:
  684.  
  685.         static void forcefloat(float *p) {
  686.             float f = *p;
  687.             forcefloat(&f);
  688.         }
  689.  
  690.     It doesn't have to be in the module with the main program, as long
  691.     as it's in a module that will be included in the link.
  692.  
  693.     If you have Borland C++ 3.0, the README file documents a slightly
  694.     less ugly work-around.  Insert these statements in your program:
  695.  
  696.         extern unsigned _floatconvert;
  697.         #pragma extref _floatconvert
  698.  
  699. Subject:  205. How can I change the stack size in Borland's C compilers?
  700.                (rev: 24 March 1994)
  701.  
  702.     In Turbo C, Turbo C++, and Borland C++, you may not find "stack
  703.     size" in the index but the global variable _stklen should be there.
  704.     The manual will instruct you to put a statement like
  705.  
  706.         extern unsigned _stklen = 54321U;
  707.  
  708.     in your code, outside of any function.  You must assign the value
  709.     right in the extern statement; it won't work to assign a value at
  710.     run time.  The linker may give you a duplicate symbol warning, which
  711.     you can ignore.
  712.  
  713. Subject:  206. What's the format of an .OBJ file? (rev: 24 Mar 1994)
  714.  
  715.     - base .OBJ format:  Intel's document number #121748-001, {8086
  716.       Relocatable Object Module Formats}.  (not verified)
  717.  
  718.     Both Microsoft and Borland have extended the .OBJ format, as has IBM
  719.     for OS/2; and according to the MS-DOS encyclopedia, Microsoft
  720.     doesn't actually use all the listed formats.
  721.  
  722.     - Microsoft-specific .OBJ formats:
  723.  
  724.       * The .OBJ format document dated 14 Dec 1992, a WinHelp file from
  725.         the Microsoft developer's CD-ROM (266K after unzipping), is
  726.         downloadable as
  727.  
  728.         /vendor/microsoft/developer-network/ctech/11-9.zip from
  729.             ftp.uu.net.
  730.  
  731.       * A 45-page article can be found in the {MS-DOS Encyclopedia},
  732.         ISBN 1-55615-049-0, now out of print.
  733.  
  734.       * "Microsoft Object Module Format (OMF)" Specification, 22 Nov
  735.         1991, was published by the Microsoft Languages Group.  (not
  736.         verified)
  737.  
  738.     - Borland-specific .OBJ formats:  Open Architecture Handbook.  The
  739.       Borland Developer's Technical Guide, 1991, no ISBN.  Chapter 2,
  740.       "Object file contents", (pages 27-50) covers the comment records
  741.       sent to the object file by Borland C++ version 3.0 and other
  742.       Borland compilers.  The comment records mostly contain information
  743.       for the Borland debugger. (not verified)
  744.  
  745.     - A "tutorial on the .OBJ format" comes with the VAL experimental
  746.       linker, downloadable as
  747.  
  748.         /pub/msdos/pgmutil/val-link.zip at SimTel
  749.         /pc/assembler/linker.zoo at Garbo.
  750.  
  751.       Despite such different names, those files have the same contents,
  752.       but their contents are dated 18 Feb 1989.  You'd be better off
  753.       with one of the more recent references listed above.
  754.  
  755. Subject:  207. What's the format of an .EXE header?
  756.  
  757.     See PC Magazine 30 June 1992 (xi:12) pages 349-350 for the old and
  758.     new formats.  For a more detailed layout, look under INT 21 AH=4B in
  759.     Ralf Brown's interrupt list (Q C03).  That list includes extensions
  760.     for Borland's TLINK and Borland debugger info.
  761.  
  762.     Among the books that detail formats of executable files are {DOS
  763.     Programmer's Reference: 2d Edition} by Terry Dettman and Jim Kyle,
  764.     ISBN 0-88022-458-4; and {Microsoft MS-DOS Programmer's Reference},
  765.     ISBN 1-55615-329-5.
  766.  
  767. Subject:  208. What's the difference between .COM and .EXE formats?
  768.  
  769.     To oversimplify:  a .COM file is a direct image of core, and an .EXE
  770.     file will undergo some further relocation when it is run (and so it
  771.     begins with a relocation header).  A .COM file is limited to 64K for
  772.     all segments combined, but an .EXE file can have as many segments as
  773.     your linker will handle and be as large as RAM can take.
  774.  
  775.     The actual file extension doesn't matter.  DOS knows that a file
  776.     being loaded is in .EXE format if its first two bytes are MZ or ZM;
  777.     otherwise it is assumed to be in .COM format.  For instance, DR-DOS
  778.     6.0's COMMAND.COM is in .EXE format.
  779.  
  780.  
  781. section 3. Keyboard
  782. ===================
  783.  
  784. Subject:  301. How can I read a character without echoing it to the
  785.                screen, and without waiting for the user to press the
  786.                Enter key?
  787.  
  788.     The C compilers from Microsoft and Borland offer getch() (or
  789.     getche() to echo the character); Turbo Pascal has ReadKey.
  790.  
  791.     In other programming languages, execute INT 21 AH=8; AL is returned
  792.     with the character from standard input (possibly redirected).  If
  793.     you don't want to allow redirection, or you want to capture Ctrl-C
  794.     and other special keys, use INT 16 AH=10; this will return the scan
  795.     code in AH and ASCII code (if possible) in AL, but  AL=E0 with AH
  796.     nonzero indicates that one of the grey "extended" keys was pressed.
  797.     (If your BIOS doesn't support the extended keyboard, use INT 16 AH=0
  798.     not 10.)
  799.  
  800. Subject:  302. How can I find out whether a character has been typed,
  801.                without waiting for one?
  802.  
  803.     In Turbo Pascal, use KeyPressed.  Both Microsoft C and Turbo C offer
  804.     the kbhit() function.  All of these tell you whether a key has been
  805.     pressed.  If no key has been pressed, they return that information
  806.     to your program.  If a keystroke is waiting, they tell your program
  807.     that but leave the key in the input buffer.
  808.  
  809.     You can use the BIOS call, INT 16 AH=01 or 11, to check whether an
  810.     actual keystroke is waiting; or the DOS call, INT 21 AH=0B, to check
  811.     for a keystroke from stdin (subject to redirection).  See Ralf
  812.     Brown's interrupt list (Q C03).
  813.  
  814. Subject:  303. How can I disable Ctrl-C/Ctrl-Break and/or Ctrl-Alt-Del?
  815.                (rev: 11 Sep 1993)
  816.  
  817.     Several utilities are downloadable from /pub/msdos/keyboard at
  818.     SimTel.  In that directory, cadel.zip contains a TSR (with source
  819.     code) to disable those keys.  Also, keykill.arc contains two
  820.     utilities:  keykill.com lets you disable up to three keys of your
  821.     choice, and deboot.com changes the boot key to leftShift-Alt-Del.
  822.  
  823.     C programmers who simply want to make sure that the user can't Ctrl-
  824.     Break out of their program can use the ANSI-standard signal()
  825.     function; the Borland compilers also offer ctrlbrk() for handling
  826.     Ctrl-Break.  However, if your program uses normal DOS input such as
  827.     getch(), ^C will appear on the screen when the user presses Ctrl-C
  828.     or Ctrl-Break.  You can avoid the ^C echo for Ctrl-C by using
  829.     _bios_keybrd() in MSC or bioskey() in BC++; however, Ctrl-Break will
  830.     still terminate the program.
  831.  
  832.     An alternative approach involves programming input at a lower level.
  833.     You can use INT 21 AH=7, which allows redirection but doesn't echo
  834.     the ^C (or any other character, for that matter); or use INT 16 AH=0
  835.     or 10; or hook INT 9 to discard Ctrl-C and Ctrl-Break before the
  836.     regular BIOS keyboard handler sees them; etc., etc.
  837.  
  838.     You should be aware that Ctrl-C and Ctrl-Break are processed quite
  839.     differently internally.  Ctrl-Break, like all keystrokes, is
  840.     processed by the BIOS code at INT 9 as soon as the user presses the
  841.     keys, even if earlier keys are still in the keyboard buffer:  by
  842.     default the handler at INT 1B is called.  Ctrl-C is not special to
  843.     the BIOS, nor is it special to DOS functions 6 and 7; it _is_
  844.     special to DOS functions 1 and 8 when at the head of the keyboard
  845.     buffer.  You will need to make sure BREAK is OFF to prevent DOS
  846.     polling the keyboard for Ctrl-C during non-keyboard operations.
  847.  
  848.     Some good general references are {Advanced MS-DOS} by Ray Duncan,
  849.     ISBN 1-55615-157-8; {8088 Assembler Language Programming:  The IBM
  850.     PC}, ISBN 0-672-22024-5, by Willen & Krantz; and {COMPUTE!'s Mapping
  851.     the IBM PC}, ISBN 0-942386-92-2.
  852.  
  853. Subject:  304. How can I disable the print screen function?
  854.  
  855.     There are really two print screen functions:  1) print current
  856.     screen snapshot, triggered by PrintScreen or Shift-PrtSc or Shift-
  857.     grey*, and 2) turn on continuous screen echo, started and stopped by
  858.     Ctrl-P or Ctrl-PrtSc.
  859.  
  860.     1) Screen snapshot to printer
  861.  
  862.     The BIOS uses INT 5 for this.  Fortunately, you don't need to mess
  863.     with that interrupt handler.  The standard handler, in BIOS versions
  864.     dated December 1982 or later, uses a byte at 0040:0100 (= 0000:0500)
  865.     to determine whether a print screen is currently in progress.  If it
  866.     is, pressing PrintScreen again is ignored.  So to disable the screen
  867.     snapshot, all you have to do is write a 1 to that byte.  When the
  868.     user presses PrintScreen, the BIOS will think that a print screen is
  869.     already in progress and will ignore the user's keypress.  You can re-
  870.     enable PrintScreen by zeroing the same byte.
  871.  
  872.     Here's some simple code:
  873.  
  874.         void prtsc_allow(int allow) /* 0=disable, nonzero=enable */ {
  875.             unsigned char far* flag = (unsigned char far*)0x00400100UL;
  876.             *flag = (unsigned char)!allow;
  877.         }
  878.  
  879.     2) Continuous echo of screen to printer
  880.  
  881.     If ANSI.SYS is loaded, you can easily disable the continuous echo of
  882.     screen to printer (Ctrl-P or Ctrl-PrtSc).  Just redefine the keys by
  883.     "printing" strings like these to the screen (BASIC print, C
  884.     printf(), Pascal Write statements, or ECHO command in batch files),
  885.     where <27> stands for the Escape character, ASCII 27:
  886.  
  887.         <27>[0;114;"Ctrl-PrtSc disabled"p
  888.         <27>[16;"^P"p
  889.  
  890.     If you haven't installed ANSI.SYS, I can't offer an easy way to
  891.     disable the echo-screen-to-printer function.
  892.  
  893.     Actually, you might not need to disable Ctrl-P and Ctrl-PrtSc.  If
  894.     your only concern is not locking up your machine, when you see the
  895.     "Abort, Retry, Ignore, Fail" prompt just press Ctrl-P again and then
  896.     press I.  As an alternative, install one of the many print spoolers
  897.     that intercept printer-status queries and always return "Printer
  898.     ready".
  899.  
  900. Subject:  305. How can my program turn NumLock (CapsLock, ScrollLock) on
  901.                or off?
  902.  
  903.     First, if you just don't want NumLock turned on when you reboot,
  904.     check your system's setups.  (Use Ctrl-Alt-Enter any time, or press
  905.     a special key like Del at boot time, or run the setup program
  906.     supplied with your system.)  Many systems now have an option in
  907.     setup to turn NumLock off at boot time.
  908.  
  909.     You need to twiddle bit 5, 6, or 4 of location 0040:0017.  Here's
  910.     some code:  lck() turns on a lock state, and unlck() turns it off.
  911.     (The status lights on some keyboards may not reflect the change.  If
  912.     yours is one, call INT 16 AH=2, "get shift status", and that may
  913.     update them.  It will certainly do no harm.)
  914.  
  915.         #define NUM_LOCK  (1 << 5)
  916.         #define CAPS_LOCK (1 << 6)
  917.         #define SCRL_LOCK (1 << 4)
  918.         void lck(int shiftype) {
  919.             char far* kbdstatus = (char far*)0x00400017UL;
  920.             *kbdstatus |= (char)shiftype;
  921.         }
  922.         void unlck(int shiftype) {
  923.             char far* kbdstatus = (char far*)0x00400017UL;
  924.             *kbdstatus &= ~(char)shiftype;
  925.         }
  926.  
  927. Subject:  306. How can I speed up the keyboard's auto-repeat? (rev: 24
  928.                Mar 1994)
  929.  
  930.     The keyboard speed has two components: delay (before a key that you
  931.     hold down starts repeating) and typematic rate (the speed once the
  932.     key starts repeating).  Most BIOS versions since 1986 let software
  933.     change the delay and typematic rate by calling INT 16 AH=3, "set
  934.     typematic rate and delay"; see Ralf Brown's interrupt list (Q C03).
  935.     If you have DOS 4.0 or later, you can use the MODE CON command that
  936.     you'll find in your DOS manual.
  937.  
  938.     On 83-key keyboards (mostly XTs), the delay and typematic rate can't
  939.     easily be changed.  According to PC Magazine 15 Jan 1991 (x:1) page
  940.     409, to adjust the typematic rate you need "a memory-resident
  941.     program which simply '[watches]' the keyboard to see if you're
  942.     holding down a key ... and after a certain time [starts] stuffing
  943.     extra copies of the held-down key into the buffer."  No source code
  944.     is given in that issue; but the QUICKEYS utility that PC Magazine
  945.     published in 1986 does this sort of watching (not verified); source
  946.     and object code are downloadable in
  947.  
  948.         /pub/msdos/pcmag/vol5n05.zip from SimTel.
  949.  
  950. Subject:  307. What is the SysRq key for?
  951.  
  952.     There is no standard use for the key.  The BIOS keyboard routines in
  953.     INT 16 simply ignore it; therefore so do the DOS input routines in
  954.     INT 21 as well as the keyboard routines in libraries supplied with
  955.     high-level languages.
  956.  
  957.     When you press or release a key, the keyboard triggers hardware line
  958.     IRQ1, and the CPU calls INT 9.  INT 9 reads the scan code from the
  959.     keyboard and the shift states from the BIOS data area.
  960.  
  961.     What happens next depends on whether your PC's BIOS supports an
  962.     enhanced keyboard (101 or 102 keys).  If so, INT 9 calls INT 15
  963.     AH=4F to translate the scan code.  If the translated scan code is 54
  964.     hex (for the SysRq key) then INT 9 calls INT 15 AH=85 and doesn't
  965.     put the keystroke into the keyboard buffer.  The default handler of
  966.     that function does nothing and simply returns.  (If your PC has an
  967.     older BIOS that doesn't support the extended keyboards, INT 15 AH=4F
  968.     is not called.  Early ATs have 84-key keyboards, so their BIOS calls
  969.     INT 15 AH=85 but not 4F.)
  970.  
  971.     Thus your program is free to use SysRq for its own purposes, but at
  972.     the cost of some programming.  You could hook INT 9, but it's
  973.     probably easier to hook INT 15 AH=85, which is called when SysRq is
  974.     pressed or released.
  975.  
  976. Subject:  308. How can my program tell what kind of keyboard is on the
  977.                system?
  978.  
  979.     Ralf Brown's Interrupt List (Q C03) includes MEMORY.LST, a detailed
  980.     breakdown by Robin Walker of the contents of the BIOS system block
  981.     that starts at 0040:0000.  Bit 4 of byte 0040:0096 is "1=enhanced
  982.     keyboard installed".  C code to test the keyboard type:
  983.  
  984.         char far *kbd_stat_byte3 = (char far *)0x00400096UL;
  985.         if (0x10 & *kbd_stat_byte3)
  986.             /* 101- or 102-key keyboard is installed */
  987.  
  988.     PC Magazine 15 Jan 1991 (x:1) suggests on page 412 that "for some
  989.     clones [the above test] is not foolproof".  If you use this method
  990.     in your program you should provide the user some way to override
  991.     this test, or at least some way to tell your program to assume a non-
  992.     enhanced keyboard.  The article suggests a different approach to
  993.     determining the type of keyboard.
  994.  
  995. Subject:  309. How can I tell if input, output, or stderr has been
  996.                redirected? (rev: 24 Mar 1994)
  997.  
  998.     Normally, input and output are associated with the console (i.e.,
  999.     with the keyboard and the screen, respectively).  If either is not,
  1000.     you know that it has been redirected.  Some source code to check
  1001.     this is available at the usual archive sites.
  1002.  
  1003.     If you program in Turbo Pascal, you'll want this downloadable
  1004.     collection of Turbo Pascal units:
  1005.  
  1006.         /pc/ts/tspa33*.zip at Garbo
  1007.         /pub/msdos/turbopas/tspa33*.zip at SimTel.
  1008.  
  1009.     (where the * is 70, 60, 55, 50, or 40 for Turbo Pascal 7.0, 6.0,
  1010.     5.5, 5.0, or 4.0 respectively.)  Source code is not included.  Also
  1011.     see the downloadable Frequently Asked Questions files by Timo Salmi:
  1012.  
  1013.         /pc/ts/tsfaqp18.zip at Garbo
  1014.         /pub/msdos/info/tsfaqp18.zip at SimTel.
  1015.  
  1016.     If you program in C, use isatty() if your implementation has it.
  1017.     Otherwise, /pub/msdos/sysutil/is_con10.zip is downloadable from
  1018.     SimTel; it includes source code.
  1019.  
  1020.     Good references for the principles are PC Magazine 16 Apr 1991 (x:7)
  1021.     page 374; Ray Duncan's {Advanced MS-DOS}, ISBN 1-55615-157-8, or
  1022.     Ralf Brown's interrupt list (Q C03) for INT 21 AX=4400; and Terry
  1023.     Dettman and Jim Kyle's {DOS Programmer's Reference: 2d edition},
  1024.     ISBN 0-88022-458-4, pages 602-603.
  1025.  
  1026. Subject:  310. How can I increase the size of the keyboard buffer? (new:
  1027.                20 June 1993)
  1028.  
  1029.     I tested only one of the many available device drivers that do this,
  1030.     namely BUF160, which extends the keyboard buffer to 160 characters.
  1031.     It performed flawlessly for two years with MS-DOS 5 and Windows 3.1.
  1032.     It's downloadable as
  1033.  
  1034.         /pub/msdos/keyboard/buf160_6.zip at SimTel
  1035.         /pc/keyboard/buf160_6.zip at Garbo.
  1036.  
  1037. Subject:  311. How can I stuff characters into the keyboard buffer?
  1038.                (new: 15 Aug 1993)
  1039.  
  1040.     If your computer has an enhanced keyboard (see "308. How can my
  1041.     program tell what kind of keyboard is on the system?"), put the scan
  1042.     code in CH and the ASCII character in CL, then execute INT 16 AH=5.
  1043.     The return in AL is 0 for success or 1 for buffer full.
  1044.  
  1045.  
  1046. section 4. Disks and files
  1047. ==========================
  1048.  
  1049. Subject:  401. What drive was the PC booted from?
  1050.  
  1051.     Under DOS 4.0 or later, use INT 21 AX=3305.  DL is returned with an
  1052.     integer indicating the boot drive (1=A:, etc.).
  1053.  
  1054. Subject:  402. How can I boot from drive b:? (rev: 24 Mar 1994)
  1055.  
  1056.     Downloadable shareware:
  1057.  
  1058.         /pub/msdos/diskutil/boot_b.zip from SimTel
  1059.         /pc/bootutil/boot_b.zip from Garbo.
  1060.  
  1061.     The included documentation says it works by writing a new boot
  1062.     sector on a disk in your a: drive that redirects the boot to your b:
  1063.     drive.  (A similar utility is bboot.zip in the same directory at
  1064.     Garbo only.)
  1065.  
  1066.     If that doesn't work, you can always interchange your a: and b:
  1067.     drives by switching ribbon cables and changing the setup in your
  1068.     BIOS.  From an article posted 27 Jan 1993 on another newsgroup:
  1069.  
  1070.     Take the "ribbon" connector, as you call it, and switch them.  To
  1071.     double check, start at the end of the cable that connects to the
  1072.     motherboard or floppy controller.  Follow the cable until you get to
  1073.     the first connector.  Connect this to the drive you want to be b:.
  1074.     After this, there should be a few lines on the cable that get
  1075.     flipped left to right.  (On most cables, they just cut the lines and
  1076.     physically reverse them.  It should be quite obvious from looking at
  1077.     the cable.)  Anyway, the connector after the pins get flipped right
  1078.     to left is the connector for your a: drive.
  1079.  
  1080. Subject:  403. Which real and virtual disk drives are valid? (rev: 15
  1081.                Aug 1993)
  1082.  
  1083.     Use INT 21 AH=29 (parse filename).  Point DS:SI at a null-terminated
  1084.     ASCII string that contains the drive letter and a colon, point ES:DI
  1085.     at a 37-byte dummy FCB buffer, and call INT 21 AX=2900.  On return,
  1086.     AL is FF if the drive is invalid, something else if the drive is
  1087.     valid.  RAM disks and SUBSTed drives are considered valid.
  1088.  
  1089.     You can detect whether the drive is ASSIGNed by using INT 2F
  1090.     AX=0601.  To check whether the drive is SUBSTed, use INT 21 AX=4409;
  1091.     or use INT 21 AH=52 to test for both JOIN and SUBST.  See Ralf
  1092.     Brown's interrupt list (Q C03).
  1093.  
  1094.     Unfortunately, the b: drive is considered valid even on a single-
  1095.     diskette system.  You can check that special case by interrogating
  1096.     the BIOS equipment byte at 0040:0010.  Bits 7-6 contain the one less
  1097.     than the number of diskette drives, so if those bits are zero you
  1098.     know that b: is an invalid drive even though function 29 says it's
  1099.     valid.
  1100.  
  1101.     Following is some code originally posted by Doug Dougherty to test
  1102.     valid drives (treating SUBSTed and JOINed drives as valid), with my
  1103.     fix for the b: special case, tested in Borland C++ 2.0 (in the small
  1104.     model):
  1105.  
  1106.         #include <dos.h>
  1107.         #include <stdio.h>
  1108.         void drvlist(void) {
  1109.             char *s = "A:", fcb_buff[37];
  1110.             int valid;
  1111.             for (   ;  *s<='Z';  (*s)++) {
  1112.                 _SI = (unsigned) s;
  1113.                 _DI = (unsigned) fcb_buff;
  1114.                 _ES = _DS;
  1115.                 _AX = 0x2900;
  1116.                 geninterrupt(0x21);
  1117.                 valid = _AL != 0xFF;
  1118.                 if (*s == 'B'  &&  valid) {
  1119.                     char far *equipbyte = (char far *)0x00400010UL;
  1120.                     valid = (*equipbyte & (3 << 6)) != 0;
  1121.                 }
  1122.                 printf("Drive '%s' is %sa valid drive.\n",
  1123.                         s, valid ? "" : "not ");
  1124.             }
  1125.         }
  1126.  
  1127.     I translated this to MSC 7.0 and tested it in small model:
  1128.  
  1129.         #include <dos.h>
  1130.         #include <stdio.h>
  1131.         void drvlist(void) {
  1132.             char *s = "A:", fcb_buff[37], *buff=fcb_buff;
  1133.             int valid;
  1134.             for (   ;  *s<='Z';  (*s)++) {
  1135.                 __asm mov si,s      __asm mov di,buff
  1136.                 __asm mov ax,ds     __asm mov es,ax
  1137.                 __asm mov ax,0x2900 __asm int 21h
  1138.                 __asm xor ah,ah     __asm mov valid,ax
  1139.                 valid = (valid != 0xFF);
  1140.                 if (*s == 'B'  &&  valid) {
  1141.                     char far *equipbyte = (char far *)0x00400010UL;
  1142.                     valid = (*equipbyte & (3 << 6)) != 0;
  1143.                 }
  1144.                 printf("Drive '%s' is %sa valid drive.\n",
  1145.                         s, valid ? "" : "not ");
  1146.             }
  1147.         }
  1148.  
  1149. Subject:  404. How can I make my single floppy drive both a: and b:?
  1150.  
  1151.     Under any DOS since DOS 2.0, you can put the command
  1152.  
  1153.         assign b=a
  1154.  
  1155.     into your AUTOEXEC.BAT file.  Then, when you type "dir b:" you'll no
  1156.     longer get the annoying prompt to insert diskette B (and the even
  1157.     more annoying prompt to insert A the next time you type "dir a:").
  1158.  
  1159.     You may be wondering why anybody would want to do this.  Suppose you
  1160.     use two different machines, maybe one at home and one at work.  One
  1161.     of them has only a 3.5" diskette drive; the other machine has two
  1162.     drives, and b: is the 3.5" one.  You're bound to type "dir b:" on
  1163.     the first one, and get the nuisance message
  1164.  
  1165.         Insert diskette for drive B: and press any key when ready.
  1166.  
  1167.     But if you assign drive b: to point to a:, you avoid this problem.
  1168.  
  1169.     Caution:  there are a few commands, such as DISKCOPY, that will not
  1170.     work right on ASSIGNed or SUBSTed drives.  See the DOS manual for
  1171.     the full list.  Before typing one of those commands, be sure to turn
  1172.     off the mapping by typing "assign" without arguments.
  1173.  
  1174.     The DOS 5.0 manual says that ASSIGN is obsolete, and recommends the
  1175.     equivalent form of SUBST: "subst b: a:\".  Unfortunately, if this
  1176.     command is executed when a: doesn't hold a diskette, the command
  1177.     fails.  ASSIGN doesn't have this problem, so under DOS 5.0 you
  1178.     should disregard that particular bit of advice in the manual.
  1179.  
  1180. Subject:  405. How can I disable access to a drive? (new: 15 Aug 1993)
  1181.  
  1182.     Reader Eric DeVolder writes that he has made available a program to
  1183.     do this.  I haven't tried it, but it's downloadable as
  1184.  
  1185.         /pub/msdos/diskutil/rmdriv20.zip from SimTel
  1186.         /pc/sysutil/rmdriv20.zip at Garbo.
  1187.  
  1188. Subject:  406. How can a batch file test existence of a directory? (rev:
  1189.                28 May 1994)
  1190.  
  1191.     The standard way, which in fact is documented in the DOS manual, is
  1192.  
  1193.         if exist d:\path\nul goto found
  1194.  
  1195.     Unfortunately, this is not entirely reliable.  I found it failed in
  1196.     Pathworks (a/k/a PCSA, DEC's network that connects PCs and VAXes),
  1197.     or on a MARS box that uses an OEM version of MS-DOS 5.0.  Readers
  1198.     have reported that it gave the wrong answer on Novell networks, on
  1199.     DR-DOS, and in a DOS window under OS/2.  By "failed" I mean that it
  1200.     "found" a directory that didn't exist, or failed to find one that
  1201.     did exist, or both.  (I'm told that IBM fixed the OS/2 bug in
  1202.     version 2.11 of OS/2.)
  1203.  
  1204.     There appears to be no foolproof way to use pure batch commands to
  1205.     test for existence of a directory.  The real solution is to write a
  1206.     program, which returns a value that your batch program can then test
  1207.     with an "if errorlevel".  Reader Duncan Murdoch kindly posted the
  1208.     following Turbo Pascal version:
  1209.  
  1210.         program existdir;
  1211.             { Confirms the existence of a directory given on the command
  1212.             line.  Returns errorlevel 2 on error, 1 if not found, 0 if
  1213.             found. }
  1214.  
  1215.         uses
  1216.             dos;
  1217.  
  1218.         var
  1219.             s : searchrec;
  1220.  
  1221.         begin
  1222.             if paramcount <> 1 then
  1223.             begin
  1224.                 writeln('Syntax:  EXISTDIR directory');
  1225.                 halt(2);
  1226.             end
  1227.             else
  1228.             begin
  1229.                 findfirst(paramstr(1),Directory,S);
  1230.                 while (Doserror = 0) and ((Directory and S.Attr) = 0) do
  1231.                     findnext(S);
  1232.                 if Doserror <> 0 then
  1233.                 begin
  1234.                     Writeln('Directory not found.');
  1235.                     halt(1);
  1236.                 end
  1237.                 else
  1238.                 begin
  1239.                     Writeln('Directory found.');
  1240.                     halt(0);
  1241.                 end;
  1242.             end;
  1243.         end.
  1244.  
  1245.     Timo Salmi also has a Turbo Pascal version in his Turbo Pascal FAQ,
  1246.     which is downloadable as
  1247.  
  1248.         /pc/ts/tsfaqp18.zip at Garbo
  1249.         /pub/msdos/info/tsfaqp18.zip at SimTel.
  1250.  
  1251. Subject:  407. Why won't my C program open a file with a path?
  1252.  
  1253.     You've probably got something like the following code:
  1254.  
  1255.         char *filename = "c:\foo\bar\mumble.dat";
  1256.         FILE *fptr;
  1257.         . . .
  1258.         fptr = fopen(filename, "r");
  1259.  
  1260.     The problem is that \f is a form feed, \b is a backspace, and \m is
  1261.     m.  Whenever you want a backslash in a string constant in C, you
  1262.     must use two backslashes:
  1263.  
  1264.         char *filename = "c:\\foo\\bar\\mumble.dat";
  1265.  
  1266.     This is a feature of every C compiler, because Dennis Ritchie
  1267.     designed C this way.  It's a problem only on MS-DOS systems, because
  1268.     only DOS (and Atari ST/TT running TOS) uses the backslash in
  1269.     directory paths.  But even in DOS this backslash convention applies
  1270.     _only_ to string constants in your source code.  For file and
  1271.     keyboard input at run time, \ is just a normal character, so users
  1272.     running your program would type in file specs the same way as in DOS
  1273.     commands, with single \ characters.
  1274.  
  1275.     Another possibility is to code all paths in source programs with /
  1276.     rather than \ characters:
  1277.  
  1278.         char *filename = "c:/foo/bar/mumble.dat";
  1279.  
  1280.     Ralf Brown writes, "All versions of the DOS kernel accept either
  1281.     forward or backslashes as directory separators.  I tend to use this
  1282.     form more frequently than backslashes since it is easier to type and
  1283.     read."  This applies to DOS function calls (and therefore to calls
  1284.     to the file library of every programming language), but not to DOS
  1285.     commands.
  1286.  
  1287. Subject:  408. How can I redirect printer output to a file? (rev: 16 Aug
  1288.                1993)
  1289.  
  1290.     Recommended: PRN2FILE from PC Magazine, downloadable as:
  1291.  
  1292.         /pub/msdos/printer/prn2file.zip at SimTel
  1293.         /pc/printer/prn2file.zip at Garbo.
  1294.  
  1295.     PC Magazine has given copies away as part of its utilities disks, so
  1296.     you may already have a copy.
  1297.  
  1298.     The directories mentioned above have lots of other utilities to
  1299.     redirect printer output.
  1300.  
  1301. Subject:  409. How can I redirect the output of a batch file? (rev: 24
  1302.                Mar 1994)
  1303.  
  1304.     Assuming the batch file is called batch.bat, to send its output
  1305.     (stdout) to another file, just invoke COMMAND.COM as a secondary
  1306.     command processor:
  1307.  
  1308.         command /c batch parameters_if_any >outfile
  1309.  
  1310.     Timo Salmi's notes on this and other batch tricks are downloadable:
  1311.  
  1312.         /pub/msdos/batutil/tsbat44.zip at SimTel
  1313.         /pc/ts/tsbat44.zip at Garbo.
  1314.  
  1315. Subject:  410. How can I redirect stderr? (rev: 24 Mar 1994)
  1316.  
  1317.     Use freopen(..., stderr) and then execute the desired command via
  1318.     system().  There are downloadable versions of programs to do this.
  1319.     I recommend this file, which includes TP4 source and executable:
  1320.  
  1321.         /pub/msdos/sysutil/rdstderr.zip from SimTel.
  1322.  
  1323.     A C example is downloadable as
  1324.  
  1325.         /pub/msdos/c/redirect.c from SimTel.
  1326.  
  1327.     I compiled it with MSC 7.0, and it works fine with one exception:
  1328.     Contrary to the included comments, redirected output starts writing
  1329.     at the beginning of the output file rather than appending.  That is
  1330.     easily solved by adding "fseek(stderr, 0L, SEEK_END);" after the
  1331.     freopen() call for stderr.
  1332.  
  1333. Subject:  411. How can my program open more files than DOS's limit of
  1334.                20? (rev: 12 Sep 1993)
  1335.  
  1336.     This is a summary of an article Ralf Brown posted on 8 August 1992,
  1337.     with some additions from a Microsoft tech note and information from
  1338.     Chin Huang.)
  1339.  
  1340.     DOS imposes some limits.  Once you overcome those, which is pretty
  1341.     easy, you may have to take additional measures to overcome the
  1342.     limitations built into your compiler's run-time library.
  1343.  
  1344.     1) Limitations imposed by DOS
  1345.  
  1346.     There are separate limits on files and file handles.  For example,
  1347.     DOS opens three files but five file handles:  CON (stdin, stdout,
  1348.     and stderr), AUX (stdaux), and PRN (stdprn).
  1349.  
  1350.     The limit in FILES= in CONFIG.SYS is a system-wide limit on files
  1351.     opened by all programs (including the three that DOS opens and any
  1352.     opened by TSRs); each process has a limit of 20 handles (including
  1353.     the five that DOS opens).  Example:  CONFIG.SYS has FILES=40.  Then
  1354.     program #1 will be able to open 15 file handles.  Assuming that the
  1355.     program actually does open 15 handles pointing to 15 different
  1356.     files, other programs could still open a total of 22 files (40-3-15
  1357.     = 22), though no one program could open more than 15 file handles.
  1358.  
  1359.     If you're running DOS 3.3 or later, you can increase the per-process
  1360.     limit of 20 file handles by a call to INT 21 AH=67, Set Handle
  1361.     Count.  Your program is still limited by the system-wide limit on
  1362.     open files, so you may also need to increase the FILES= value in
  1363.     your CONFIG.SYS file (and reboot).  The run-time library that you're
  1364.     using may have a fixed-size table of file handles, so you may also
  1365.     need to get source code for the module that contains the table,
  1366.     increase the table size, and recompile it.
  1367.  
  1368.     2) Limitations in Microsoft C run-time library
  1369.  
  1370.     In Microsoft C the run-time library limits you to 20 file handles.
  1371.     To change this, you must be aware of two limits:
  1372.  
  1373.     - file handles used with _open(), _read(), etc.: Edit _NFILE_ in
  1374.       CRT0DAT.ASM.
  1375.  
  1376.     - stream files used with fopen(), fread(), etc.: Edit _NFILE_ in
  1377.       _FILE.C for DOS or FILE.ASM for Windows/QuickWin.  This must not
  1378.       exceed the value of _NFILE_ in CRT0DAT.ASM.
  1379.  
  1380.     (QuickWin uses the constant _WFILE_ in CRT0DAT.ASM and WFILE.ASM for
  1381.     the maximum number of child text windows.)
  1382.  
  1383.     After changing the limits, recompile using CSTARTUP.BAT.  Microsoft
  1384.     recommends that you first read README.TXT in the same directory.
  1385.  
  1386.     3) Limitations in Borland C++ run-time library
  1387.  
  1388.     (Reader Chin Huang provided this information on 12 Sep 1993.)
  1389.  
  1390.     To increase the open file limit for a program you compile with
  1391.     Borland C++ 3.1, edit the file _NFILE.H in the include directory and
  1392.     change the _NFILE_ value.  Compile and link the modules FILES.C and
  1393.     FILES2.C from the lib directory into your program.
  1394.  
  1395. Subject:  412. How can I read, create, change, or delete the volume
  1396.                label?
  1397.  
  1398.     In DOS 5.0 (and possibly in 4.0 as well), there are actually two
  1399.     volume labels: the LABEL command reports only the first but changes
  1400.     both of them.
  1401.  
  1402.     - The traditional volume label is an entry with "volume label"
  1403.       attribute in the root directory of the disk.  The DIR, VOL, and
  1404.       LABEL commands report this volume label, and LABEL sets it.
  1405.  
  1406.     - There is a second volume label, which may be different, in the
  1407.       boot record along with the serial number. In DOS 4.0 and later,
  1408.       INT 21 AH=69 gets or sets the boot record's serial number and
  1409.       volume label together; see "413. How can I get the disk serial
  1410.       number?"  DIR and VOL ignore this volume label; the LABEL command
  1411.       doesn't report it but does set it.
  1412.  
  1413.     The rest of this answer assumes that by "volume label" you mean the
  1414.     traditional one, the one that DIR and VOL display.  Though it's a
  1415.     directory entry in the root directory, you can't change it using the
  1416.     newer DOS file-access functions (INT 21 AH=3C, 41, 43); instead, use
  1417.     the old FCB-oriented directory functions.  Specifically, you need to
  1418.     allocate a 64-byte buffer and a 41- byte extended FCB (file control
  1419.     block).  Call INT 21 AH=1A to find out whether there is a volume
  1420.     label.  If there is, AL returns 0 and you can change the label using
  1421.     DOS function 17 or delete it using DOS function 13.  If there's no
  1422.     volume label, function 1A will return FF and you can create a label
  1423.     via function 16.  Important points to notice are that ? wildcards
  1424.     are allowed but * are not; the volume label must be space filled not
  1425.     null terminated.
  1426.  
  1427.     The following MSC 7.0 code worked for me in DOS 5.0; the functions
  1428.     it uses have been around since DOS 2.0.  The function parameter is 0
  1429.     for the current disk, 1 for a:, 2 for b:, etc.  It doesn't matter
  1430.     what your current directory is; these functions always search the
  1431.     root directory for volume labels.  (I didn't try to change the
  1432.     volume label of any networked drives.)
  1433.  
  1434.         // Requires DOS.H, STDIO.H, STRING.H
  1435.         void vollabel(unsigned char drivenum) {
  1436.             static unsigned char extfcb[41], dta[64], status, *newlabel;
  1437.             int chars_got = 0;
  1438.             #define DOS(buff,func) __asm { __asm mov dx,offset buff   \
  1439.                 __asm mov ax,seg buff  __asm push ds  __asm mov ds,ax \
  1440.                 __asm mov ah,func  __asm int 21h  __asm pop ds        \
  1441.                 __asm mov status,al }
  1442.             #define getlabel(buff,prompt) newlabel = buff;  \
  1443.                 memset(newlabel,' ',11);  printf(prompt);   \
  1444.                 scanf("%11[^\n]%n", newlabel, &chars_got);  \
  1445.                 if (chars_got < 11) newlabel[chars_got] = ' ';
  1446.  
  1447.             // Set up the 64-byte transfer area used by function 1A.
  1448.             DOS(dta, 1Ah)
  1449.             // Set up an extended FCB and search for the volume label.
  1450.             memset(extfcb, 0, sizeof extfcb);
  1451.             extfcb[0] = 0xFF;           // denotes extended FCB
  1452.             extfcb[6] = 8;              // volume-label attribute bit
  1453.             extfcb[7] = drivenum;       // 1=A,2=B,...; 0=current drive
  1454.             memset(&extfcb[8], '?', 11);// wildcard *.*
  1455.             DOS(extfcb,11h)
  1456.             if (status == 0) {          // DTA has volume label's FCB
  1457.                 printf("volume label is %11.11s\n", &dta[8]);
  1458.                 getlabel(&dta[0x18],
  1459.                     "new label (\"delete\" to delete): ");
  1460.                 if (chars_got == 0)
  1461.                     printf("label not changed\n");
  1462.                 else if (strncmp(newlabel,"delete  ",11) == 0) {
  1463.                     DOS(dta,13h)
  1464.                     printf(status ? "label failed\n" :
  1465.                                     "label deleted\n");
  1466.                 }
  1467.                 else {                  // user wants to change label
  1468.                     DOS(dta,17h)
  1469.                     printf(status ? "label failed\n" :
  1470.                                     "label changed\n");
  1471.                 }
  1472.             }
  1473.             else {                      // no volume label was found
  1474.                 printf("disk has no volume label.\n");
  1475.                 getlabel(&extfcb[8], "new label (<Enter> for none): ");
  1476.                 if (chars_got > 0) {
  1477.                     DOS(extfcb,16h)
  1478.                     printf(status ? "label failed\n" :
  1479.                                     "label created\n");
  1480.                 }
  1481.             }
  1482.         }        // end function vollabel
  1483.  
  1484. Subject:  413. How can I get the disk serial number?
  1485.  
  1486.     Use INT 21.  AX=6900 gets the serial number; AX=6901 sets it.  See
  1487.     Ralf Brown's interrupt list (Q C03), or PC Magazine July 1992
  1488.     (xi:13) page 496, for details.
  1489.  
  1490.     This function also gets and sets the volume label in the boot
  1491.     record, which is not necessarily the same as "the" volume label
  1492.     displayed by the DIR, VOL, and LABEL commands.  For that volume
  1493.     label, see "412. How can I read, create, change, or delete the
  1494.     volume label?"
  1495.  
  1496. Subject:  414. What's the format of .OBJ, .EXE., .COM files?
  1497.  
  1498.     Please see "206. What's the format of an .OBJ file?"; "207. What's
  1499.     the format of an .EXE header?"; and "208. What's the difference
  1500.     between .COM and .EXE formats?"
  1501.  
  1502. Subject:  415. How can I flush the software disk cache?
  1503.  
  1504.     Please see "701. How can a program reboot my PC?"
  1505.  
  1506.  
  1507. section 5. Serial ports (COM ports)
  1508. ===================================
  1509.  
  1510. Subject:  501. How do I set my machine up to use COM3 and COM4?
  1511.  
  1512.     Unless your machine is fairly old, it's probably already set up.
  1513.     After installing the board that contains the extra COM port(s),
  1514.     check the I/O addresses in word 0040:0004 or 0040:0006.  (In DEBUG,
  1515.     type "D 40:4 L4" and remember that every word is displayed low byte
  1516.     first, so if you see "03 56" the word is 5603.)  If those addresses
  1517.     are nonzero, your PC is ready to use the ports and you don't need
  1518.     the rest of this answer.
  1519.  
  1520.     If the I/O address words in the 0040 segment are zero after you've
  1521.     installed the I/O board, you need some code to store these values
  1522.     into the BIOS data segment:
  1523.  
  1524.         0040:0004  word  I/O address of COM3
  1525.         0040:0006  word  I/O address of COM4
  1526.         0040:0011  byte (bits 3-1): number of serial ports installed
  1527.  
  1528.     The documentation with your I/O board should tell you the port
  1529.     addresses.  When you know the proper port addresses, you can add
  1530.     code to your program to store them and the number of serial ports
  1531.     into the BIOS data area before you open communications.  Or you can
  1532.     use DEBUG to create a little program to include in your AUTOEXEC.BAT
  1533.     file, using this script:
  1534.  
  1535.         n SET_ADDR.COM      <--- or a different name ending in .COM
  1536.         a 100
  1537.         mov  AX,0040
  1538.         mov  DS,AX
  1539.         mov  wo [0004],aaaa <--- replace aaaa with COM3 address or 0
  1540.         mov  wo [0006],ffff <--- replace ffff with COM4 address or 0
  1541.         and  by [0011],f1
  1542.         or   by [0011],8    <--- use number of serial ports times 2
  1543.         mov  AH,0
  1544.         int  21
  1545.                             <--- this line must be blank
  1546.         rCX
  1547.         1f
  1548.         rBX
  1549.         0
  1550.         w
  1551.         q
  1552.  
  1553. Subject:  502. How do I find the I/O address of a COM port? (rev: 24 Mar
  1554.                1994)
  1555.  
  1556.     Look in the four words beginning at 0040:0000 for COM1 through COM4.
  1557.     (The DEBUG command "D 40:0 L8" will do this.  Remember that words
  1558.     are stored and displayed low byte first, so a word value of 03F8
  1559.     will be displayed as F8 03.)  If the value is zero, that COM port is
  1560.     not installed (or you've got an old BIOS; see "501. How do I set my
  1561.     machine up to use COM3 and COM4?").  If the value is nonzero, it is
  1562.     the I/O address of the transmit/receive register for the COM port.
  1563.     Each COM port occupies eight consecutive I/O addresses (though many
  1564.     chips use only the first seven).
  1565.  
  1566.     Here's some C code to find the I/O address:
  1567.  
  1568.         unsigned ptSel(unsigned comport) {
  1569.             unsigned io_addr;
  1570.             if (comport >= 1  &&  comport <= 4) {
  1571.                 unsigned far *com_addr = (unsigned far *)0x00400000UL;
  1572.                 io_addr = com_addr[comport-1];
  1573.             }
  1574.             else
  1575.                 io_addr = 0;
  1576.             return io_addr;
  1577.         }
  1578.  
  1579.     You might also want to explore Port Finder, downloadable as
  1580.  
  1581.         /pub/msdos/io_util/pf271.zip at SimTel
  1582.         /pub/msdos/utilities/sysutl/pf271.zip at nic.funet.fi
  1583.  
  1584.     I haven't tried it myself, but a posted article reviewed it very
  1585.     favorably and said it also lets you swap ports around.
  1586.  
  1587. Subject:  503. But aren't the COM ports always at I/O addresses 3F8,
  1588.                2F8, 3E8, and 2E8?
  1589.  
  1590.     The first two are usually right (though not always); the last two
  1591.     are different on many machines.
  1592.  
  1593. Subject:  504. How do I configure a COM port and use it to transmit
  1594.                data? (rev: 17 Sep 1993)
  1595.  
  1596.     Do you want actual code, or do you want books that explain what's
  1597.     going on?
  1598.  
  1599.     1) Source code
  1600.  
  1601.     First, check your compiler's run-time library.  Many compilers offer
  1602.     functions similar to Microsoft C's _bios_serialcom() or Borland's
  1603.     bioscom(), which may meet your needs.
  1604.  
  1605.     Second, check for downloadable resources at SimTel and Garbo.  At
  1606.     SimTel, /pub/msdos/c/pcl4c34.zip (March 1993) is described as
  1607.     "Asynchronous communications library for C"; Garbo has a whole
  1608.     /pc/comm directory.  Also, an extended example is in Borland's
  1609.     TechFax TI445, downloadable as part of
  1610.  
  1611.         /pub/msdos/turbo-c/bchelp10.zip at SimTel
  1612.         /pc/turbopas/bchelp10.zip at Garbo.
  1613.  
  1614.     Though written by Borland, much of it is applicable to other forms
  1615.     of C, and it should give you ideas for other programming languages.
  1616.  
  1617.     2) Reference books
  1618.  
  1619.     Highly recommended: Joe Campbell's {C Programmer's Guide to Serial
  1620.     Communications}, ISBN 0-672-22584-0.  He gives complete details on
  1621.     how serial ports work, along with complete programs for doing polled
  1622.     or interrupt-driver I/O.  The book is quite thick, and none of it
  1623.     looks like filler.
  1624.  
  1625.     If Campbell's book is overkill for you, you'll find a good short
  1626.     description of serial I/O in {DOS 5: A Developer's Guide}, ISBN
  1627.     1-55851-177-6, by Al Williams.
  1628.  
  1629.     Finally, a reader has recommended {Serial Communications Programming
  1630.     in C/C++} by Mark Goodwin (ISBN 1558281983), with source code in the
  1631.     book and on disk.  Topics include the basics, various methods of
  1632.     serial communications on the PC (with consideration of high-speed
  1633.     modems), ANSI screen interface, file transfer protocols (Xmodem and
  1634.     Ymodem), etc.  There is code in C, and that code is extended into a
  1635.     C++ class for those who use C++.  There are also subroutines in
  1636.     Assembly.
  1637.  
  1638.     3) Downloadable information files
  1639.  
  1640.     A "Serial Port FAQ" is occasionally posted to this newsgroup, and is
  1641.     downloadable as multiple files:
  1642.  
  1643.         /pub/usenet/comp.os.msdos.programmer/T_S_P*_3 from rtfm.mit.edu
  1644.         /pub/E-Technik/afd/*Serial* from pfsparc02.phil15.uni-sb.de.
  1645.  
  1646.     For rtfm.mit.edu instructions, see "C06. Where are FAQ lists
  1647.     archived?"
  1648.  
  1649.     (The uni-sb.de archive administrator warns that the ftp address may
  1650.     change, sometime in the future, to etcip1.ee.uni-sb.de.)
  1651.  
  1652.  
  1653. section 6. Other hardware questions and problems
  1654. ================================================
  1655.  
  1656. Subject:  601. Which 80x86 CPU is running my program? (rev: 24 Mar 1994)
  1657.  
  1658.     According to an article posted by Michael Davidson, Intel's approved
  1659.     code for distinguishing among 8086, 80286, 80386, and 80486 and for
  1660.     detecting the presence of an 80287 or 80387 is published in Intel's
  1661.     486SX processor manual (order number 240950-001).  David
  1662.     Kirschbaum's improved version of this is downloadable as
  1663.  
  1664.         /pub/msdos/sysinfo/cpuid593.zip from SimTel
  1665.         /pc/sysinfo/cpuid593.zip from Garbo.
  1666.  
  1667.     According to an article posted by its author, WCPU knows the
  1668.     differences between DX and SX varieties of 386 and 486 chips, and
  1669.     can detect a math coprocessor and a Pentium.  It's downloadable as
  1670.  
  1671.         /pub/msdos/sysinfo/wcpu050.zip at SimTel
  1672.         /pc/sysinfo/wcpu050.zip at Garbo.
  1673.  
  1674. Subject:  602. How can a C program send control codes to my printer?
  1675.  
  1676.     If you just fprintf(stdprn, ...), C will translate some of your
  1677.     control codes.  The way around this is to reopen the printer in
  1678.     binary mode:
  1679.  
  1680.         prn = fopen("PRN", "wb");
  1681.  
  1682.     You must use a different file handle because stdprn isn't an lvalue.
  1683.     By the way, PRN or LPT1 must not be followed by a colon in DOS 5.0.
  1684.  
  1685.     There's one special case, Ctrl-Z (ASCII 26), the DOS end-of-file
  1686.     character.  If you try to send an ASCII 26 to your printer, DOS
  1687.     simply ignores it.  To get around this, you need to reset the
  1688.     printer from "cooked" to "raw" mode.  Microsoft C users must use INT
  1689.     21 AH=44, "get/set device information".  Turbo C and Borland C++
  1690.     users can use ioctl to accomplish the same thing:
  1691.  
  1692.         ioctl(fileno(prn), 1, ioctl(fileno(prn),0) & 0xFF | 0x20, 0);
  1693.  
  1694.     An alternative approach is simply to write the printer output into a
  1695.     disk file, then copy the file to the printer with the /B switch.
  1696.  
  1697.     A third approach is to bypass DOS functions entirely and use the
  1698.     BIOS printer functions at INT 17.  If you also fprintf(stdprn,...)
  1699.     in the same program, you'll need to use fflush() to synchronize
  1700.     fprintf()'s buffered output with the BIOS's unbuffered.
  1701.  
  1702.     By the way, if you've opened the printer in binary mode from a C
  1703.     program, remember that outgoing \n won't be translated to carriage
  1704.     return/line feed.  Depending on your printer, you may need to send
  1705.     explicit \n\r sequences.
  1706.  
  1707. Subject:  603. How can I redirect printer output to a file?
  1708.  
  1709.     Please see "408. How can I redirect printer output to a file?"
  1710.  
  1711. Subject:  604. Which video adapter is installed?
  1712.  
  1713.     The technique below should work if your BIOS is not too old.  It
  1714.     uses three functions from INT 10, the BIOS video interrupt.  (If
  1715.     you're using a Borland language, you may not have to do this the
  1716.     hard way.  Look for a function called DetectGraph or something
  1717.     similar.)
  1718.  
  1719.     Set AX=1200, BL=32 and call INT 10.  If AL returns 12, you have a
  1720.     VGA.  If not, set AH=12, BL=10 and call INT 10 again.  If BL returns
  1721.     0,1,2,3, you have an EGA with 64,128,192,256K memory.  If not, set
  1722.     AH=0F and call INT 10 a third time.  If AL is 7, you have an MDA
  1723.     (original monochrome adapter) or Hercules; if not, you have a CGA.
  1724.  
  1725.     This worked when tested with a VGA, but I had no other adapter types
  1726.     to test it with.
  1727.  
  1728. Subject:  605. How do I switch to 43- or 50-line mode?
  1729.  
  1730.     /pub/msdos/screen/vidmode.zip, downloadable from SimTel, contains
  1731.     .COM utilities and .ASM source code.
  1732.  
  1733. Subject:  606. How can I find the Microsoft mouse position and button
  1734.                status?
  1735.  
  1736.     Use INT 33 AH=3, described in Ralf Brown's interrupt list (Q C03).
  1737.  
  1738.     The Windows manual says that the Logitech mouse is compatible with
  1739.     the Microsoft one, so the interrupt will probably work the same.
  1740.  
  1741.     Also, many files are downloadable from
  1742.  
  1743.         /pub/msdos/mouse/*.* at SimTel.
  1744.  
  1745. Subject:  607. How can I access a specific address in the PC's memory?
  1746.                (rev: 24 March 1994)
  1747.  
  1748.     First check the library that came with your compiler.  Many vendors
  1749.     have some variant of peek and poke functions; in Turbo Pascal use
  1750.     the pseudo-arrays Mem, MemW, and MemL.  As an alternative, you can
  1751.     construct a far pointer:  use Ptr in Turbo Pascal; MK_FP in the
  1752.     Turbo C/Borland C family and recent versions of Microsoft C; or
  1753.     FP_OFF and FP_SEG in all versions of Microsoft C.
  1754.  
  1755.     Caution:  Turbo C and Turbo C++ also have FP_OFF and FP_SEG macros,
  1756.     but they can't be used to construct a pointer.  In Borland C++ those
  1757.     macros work the same as in Microsoft C, but MK_FP is easier to use.
  1758.  
  1759.     By the way, it's not useful to talk about "portable" ways to do
  1760.     this.  Any operation that is tied to a specific memory address is
  1761.     not likely to work on another kind of machine.
  1762.  
  1763. Subject:  608. How can I read or write my PC's CMOS memory? (rev: 24 Mar
  1764.                1994)
  1765.  
  1766.     There are a great many public-domain utilities that do this.  These
  1767.     are downloadable from SimTel in directory /pub/msdos/at:
  1768.  
  1769.         cmos14.zip     5965  920817  Saves/restores CMOS to/from file
  1770.         cmoser11.zip  28323  910721  386/286 enhanced CMOS setup program
  1771.         cmosram.zip   76096  920214  Save AT/386/486 CMOS data to file
  1772.             and restore
  1773.         rom2.zip      15692  900131  Save AT and 386 CMOS data to file
  1774.             and restore
  1775.         setup21.zip   18172  880613  Setup program which modifies CMOS
  1776.             RAM
  1777.         viewcmos.zip  11068  900225  Display contents of AT CMOS RAM,
  1778.             w/C source
  1779.  
  1780.     A program to check and display CMOS memory (but not write to it) is
  1781.     downloadable as part of
  1782.  
  1783.         /pc/ts/tsutle22.zip at Garbo
  1784.         /pub/msdos/sysutil/tsutle22.zip at SimTel.
  1785.  
  1786.     Good reports of CMOS299.ZIP, available in the pc.dir directory of
  1787.     cantva.canterbury.ac.nz [132.181.30.3], have been posted.
  1788.  
  1789.     Of the above, my only experience is with CMOSRAM, which seems to
  1790.     work fine.  It contains an excellent (and witty) .DOC file that
  1791.     explains the hardware involved and gives specific recommendations
  1792.     for preventing disaster or recovering from it.  It's $5 shareware.
  1793.  
  1794.     Robert Jourdain's {Programmer's Problem Solver for the IBM PC, XT,
  1795.     and AT} has code for accessing the CMOS RAM, according to an article
  1796.     posted in this newsgroup.
  1797.  
  1798. Subject:  609. How can I access memory beyond 640K? (rev: 24 Mar 1994)
  1799.  
  1800.     PC Magazine 29 June 1993 (xii:12) pages 302-304 carry an article,
  1801.     "How DOS Programs Can Use Over 1MB of RAM".
  1802.  
  1803.  
  1804. section 7. Other software questions and problems
  1805. ================================================
  1806.  
  1807. Subject:  701. How can a program reboot my PC? (rev: 24 Mar 1994)
  1808.  
  1809.     You can generate a "cold" boot or a "warm" boot.  A cold boot is the
  1810.     same as turning the power off and on; a warm boot is the same as
  1811.     Ctrl-Alt-Del and skips the power-on self 'test.
  1812.  
  1813.     For a warm boot, store the hex value 1234 in the word at 0040:0072.
  1814.     For a cold boot, store 0 in that word.  Then, if you want to live
  1815.     dangerously, jump to address FFFF:0000.  Here's C code to do it:
  1816.  
  1817.         /* WARNING:  data loss possible */
  1818.         void bootme(int want_warm)  /* arg 0 = cold boot, 1 = warm */ {
  1819.             void (far* boot)(void) = (void (far*)(void))0xFFFF0000UL;
  1820.             unsigned far* type = (unsigned far*)0x00400072UL;
  1821.             *type = (want_warm ? 0x1234 : 0);
  1822.             (*boot)( );
  1823.         }
  1824.  
  1825.     What's wrong with that method?  It will boot right away, without
  1826.     closing files, flushing disk caches, etc.  If you boot without
  1827.     flushing a write-behind disk cache (if one is running), you could
  1828.     lose data or trash the file allocation table in your hard drive.
  1829.  
  1830.     There are two methods of signaling the cache to flush its buffers:
  1831.     (1) simulate a keyboard Ctrl-Alt-Del in the keystroke translation
  1832.     function of the BIOS (INT 15 AH=4F; but see notes below), and (2)
  1833.     issue a disk reset (DOS function 0D).  Most disk-cache programs hook
  1834.     one or both of those interrupts, so if you use both methods you'll
  1835.     probably be safe.
  1836.  
  1837.     When user code simulates a Ctrl-Alt-Del, one or more of the programs
  1838.     that have hooked INT 15 AH=4F can ask that the key be ignored by
  1839.     clearing the carry flag.  For example, HyperDisk does this when it
  1840.     has started but not finished a cache flush.  So if the carry flag
  1841.     comes back cleared, the boot code has to wait a couple of clock
  1842.     ticks and then try again.  (None of this matters on older machines
  1843.     whose BIOS can't support 101- or 102-key keyboards; see the
  1844.     discussion of INT 21 AH=4F in "307. What is the SysRq key for?")
  1845.  
  1846.     C code that tries to signal the disk cache (if any) to flush is
  1847.     given below.  Turbo Pascal code by Timo Salmi that does more or less
  1848.     the same job may be found at question 49 (as of this writing) in the
  1849.     Turbo Pascal FAQ in comp.lang.pascal, and is downloadable as file
  1850.     FAQPAS2.TXT, which is part of
  1851.  
  1852.         /pc/ts/tsfaqp18.zip at Garbo
  1853.         /pub/msdos/info/tsfaqp18.zip at SimTel.
  1854.  
  1855.     Here's C code that reboots after trying to signal the disk cache:
  1856.  
  1857.         #include <dos.h>
  1858.         void bootme(int want_warm)  /* arg 0 = cold boot, 1 = warm */ {
  1859.             union REGS reg;
  1860.             void    (far* boot)(void) = (void (far*)(void))0xFFFF0000UL;
  1861.             unsigned far* boottype    =     (unsigned far*)0x00400072UL;
  1862.             char     far* shiftstate  =         (char far*)0x00400017UL;
  1863.             unsigned      ticks;
  1864.             int           time_to_waste;
  1865.             /* Simulate reception of Ctrl-Alt-Del: */
  1866.             for (;;) {
  1867.                 *shiftstate |= 0x0C;    /* turn on Ctrl & Alt */
  1868.                 reg.h.ah = 0x4F;        /* see notes below */
  1869.                 reg.h.al = 0x53;        /* 0x53 = Del's scan code */
  1870.                 reg.x.cflag = 1;        /* sentinel for ignoring key */
  1871.                 int86(0x15, ®, ®);
  1872.                 /* If carry flag is still set, we've finished. */
  1873.                 if (reg.x.cflag)
  1874.                     break;
  1875.                 /* Else waste some time before trying again: */
  1876.                 reg.h.ah = 0;
  1877.                 int86(0x1A, ®, ®);/* system time into CX:DX */
  1878.                 ticks = reg.x.dx;
  1879.                 for (time_to_waste = 3;  time_to_waste > 0;  ) {
  1880.                     reg.h.ah = 0;
  1881.                     int86(0x1A, ®, ®);
  1882.                     if (ticks != reg.x.dx)
  1883.                         ticks = reg.x.dx , --time_to_waste;
  1884.                 }
  1885.             }
  1886.             /* Issue a DOS disk reset request: */
  1887.             reg.h.ah = 0x0D;
  1888.             int86(0x21, ®, ®);
  1889.             /* Set boot type and boot: */
  1890.             *boottype = (want_warm ? 0x1234 : 0);
  1891.             (*boot)( );
  1892.         }
  1893.  
  1894.     Reader Timo Salmi reported (26 July 1993) that the INT 15 AH=4F call
  1895.     may not work on older PCs (below AT, XT2, XT286), according to Ralf
  1896.     Brown's interrupt list (Q C03).
  1897.  
  1898.     Reader Roger Fulton reported (1 July 1993) that INT 15 AH=4F hangs
  1899.     even a modern PC "ONLY when ANSI.SYS [is] loaded high using
  1900.     EMM386.EXE.  (Other things loaded high with EMM386.EXE were OK;
  1901.     ANSI.SYS loaded high with QEMM386.SYS was OK; ANSI.SYS loaded low
  1902.     with EMM386.EXE installed was OK.)"  His solution was to use only
  1903.     the disk reset, INT 21 AH=0D, which does flush SMARTDRV, then wait
  1904.     five seconds in hopes that any other disk-caching software would
  1905.     have time to flush its queue.
  1906.  
  1907.     Reader Per Bergland reported (10 Sep 1993) that the jump to
  1908.     FFFF:0000 will not work in Windows or other protected-mode programs.
  1909.     (For example, when the above reboot code ran in a DOS session under
  1910.     Windows, a box with "waiting for system shutdown" appeared.  The PC
  1911.     hung and had to be reset by cycling power.)  His solution, which
  1912.     does a cold boot not a warm boot, is to pulse pin 0 of the 8042
  1913.     keyboard controller, which is connected to the CPU's "reset" line.
  1914.     He has tested the following code on various Compaqs, and expects it
  1915.     will work for any AT-class machine; he cautions that you must first
  1916.     flush the disk cache as indicated above.
  1917.  
  1918.             cli
  1919.         @@WaitOutReady:   ; Busy-wait until 8042 ready for new command
  1920.             in al,64h         ; read 8042 status byte
  1921.             test al,00000010b ; this bit indicates input buffer full
  1922.             jnz @@WaitOutReady
  1923.             mov al,0FEh       ; Pulse "reset" = 8042 pin 0
  1924.             out 64h,al
  1925.             ; The PC will reboot now
  1926.  
  1927. Subject:  702. How can I time events with finer resolution than the
  1928.                system clock's 55 ms (about 18 ticks a second)? (rev: 24
  1929.                Mar 1994)
  1930.  
  1931.         The following files, among others, are downloadable from SimTel:
  1932.  
  1933.         /pub/msdos/at :
  1934.         atim.zip       4783  881126  Precision program timing for AT
  1935.  
  1936.         /pub/msdos/c :
  1937.         millisec.zip  37734  911205  MSC/asm src for millisecond timing
  1938.         mschrt3.zip   53708  910605  High-res timer toolbox for MSC 5.1
  1939.         msec_12.zip    8484  920320  High-def timer v1.2 (C,ASM)
  1940.         ztimer11.zip  77625  920428  Microsecond timer for C, C++, ASM
  1941.             (also at Garbo as /pc/c/ztimer11.zip)
  1942.  
  1943.         /pub/msdos/turbo_c :
  1944.         tchrt3.zip    53436  910606  High-res timer for Turbo C 2.0
  1945.         tctimer.zip   15609  891030  High-res timing for Turbo C
  1946.             (same as /pc/c/tctimer.zoo at Garbo; both are version 1.0)
  1947.  
  1948.     For Turbo Pascal users, source and object code are downloadable in
  1949.  
  1950.         /pub/msdos/turbopas/bonus507.zip at SimTel
  1951.         /pc/turbopas/bonus507.zip at Garbo.
  1952.  
  1953.     Also see "Q: How is millisecond timing done?" in FAQPAS.TXT,
  1954.     downloadable as part of
  1955.  
  1956.         /pc/ts/tsfaqp18.zip at Garbo
  1957.         /pub/msdos/info/tsfaqp18.zip at SimTel.
  1958.  
  1959. Subject:  703. How can I find the error level of the previous program?
  1960.                (rev: 24 Mar 1994)
  1961.  
  1962.     First, which previous program are you talking about?  If your
  1963.     current program ran another one, when the child program ends its
  1964.     error level is available to the program that spawned it.  Most high-
  1965.     level languages provide a way to do this; for instance, in Turbo
  1966.     Pascal it's Lo(DosExitCode) and the high byte gives the way in which
  1967.     the child terminated.  In Microsoft C, the exit code of a
  1968.     synchronous child process is the return value of the spawn-type
  1969.     function that creates the process.
  1970.  
  1971.     If your language doesn't have a function to return the error code of
  1972.     a child process, you can use INT 21 AH=4D (get return code).  By the
  1973.     way, this will tell you the child's exit code and the manner of its
  1974.     ending (normal, Ctrl-C, critical error, or TSR).
  1975.  
  1976.     It's much trickier if the current program wants to get the error
  1977.     level of the program that ran and finished before this one started.
  1978.     G.A.Theall has published source and compiled code to do this; the
  1979.     code is downloadable as
  1980.  
  1981.         /pub/msdos/batutil/errlvl13.zip at SimTel
  1982.         /pc/batchutil/errlvl12.zip (an older version) at Garbo.
  1983.  
  1984.     (The code uses undocumented features in DOS 3.3 through 5.0.  Theall
  1985.     says in the .DOC file that the values returned under 4DOS or other
  1986.     replacements won't be right.)
  1987.  
  1988. Subject:  704. How can a program set DOS environment variables? (rev: 24
  1989.                Mar 1994)
  1990.  
  1991.     Program functions that read or write "the environment" typically
  1992.     access only the program's copy of it.  What this Q really wants to
  1993.     do is to modify the active environment, the one that is affected by
  1994.     SET commands in batch files or at the DOS prompt.  You need to do
  1995.     some programming to find the active environment, and that depends on
  1996.     the version of DOS.
  1997.  
  1998.     A fairly well-written article in PC Magazine 28 Nov 1989 (viii:20),
  1999.     pages 309-314, explains how to find the active environment, and
  2000.     includes Pascal source code.  The article hints at how to change the
  2001.     environment, and suggests creating paths longer than 128 characters
  2002.     as one application.
  2003.  
  2004.     Now as for downloadable source code, there are many possibilities.
  2005.     I looked at some of these, and liked
  2006.  
  2007.         /pub/msdos/envutil/rbsetnv1.zip at SimTel
  2008.         /pc/envutil/rbsetnv1.zip at Garbo
  2009.  
  2010.     the best.  It includes some utilities to manipulate the environment,
  2011.     with source code in C.  A newer program is
  2012.  
  2013.         /pub/msdos/batutil/strings2.zip at SimTel
  2014.         part of /pc/pcmag/vol11n22.zip at Garbo,
  2015.  
  2016.     which is the code from PC Magazine 22 Dec 1992 (xi:22).
  2017.  
  2018.     You can also use a call to INT 2E, Pass Command to Interpreter for
  2019.     Execution; see Ralf Brown's interrupt list (Q C03) for details and
  2020.     cautions.
  2021.  
  2022. Subject:  705. How can I change the switch character to - from /? (rev:
  2023.                20 Mar 1994)
  2024.  
  2025.     Under DOS 5.0 and above, you can't--not completely, anyway.  INT 21
  2026.     AX=3700, get switch character, always returns a '/' (hex 2F).  But
  2027.     the DOS commands don't even call that function: they simply hard
  2028.     code '/' as the switch character.
  2029.  
  2030.     Some history:  DOS used to let you change the switch character by
  2031.     using SWITCHAR= in CONFIG.SYS or by calling DOS function 3701.  DOS
  2032.     commands and other programs called DOS function 3700 to find out the
  2033.     switch character.  If you changed the switch character to '-' (the
  2034.     usual choice), you could then type "dir c:/c700 -p" rather than "dir
  2035.     c:\c700 /p".  Under DOS 4.0, the DOS commands ignored the switch
  2036.     character but functions 3700 and 3701 still worked and could be used
  2037.     by other programs.  Under DOS 5.0, even those functions no longer
  2038.     work, though all DOS functions still accept '/' or '\' in file
  2039.     specs.
  2040.  
  2041.     You can reactivate the functions to get and set switchar by using
  2042.     programs like SLASH.ZIP or the sample TSR called SWITCHAR in
  2043.     amisl091.zip (see "707. How can I write a TSR (terminate-stay-
  2044.     resident utility)?").  DOS commands will still use the slash, but
  2045.     non-DOS programs that call DOS function 3700 will use your desired
  2046.     switch character.  (DOS replacements like 4DOS may honor the switch
  2047.     character for internal commands.)
  2048.  
  2049.     Some readers may wonder why this is even an issue.  Making '-' the
  2050.     switch character frees up the front slash to separate names in the
  2051.     path part of a file spec.  This is easier for the ten-fingered to
  2052.     type, and it's one less difference to remember for commuters between
  2053.     DOS and Unix.  The switch character is the only issue, since all the
  2054.     INT 21 functions accept '/' or '\' to separate directory names.
  2055.  
  2056. Subject:  706. Why does my interrupt function behave strangely? (rev: 24
  2057.                Sep 1993)
  2058.  
  2059.     Interrupt service routines can be tricky, because you have to do
  2060.     some things differently from "normal" programs.  If you make a
  2061.     mistake, debugging is a pain because the symptoms may not point at
  2062.     what's wrong.  Your machine may lock up or behave erratically, or
  2063.     just about anything else can happen.  Here are some things to look
  2064.     for.  (See "707. How can I write a TSR (terminate-stay-resident
  2065.     utility)?" for general techniques that may prevent a problem.)
  2066.  
  2067.     First, did you fail to set up the registers at the start of your
  2068.     routine?  When your routine begins executing, you can count on
  2069.     having CS point to your code segment and SS:SP point to some valid
  2070.     stack (of unknown length), and that's it.  In particular, an
  2071.     interrupt service routine must set DS to DGROUP before accessing any
  2072.     data in its data segments.  (If you're writing in a high-level
  2073.     language, the compiler may generate this code for you automatically;
  2074.     check your compiler manual.  For instance, in Borland and Microsoft
  2075.     C, give your function the "interrupt" attribute.)
  2076.  
  2077.     Did you remember to turn off stack checking when compiling your
  2078.     interrupt server and any functions it calls?  The stack during the
  2079.     interrupt is not where the stack-checking code expects it to be.
  2080.     (Caution:  Some third-party libraries have stack checking compiled
  2081.     in, so you can't call them from your interrupt service routine.)
  2082.  
  2083.     Next, are you calling any DOS functions (INT 21, 25, or 26) in your
  2084.     routine?  DOS is not re-entrant.  This means that if your interrupt
  2085.     happens to be triggered while the CPU is executing a DOS function,
  2086.     calling another DOS function will wreak havoc.  (Some DOS functions
  2087.     are fully re-entrant, as noted in Ralf Brown's interrupt list (Q
  2088.     C03).  Also, your program can test, in a way too complicated to
  2089.     present here, when it's safe to call non-re-entrant DOS functions.
  2090.     See INT 28, INT 21 AH=34, and INT 21 AX=5D06 or 5D0B; and consult
  2091.     {Undocumented DOS} by Andrew Schulman.  Your program must read both
  2092.     the "InDOS flag" and the "critical error flag".)
  2093.  
  2094.     Is a function in your language library causing trouble?  Does it
  2095.     depend on some initializations done at program startup that is no
  2096.     longer available when the interrupt executes?  Does it call DOS (see
  2097.     preceding paragraph)?  For example, in both Borland and Microsoft C
  2098.     the memory-allocation functions (malloc(), etc..) call DOS functions
  2099.     and also depend on setups that they can't get at from inside an
  2100.     interrupt; so do the standard I/O functions like scanf() and
  2101.     printf().  Many other library functions have the same problem, so
  2102.     you can't use them inside an interrupt function without special
  2103.     precautions.
  2104.  
  2105.     Is your routine simply taking too long?  This can be a problem if
  2106.     you're hooking on to the timer interrupt, INT 1C or INT 8.  That
  2107.     interrupt expects to be called about every 55 ms, which is 18.2
  2108.     times a second.  Therefore your routine, plus any others hooked to
  2109.     the same interrupts, must execute in less than 55 ms.  If they use
  2110.     even a substantial fraction of that time, you'll see significant
  2111.     slowdowns of your foreground program.  A good discussion is
  2112.     downloadable as
  2113.  
  2114.         pub/msdos/SIMTEL20-mirror/info/intshare.zip at ni.funet.fi
  2115.         /pub/msdos/info/intshare.zip at SimTel.
  2116.  
  2117.     Did you forget to restore all registers at the end of your routine?
  2118.  
  2119.     Did you chain improperly to the original interrupt?  You need to
  2120.     restore the stack to the way it was upon entry to your routine, then
  2121.     do a far jump (not call) to the original interrupt service routine.
  2122.     (The process is a little different in high-level languages.)
  2123.  
  2124. Subject:  707. How can I write a TSR (terminate-stay-resident utility)?
  2125.                (rev: 24 Mar 1994)
  2126.  
  2127.     There are books, and there's code to download.
  2128.  
  2129.     First, the books:
  2130.  
  2131.     - Ray Duncan's {Advanced MS-DOS}, ISBN 1-55615-157-8, gives a brief
  2132.       checklist intended for experienced programmers.  The ISBN is for
  2133.       the second edition, through DOS 4; but check to see whether the
  2134.       DOS 6 version is available yet.
  2135.  
  2136.     - {DOS 5:  A Developer's Guide} by Al Williams, ISBN 1-55851-177-6,
  2137.       goes into a little more detail, 90 pages worth!
  2138.  
  2139.     - Pascal programmers might look at {The Ultimate DOS Programmer's
  2140.       Manual} by John Mueller and Wallace Wang, ISBN 0-8306-3534-3, for
  2141.       an extended example in mixed Pascal and assembler.
  2142.  
  2143.     - For a pure assembler treatment, check Steven Holzner's {Advanced
  2144.       Assembly Language}, ISBN 0-13-663014-6.  He has a book with the
  2145.       same title out from Brady Press, but it's about half as long as
  2146.       this one.
  2147.  
  2148.     Next, the code.  Some of it is companion code to published articles,
  2149.     which are also listed below:
  2150.  
  2151.     - The Alternate Multiplex Interrupt Specification, downloadable as
  2152.  
  2153.         /pub/msdos/info/altmpx35.zip at SimTel
  2154.         /pc/programming/altmpx35.zip at Garbo
  2155.         /afs/cs/user/ralf/pub/altmpx35.zip at cs.cmu.edu
  2156.  
  2157.     - Ralf Brown's assembly-language implementation of the spec, with
  2158.       utilities in C, is downloadable as
  2159.  
  2160.         /pub/msdos/asmutil/amisl091.zip at SimTel
  2161.         /pc/c/amisl091.zip at Garbo
  2162.         /afs/cs/user/ralf/pub/amisl091.zip at cs.cmu.edu
  2163.  
  2164.     - Douglas Boling's MASM template for a TSR is downloadable as
  2165.  
  2166.         /pub/msdos/asmutl/template.zip at SimTel.
  2167.  
  2168.     - A posted article mentions Boling's "Strategies and Techniques for
  2169.       Writing State-of-the-Art TSRs that Exploit MS-DOS 5", Microsoft
  2170.       Systems Journal, Jan-Feb 1992, Volume 7, Number 1, pages 41-59,
  2171.       with examples downloadable in
  2172.  
  2173.         /pub/msdos/msjournal/msjv7-1.zip at SimTel
  2174.  
  2175.     - code for Al Stevens's "Writing Terminate-and-Stay-Resident
  2176.       Programs", Computer Language, February 1988, pages 37-48 and March
  2177.       1988, pages 67-76 is downloadable as
  2178.  
  2179.         /pub/msdos/c/tsrc.zip at SimTel
  2180.  
  2181.     - software examples to accompany Kaare Christian's "Using Microsoft
  2182.       C Version 5.1 to Write Terminate-and-Stay-Resident Programs",
  2183.       Microsoft Systems Journal, September 1988, Volume 3, Number 5,
  2184.       pages 47-57 are downloadable as
  2185.  
  2186.         /pub/msdos/msjournal/msjv3-5.arc at SimTel
  2187.  
  2188.     Finally, there are commercial products, of which TesSeRact (for C-
  2189.     language TSRs) is one of the best known.
  2190.  
  2191. Subject:  708. How can I write a device driver?
  2192.  
  2193.     Many books answer this in detail.  Among them are {Advanced MS-DOS}
  2194.     and {DOS 5: A Developer's Guide}, cited in the preceding Q.  Michael
  2195.     Tischer's {PC System Programming}, ISBN 1-55755-036-0, has an
  2196.     extensive treatment, as does Dettman and Kyle's {DOS Programmer's
  2197.     Reference: 2d Edition}, ISBN 0-88022-458-4.  For a really in-depth
  2198.     treatment, look for a specialized book like Robert Lai's {Writing MS-
  2199.     DOS Device Drivers}, ISBN 0-201-13185-4.
  2200.  
  2201. Subject:  709. What can I use to manage versions of software? (rev: 21
  2202.                Aug 1993)
  2203.  
  2204.     A port of the Unix RCS utility is downloadable as
  2205.  
  2206.         /pub/msdos/gnuish/rcs55ax.zip (EXE and docs) from SimTel
  2207.         /pub/msdos/gnuish/rcs55as.zip (source) from SimTel
  2208.         /pc/unix/alrcs5ex.zip (EXE and docs ?) from Garbo.
  2209.  
  2210.     This version of RCS is no longer limited to one-character extensions
  2211.     on filenames (for example, .CPP and .BAS are now OK).
  2212.  
  2213.     An RCS56 is available at a number of archive sites, but it appears
  2214.     to be unauthorized.  In response to a query, Keith Petersen, SimTel
  2215.     administrator, said that RCS56 was removed from SimTel at the
  2216.     author's request because it did not contain source code and thus was
  2217.     in violation of the GNU copyleft.
  2218.  
  2219.     As for commercial software, I posted a question asking for readers'
  2220.     experiences in July 1993 and seven readers responded.  PVCS from
  2221.     Intersolv (formerly Polymake) got five positive reviews, though
  2222.     several readers commented that it's expensive; RCS from MKS got one
  2223.     positive and one negative review; Burton TLIB got one negative
  2224.     review; DRTS from ILSI got one positive review.
  2225.  
  2226. Subject:  710. What's this "null pointer assignment" after my C program
  2227.                executes? (rev: 20 Mar 1994)
  2228.  
  2229.     Somewhere in your program, you assigned a value _through_ a pointer
  2230.     without first assigning a value _to_ the pointer.  (This might have
  2231.     been something like a strcpy() or memcpy() with a pointer as its
  2232.     first argument, not necessarily an actual assignment statement.)
  2233.     Your program may look like it ran correctly, but if you get this
  2234.     message you can be certain that there's a bug somewhere.
  2235.  
  2236.     Microsoft and Borland C, as part of their exit code (after a call to
  2237.     exit() or a return from your main function), check whether the
  2238.     location 0000 in your data segment contains a different value from
  2239.     what you started with.  If so, they infer that you must have used an
  2240.     uninitialized pointer.  This implies that the message will appear at
  2241.     the end of execution of your program regardless of where the error
  2242.     actually occurred.
  2243.  
  2244.     To track down the problem, you can put exit() calls at various spots
  2245.     in the program and narrow down where the uninitialized pointer is
  2246.     being used by seeing which added exit() makes the null-pointer
  2247.     message disappear.  Or, if your program was compiled with small or
  2248.     medium models, which use 16-bit data pointers, tell the debugger to
  2249.     set a watch at location 0000 in your data segment.  (If data
  2250.     pointers are 32 bits, as in the compact and large models, a null
  2251.     pointer will overwrite the interrupt vectors at 0000:0000 and
  2252.     probably lock up your machine.)
  2253.  
  2254.     Under MSC/C++ 7.0, you can declare the undocumented library function
  2255.  
  2256.         extern _cdecl _nullcheck(void);
  2257.  
  2258.     and then sprinkle calls to _nullcheck() through your program at
  2259.     regular intervals.
  2260.  
  2261.     Borland's TechFax document TI726 discusses the null pointer
  2262.     assignment from a Borland point of view.  It's one of many documents
  2263.     downloadable as part of
  2264.  
  2265.         /pub/msdos/turbo-c/bchelp10.zip at SimTel
  2266.         /pc/turbopas/bchelp10.zip at Garbo.
  2267.  
  2268. Subject:  711. How can a batch file tell whether it's being run in a DOS
  2269.                box under Windows? (new: 20 Mar 1994)
  2270.  
  2271.     When Windows 3.0 or 3.1 is running, the DOS environment will contain
  2272.     a definition of the string windir, in lower case.  That's not really
  2273.     useful, however, because the batch statement
  2274.  
  2275.         if "%windir%" == "" ...
  2276.  
  2277.     will test for an environment variable WINDIR in upper case.
  2278.  
  2279.     Your only real option is to write a program as suggested by the
  2280.     following Q, and have it return a value which your batch file can
  2281.     test via "if errorlevel".
  2282.  
  2283. Subject:  712. How can my program tell if it's running under Windows?
  2284.                (rev: 20 Mar 1994)
  2285.  
  2286.     Execute INT 2F AX=4680.  If AX returns 0, you're in Windows real
  2287.     mode or standard mode (or under the DOS shell).  Otherwise, call INT
  2288.     2F AX=1600.  If AL returns something other than 0 or 80, you're in
  2289.     Windows 386 enhanced mode.  See PC Magazine 24 Nov 1992 (xi:20)
  2290.     pages 492-493.
  2291.  
  2292.     For more information, see PC Magazine 26 May 1992 (xi:10) pages 345-
  2293.     346.  A program, WINMODE, is available as part of
  2294.  
  2295.         /pub/msdos/pcmag/vol11n10.zip at SimTel
  2296.         /pc/pcmag/vol11n10.zip at Garbo.
  2297.  
  2298.     PC Magazine 29 March 1994 (xiii:6) pages 312 and 320 published a new
  2299.     program, WINVER.  This would be in
  2300.  
  2301.         /pub/msdos/pcmag/vol13n06.zip at SimTel
  2302.         /pc/pcmag/vol13n06.zip at Garbo.
  2303.  
  2304. Subject:  713. How can a program tell whether ANSI.SYS is installed?
  2305.                (new: 20 Apr 1994)
  2306.  
  2307.     In DOS 4.0 and above, call INT 2F AX=1A00.  If the value FF is
  2308.     returned in AL, ANSI.SYS is installed.  For more information, see
  2309.     Ralf Brown's interrupt list (question C03).
  2310.  
  2311. Subject:  799. How do I copyright software that I write? (rev: 9 Sep
  2312.                1993)
  2313.  
  2314.     You can download a very comprehensive answer from the Internet.
  2315.     Terry Carroll posts a six-part Copyright FAQ to misc.legal,
  2316.     news.answers and other groups.  A short answer follows, not based on
  2317.     that article.
  2318.  
  2319.     Disclaimer: I am not a lawyer, and this is not legal advice.  Also,
  2320.     there are very likely to be differences in copyright law among
  2321.     nations.  No matter where you live, if significant money may be
  2322.     involved, get legal advice.  The following is adapted (and greatly
  2323.     condensed) from chapter 4 of the Chicago Manual of Style (13th
  2324.     edition, ISBN 0-226-10390-0).
  2325.  
  2326.     In the U.S. (at least), when you write something, you own the
  2327.     copyright.  (The exception that matters most to programmers is
  2328.     "works made for hire", i.e., code you write because your employer or
  2329.     client pays you to.  A contract, agreed in advance, can vest the
  2330.     copyright in the programmer even if an employee; otherwise the
  2331.     employer owns the copyright.)  You don't have to register the work
  2332.     with the Copyright Office unless (until) the copyright is infringed
  2333.     and you intend to bring suit; however, it is easier to recover
  2334.     damages in court if you did register the work within three months of
  2335.     publication.
  2336.  
  2337.     From paragraph 4.16 of the Chicago Manual:  "... the [copyright]
  2338.     notice consists of three parts: (1) the symbol [C-in-a-circle]
  2339.     (preferred because it also suits the requirements of the Universal
  2340.     Copyright Convention), the word 'Copyright', or the abbreviation
  2341.     'Copr.', (2) the year of first publication, and (3) the name of the
  2342.     copyright owner.  Most publishers also add the phrase 'All rights
  2343.     reserved' because it affords some protection in Central and South
  2344.     American countries ...."  Surprise: "(C)" is legally not the same as
  2345.     the C-in-a-circle, so those of us who are ASCII-bound must use the
  2346.     word or the abbreviation.
  2347.  
  2348.  
  2349. section A. Downloading
  2350. ======================
  2351.  
  2352. Subject:  A01. What are SimTel, Garbo, and wustl? (rev: 6 Apr 1994)
  2353.  
  2354.     These are three of the most popular archive sites, with a few
  2355.     bazillion files available for free downloading by ftp.  (For email
  2356.     access, see "A02. I have no ftp access.  How can I get files from
  2357.     the archives?".)  Many of the files are shareware and you're
  2358.     expected to send a payment directly to the authors if you use them
  2359.     regularly.
  2360.  
  2361.     In comp.archives.msdos.d, Samuel Ko posts a two-part "Useful MS-DOS
  2362.     Programs at SIMTEL20 and Garbo"; it's downloadable as
  2363.  
  2364.         /pub/msdos/info/useful34.zip at SimTel
  2365.         /pc/filelist/useful34.zip at Garbo
  2366.         /pub/usenet/news.answers/msdos-archives/part* at rtfm.mit.edu.
  2367.  
  2368.     For rtfm.mit.edu instructions, see "C06. Where are FAQ lists
  2369.     archived?"
  2370.  
  2371.     A few words about file names and versions:  Many files at the
  2372.     archive sites are updated from time to time.  I verified every
  2373.     filename in this FAQ as of 24 Mar 1994 by ftp to the named sites, or
  2374.     by consulting their index files.  If you can't find a file given in
  2375.     these articles as mumble12.zip, perhaps there's a newer version; try
  2376.     mumble13.zip or mumble14.zip, or mumble*.zip if your ftp program
  2377.     supports wildcards (most do so).  Please let me know of any out-of-
  2378.     date file names.
  2379.  
  2380.     This FAQ should show both Garbo and SimTel directory and file names,
  2381.     if available, for every file mentioned for downloading.  If you see
  2382.     a listing for only one of them, it means that the file was not found
  2383.     at the other site, or that the other site's catalog shows an old
  2384.     version.
  2385.  
  2386.     Also remember that caps and lower case filenames are not
  2387.     interchangeable at most archive sites.
  2388.  
  2389.     1) SimTel = oak.oakland.edu is located at the University of
  2390.     Rochester in the USA, and there are also many mirror sites including
  2391.     wuarchive.wustl.edu, archive.orts.edu, ftp.uu.net, nic.funet.fi,
  2392.     archie.au, and nctucca.edu.tw.  For instructions, see these monthly
  2393.     articles in comp.archives.msdos.announce:
  2394.  
  2395.         How to find files in the SIMTEL20 msdos collection
  2396.         How to order SIMTEL20 files via e-mail
  2397.         How to upload files to SIMTEL20
  2398.  
  2399.     These are downloadable from SimTel as
  2400.  
  2401.         /pub/msdos/filedocs/aaaread.me
  2402.         /pub/msdos/filedocs/mailserv.inf
  2403.         /pub/msdos/filedocs/upload.inf.
  2404.  
  2405.     2) Garbo = garbo.uwasa.fi [128.214.87.1] is located at the
  2406.     University of Vaasa in Finland and maintained by Timo Salmi
  2407.     (ts@uwasa.fi) and others.  Garbo and SimTel contain many of the same
  2408.     files, but there are many differences too.  Among them: the
  2409.     directory structures differ greatly, and case is significant in
  2410.     directory and file names at Garbo.
  2411.  
  2412.     3) wustl = wuarchive.wustl.edu [128.252.135.4] mirrors, among
  2413.     others, Garbo (in /systems/ibmpc/garbo) and SimTel (in
  2414.     /systems/ibmpc/msdos).  As with any mirror site, it may lag by a day
  2415.     or two, so you may not want to try it on the same day you see an
  2416.     upload notice posted.
  2417.  
  2418.     4) others:
  2419.  
  2420.     A comprehensive list of MS-DOS archive sites is downloadable as
  2421.  
  2422.         /pc/pd2/moder35.zip at Garbo
  2423.         /pub/msdos/info/moder35.zip at SimTel.
  2424.  
  2425.     For archie.au via Telnet (different from the Archie file-finding
  2426.     mail servers):  Oceanian users should try archie.au first.  Paul
  2427.     Brooks has written to say that it "mirrors Garbo and SimTel-20 (in
  2428.     /micros/pc/simtel-20, /micros/pc/garbo) as well as many other
  2429.     archives.  Telnetting to 'archie.au' and logging on as 'archie' (no
  2430.     password) will access the Oceanic ARCHIE server." Email Craig Warren
  2431.     (ccw@archie.au) for instructions if needed.
  2432.  
  2433. Subject:  A02. I have no ftp access.  How can I get files from the
  2434.                archives? (rev: 14 June 1993)
  2435.  
  2436.     First, be sure that you have no ftp access before trying email
  2437.     methods.  (Ask your sysadmin, or a knowledgeable user at your site.)
  2438.     ftp is better for you because it's faster, and it uses less net
  2439.     resources too.
  2440.  
  2441.     When using an email server, make sure the Reply-to path in your
  2442.     message is valid.  If it's not, you'll get no reply from the server.
  2443.     Do wait a few days before assuming you're not going to get a
  2444.     response; some servers have long pending queues.  After a suitable
  2445.     wait, get your sysadmin's help to correct your reply-to, and send
  2446.     your message again.
  2447.  
  2448.     Occasionally a machine goes down for an extended period, which may
  2449.     prevent a timely reply to your message.  If you're sure your message
  2450.     bears a good reply path and you haven't got a reply in a week or so,
  2451.     you might send your message again, once.  Don't post it as an
  2452.     article in a newsgroup.
  2453.  
  2454.     For files from SimTel, see "How to order SIMTEL20 files via e-mail",
  2455.     posted monthly in comp.archives.msdos.announce; or send email
  2456.     containing only the word "help" to listserv@vm1.nodak.edu.  For
  2457.     instructions on using Garbo's email server, send a request to Timo
  2458.     Salmi at ts@uwasa.fi.
  2459.  
  2460.     The DEC Western Research Labs server will get files from any ftp
  2461.     site by ftp and then email them to you.  Send email containing
  2462.     "help" to ftpmail@decwrl.dec.com.
  2463.  
  2464. Subject:  A03. Can I get archives on CD-ROM? (rev: 24 May 1993)
  2465.  
  2466.     Copies of the SimTel MS-DOS, Macintosh and Unix-C collections (also
  2467.     of wuarchive, cica, and others) are available from Walnut Creek
  2468.     CDROM, 1547 Palos Verdes, Suite 260, Walnut Creek, CA 94596-2228,
  2469.     telephone (800) 786-9907 or +1 510 674-0783, or FAX +1 510 674-0821,
  2470.     or email rab@cdrom.com.
  2471.  
  2472.     For a catalog of disks available, send email to info@cdrom.com, or
  2473.     ftp the catalog as /cdrom/catalog from cdrom.com.
  2474.  
  2475. Subject:  A04. Where do I find program <mumble>? (rev: 7 Aug 1993)
  2476.  
  2477.     You _are_ asking about shareware, freeware, or public-domain
  2478.     programs, right?  Commercial software is not legally distributed
  2479.     through the net, in general.  (Occasionally vendors will make
  2480.     patches available, but these are useful only to upgrade software you
  2481.     already own.)
  2482.  
  2483.     That said, there are several newsgroups to help you find a program.
  2484.     comp.binaries.ibm.pc.wanted is generally the best place to ask your
  2485.     question.  Please review the guidelines in "108. What other
  2486.     technical newsgroups should I know about?"
  2487.  
  2488.     Download and check the indexes from SimTel and Garbo (see "A05. How
  2489.     can I check SimTel or Garbo before I post a request for a
  2490.     program?").  Unless what you're looking for is commercial software,
  2491.     there's a good chance it will be at one or both of those sites.  The
  2492.     Archie servers maintain directories of many (not all) ftp sites
  2493.     worldwide.  You can Telnet to a server or client to search for
  2494.     files, or perform a search by email.
  2495.  
  2496. Subject:  A05. How can I check SimTel or Garbo before I post a request
  2497.                for a program? (rev: 24 Mar 1994)
  2498.  
  2499.     SimTel and Garbo have indexes of their contents, which you can
  2500.     download and then search off line.
  2501.  
  2502.     Garbo's index file, /pc/INDEX.ZIP, contains an annotated list, often
  2503.     updated, of the MS-DOS files there.  The news file /pc/pd2/news-pd2
  2504.     contains selected news on all MS-DOS directories at Garbo.
  2505.  
  2506.     SimTel's index files, in /pub/msdos/filedocs, are updated several
  2507.     times a month.  simlist.zip contains a list in text format.  But you
  2508.     may prefer the file simindex.zip, which is comma-delimited for easy
  2509.     use with any of these search facilities:
  2510.  
  2511.     - Two downloadable search programs are simtel35.zip and
  2512.       simdir22.zip.
  2513.  
  2514.     - dBASE III or IV users can load the index from simindex.zip using
  2515.       instructions in simibm.inf and simibm.db3.
  2516.  
  2517.     - PC-FILE users should get simibm.hdr, which tells how to use
  2518.       simibm.ibm.
  2519.  
  2520. Subject:  A06. How do I download and decode a program I found? (rev: 7
  2521.                Aug 1993)
  2522.  
  2523.     See the "Starter kit" and "Beginner's guide to binaries" in
  2524.     comp.binaries.ibm.pc, usually posted on the first and 15th of every
  2525.     month.  Please wait for these articles to come around; don't post a
  2526.     request.  If you can't wait, they are downloadable from
  2527.  
  2528.         Garbo as /pc/doc-net/starter.kit and bin.man
  2529.         rtfm.mit.edu in /pub/usenet/comp.binaries.ibm.pc .  The file
  2530.             names are quite long; try look for names of the form
  2531.             *starter.kit* and *bin.man*
  2532.  
  2533.     For rtfm.mit.edu instructions, see "C06. Where are FAQ lists
  2534.     archived?"
  2535.  
  2536.     Most binaries are posted and sent through email in 'uuencode'
  2537.     format.  The starter kit contains a uudecode program to turn this
  2538.     file back into binary.  Since the uuencoded file is bigger than the
  2539.     binary, you'll save connect time if you can uudecode it and then
  2540.     download the binary file.  Remember to set file type to binary.
  2541.  
  2542. Subject:  A07. Where is UUDECODE?
  2543.  
  2544.     You can find it at SimTel and Garbo, but it's easier to take it from
  2545.     the "starter kit" mentioned in the preceding Q.
  2546.  
  2547.     If you're logged in at a Unix site, there's almost certainly a
  2548.     uudecode there:  just type "uudecode" followed by a space and the
  2549.     file name.  The binary file is 25% smaller than the uuencoded file,
  2550.     so you'll save connect time if you can uudecode it on the Unix host
  2551.     and then download the binary file.  Remember: set file type binary.
  2552.  
  2553. Subject:  A08. Why do I get errors when extracting from a ZIP file I
  2554.                downloaded? (rev: 20 Mar 1994)
  2555.  
  2556.     There are many possible causes, but two of them probably account for
  2557.     95% of all problems.
  2558.  
  2559.     1) File transmission:  You must tell the archive site to transfer
  2560.     ZIP files in binary mode.  Depending on your software, you may also
  2561.     need to set your local software to receive files in binary mode.
  2562.  
  2563.     2) Unzipping program:  Make sure you aren't using an obsolete
  2564.     version.  In <9303290853.kp28285@tacom-emh1.army.mil> on 29 Mar
  2565.     1993, Keith Petersen, SimTel administrator, wrote:  "SIMTEL20 has
  2566.     standardized on the Info-ZIP group's ZIP and UNZIP because they are
  2567.     freely distributable and they have no restrictions on exporting.
  2568.     The latest version of Info-ZIP's ZIP and UNZIP can always be found
  2569.     in directory" /pub/msdos/zip "and will always have the name 'Info-
  2570.     ZIP' in the description to make them easy to locate."  PKUNZIP
  2571.     version 1.10 may not unzip newer stuff from archive sites because
  2572.     site administrators have now embraced version 2.04.  Also see "B03.
  2573.     What's the current version of UNZIP?"
  2574.  
  2575.  
  2576. section B. Vendors and products
  2577. ===============================
  2578.  
  2579. Subject:  B01. How can I contact Borland? (rev: 6 Sep 1993)
  2580.  
  2581.     Borland has set up these email addresses.  However, none of them is
  2582.     for technical support such as help with finding your own programming
  2583.     errors and explaining compiler messages.
  2584.  
  2585.     - bp7-info@borland.com will reply to any message with 17K of info on
  2586.       Borland Pascal with Objects 7.0 and Turbo Pascal 7.0.
  2587.  
  2588.     - customer-support@borland.com is for questions about prices and
  2589.       features of products, replacing bad or missing disks, info on
  2590.       upgrades, etc.  They do not accept emailed credit-card numbers.
  2591.  
  2592.     - bugs@borland.com will take "a well-documented bug report" and send
  2593.       an automated response, but will not give you a workaround or a
  2594.       scheduled fix date or even confirm that it is or is not considered
  2595.       a bug.  "The purpose of bugs@borland.com is to improve future
  2596.       products sooner, not as a substitute for tech support channels."
  2597.  
  2598.     Email tech support is available only through Compuserve (GO BOR).
  2599.  
  2600.     Telephone support is provided through separate phone numbers for
  2601.     most products.  If you're calling from the U.S., dial (800) 841-8180
  2602.     for a recorded list of toll numbers to call.  Borland's BBS is at +1
  2603.     408 439 9096.  The surface-mail address is Technical Support
  2604.     Department, Borland International, P.O. Box 660001, Scotts Valley CA
  2605.     95067-0001, USA.
  2606.  
  2607.     You'll need to give your product's name, version, and serial number.
  2608.  
  2609.     Patches for Borland products are archived at ftp.cica.indiana.edu in
  2610.     directory /pub/pc/borland .  (I haven't verified this personally.)
  2611.  
  2612.     Borland's TechFax documents are also available for download:
  2613.  
  2614.         /pub/msdos/turbo-c/bchelp10.zip at SimTel
  2615.         /pc/turbopas/bchelp10.zip at Garbo.
  2616.  
  2617.     These documents are detailed answers to common questions about Turbo
  2618.     C and Borland C products, and aggregate several hundred Kbytes.
  2619.  
  2620. Subject:  B02. How can I contact Microsoft? (rev: 18 Sep 1993)
  2621.  
  2622.     Individual employees of Microsoft (not MicroSoft, please!) post here
  2623.     sometimes.  Their addresses all take the form person@microsoft.com.
  2624.     However, Microsoft as a company does not answer individual questions
  2625.     via email through the Internet.
  2626.  
  2627.     1) information available via anonymous ftp
  2628.  
  2629.     The company maintains an anonymous FTP server, ftp.microsoft.com.
  2630.     Effective 1 Oct 1993 the server will support "Microsoft development
  2631.     tools and advanced systems products, including Windows NT, the Win32
  2632.     SDX, the Windows 3.1 SDK, Visual C++, Visual Basic, LAN Manager, SQL
  2633.     Server, and others," according to {Microsoft Developer News} for
  2634.     September 1993.  The server contains "the complete Developer
  2635.     Knowledge Base with articles written and used by Microsoft Support
  2636.     Engineers.  You will also find device drivers, patches, code
  2637.     samples, help files, and white papers."  Readme files will "give an
  2638.     overview of the directory structure," which appears to be different
  2639.     from what was put in place in July 1993.  For further information,
  2640.     says Microsoft, call (800) 936-5300.
  2641.  
  2642.     "Microsoft Developer Network technical articles and selected sample
  2643.     code files are available ... at ftp.uu.net ... in the subdirectory
  2644.     ~ftp/vendor/microsoft/developer-network" according to {Microsoft
  2645.     Developer News} for September 1993.
  2646.  
  2647.     2) information via U.S. Mail
  2648.  
  2649.     Microsoft Product Support is at 16011 NE 36th Way, Box 97017,
  2650.     Redmond WA 98073-9717, USA.
  2651.  
  2652.     You can subscribe to the {Microsoft Developer News} by mailing a
  2653.     request to Microsoft Developer Network, P.O. Box 51812, Boulder CO
  2654.     80322-1812, U.S.A.  The nearest I can figure, this is free;
  2655.     certainly I've never paid for it or been asked to.
  2656.  
  2657.     3) tech support via modem
  2658.  
  2659.     On Compuserve, GO MICROSOFT; or call Microsoft's BBS at +1 206 936-
  2660.     6735 in the U.S., or +1 416 507-3022 in Canada.
  2661.  
  2662.     4) tech support via voice telephone lines
  2663.  
  2664.     If you want to place an order or get general pre-sales information,
  2665.     call the appropriate sales and service number:
  2666.  
  2667.         U.S. end-user sales                   (800) 426-9400
  2668.         U.S. corporate/gov't/reseller/
  2669.                  educational sales            (800) 227-4679
  2670.         Canadian sales                        (800) 568-3503
  2671.         International sales                  +1 206 936-8661
  2672.  
  2673.     For tech support you must make an ordinary long-distance phone call.
  2674.     Microsoft has separate incoming phone numbers for many products.
  2675.     Since it's your nickel, first check your documentation to see if a
  2676.     phone number is listed.  Here are phone numbers (as of 1 June 1992)
  2677.     for a few products of most interest to the readers of this group:
  2678.  
  2679.         C/C++               (206) 635-7007
  2680.         MASM                (206) 646-5109
  2681.         DOS Upgrade Users   (206) 646-5104 (for 90 days after first
  2682.             call)
  2683.         Windows Users       (206) 637-6098
  2684.  
  2685.     If you can't find the direct number any other way, call the "master"
  2686.     numbers below or the sales numbers a few paragraphs above.  You'll
  2687.     get the "voice mail phone tree from h-ll" but you'll eventually get
  2688.     to the right department.  They don't provide technical assistance,
  2689.     but a voice menu will help you find the current phone number for the
  2690.     department you need.
  2691.  
  2692.         U.S. end-user product support         (206) 454-2030
  2693.         U.S. languages support                (206) 637-7096
  2694.  
  2695. Subject:  B03. What's the current version of UNZIP? (rev: 17 Mar 1994)
  2696.  
  2697.     Since April 1993, the administrators of Garbo and SimTel have
  2698.     accepted uploads in the ZIP 2.0 format.  You can use the free Info-
  2699.     ZIP versions, or PKZIP 2.04g (not 2.04c or 2.04e).  SimTel has
  2700.     standardized on the Info-ZIP versions for several reasons, as
  2701.     explained in an article posted 29 Mar 1993 in
  2702.     comp.archives.msdos.announce.
  2703.  
  2704.     Info-ZIP versions ZIP 2.0 and UNZIP 5.1 are now current.  Those
  2705.     programs, ZIP 1.9, UNZIP 5.0, and PKZIP 2.04g all work with the same
  2706.     file formats.
  2707.  
  2708.     The primary source of the free Info-ZIP programs is at ftp.uu.net,
  2709.     directory /pub/archiving/zip; or at quest.jpl.nasa.gov, directory
  2710.     /pub.  Files are in those directories or in subdirectories as shown
  2711.     below.  The DOS executable for UNZIP is self extracting; all others
  2712.     require UNZIP 5.0 or 5.1:
  2713.  
  2714.         MSDOS/unzip51x.exe - DOS executable and doc, UNZIP 5.1
  2715.         unzip51.zip - source code for UNZIP 5.1, all platforms
  2716.         MSDOS/zip20x.zip - DOS exe and doc, ZIP without crypt support
  2717.         zip201.zip - source code for ZIP 2.0, all platforms
  2718.         MSDOS/zcryp20x.zip - DOS exe and doc, ZIP with crypt support
  2719.         zcrypt21.zip - source code for ZIP crypt support
  2720.         WINDOWS/wunz20x.zip - Windows 3.1 WIZUNZIP 2.0 exe and help file
  2721.         WINDOWS/wunz20sr.zip - Windows 3.1 WIZUNZIP 2.0 source
  2722.  
  2723.     The essential files are also available at SimTel in /pub/msdos/zip
  2724.     and at Garbo in /pc/arcers.
  2725.  
  2726.     PKZIP and PKUNZIP are shareware products of PKWARE Inc.  The current
  2727.     version is 2.04g, which is the third official version after 1.10.
  2728.     They are downloadable
  2729.  
  2730.         from PKWARE's bulletin board, +1 414 354 8670, or
  2731.         from Garbo as /pc/arcers/pkz204g.exe
  2732.         from SimTel as /pub/msdos/zip/pkz204g.exe
  2733.  
  2734.     By the way, if you want to develop your own utilities, you will find
  2735.     the ZIP 2.0 data structures described in the downloadable file
  2736.  
  2737.         /pub/msdos/zip/appnote.zip at SimTel.
  2738.  
  2739. Subject:  B04. What is the phone number for a vendor's BBS? (rev: 24 Mar
  2740.                1994)
  2741.  
  2742.     Robert Baker (rbakerpc@delphi.com) uploaded a list of 800 bulletin-
  2743.     board support numbers operated by software vendors as of August
  2744.     1993.  It is downloadable as /pub/msdos/bbslist/bbs_9308.zip from
  2745.     SimTel.
  2746.  
  2747.  
  2748. section C. More information
  2749. ===========================
  2750.  
  2751. Subject:  C01. Are there any good on-line references for PC hardware
  2752.                components? (rev: 28 July 1993)
  2753.  
  2754.     Good reports of HELPPC21 have been posted.  It is downloadable as
  2755.  
  2756.         /pub/msdos/info/helppc21.zip at SimTel
  2757.         /pc/programming/helppc21.zip at Garbo.
  2758.  
  2759.     This hypertext system contains much information on ports and other
  2760.     hardware, as well as some overlap with Ralf Brown's interrupt list
  2761.     (Q C03).  It is shareware ($25).
  2762.  
  2763. Subject:  C02. Are there any good on-line references for PC interrupts?
  2764.  
  2765.     The definitive work is Ralf Brown's interrupt list; see Q C03.
  2766.  
  2767. Subject:  C03. What and where is "Ralf Brown's interrupt list"? (rev: 5
  2768.                Apr 1994)
  2769.  
  2770.     This is megabytes of information on documented and (officially)
  2771.     undocumented BIOS and DOS interrupts, DOS tables, and interrupts
  2772.     hooked by many software packages.
  2773.  
  2774.     The interrupt list comes from cs.cmu.edu [128.2.222.173] in
  2775.     /afs/cs/user/ralf/pub (switch there with a single command) as
  2776.     inter40a.zip, inter40b.zip, and inter40c.zip; the separate file
  2777.     inter40d.zip contains utilities.  The list is also downloadable as
  2778.  
  2779.         /pub/msdos/info/inter*.zip from SimTel
  2780.         /pc/programming/inter*.zip from Garbo.
  2781.  
  2782.     These versions were uploaded in early February 1994; updates are
  2783.     announced every few months in comp.archives.msdos.announce.
  2784.  
  2785. Subject:  C04. Where can I find lex, yacc, and language grammars?
  2786.  
  2787.     The FAQ list of the comp.compilers newsgroup answers this for Basic,
  2788.     C, Pascal, and other languages.  See "C06. Where are FAQ lists
  2789.     archived?"
  2790.  
  2791. Subject:  C05. What's the best book to learn programming?
  2792.  
  2793.     Sorry, this FAQ list cannot settle religious arguments.
  2794.  
  2795.     Much of the heat over this topic arises because each person believes
  2796.     that the book that he or she learned from is the best book.  But
  2797.     different people have very different experiences of the same book.
  2798.     The only person who can tell you which is the best book for learning
  2799.     a given topic is you.
  2800.  
  2801.     Your best bet is to go to a fairly well-stocked bookstore when you
  2802.     have a couple of hours to spare.  Start at one end of the shelf and
  2803.     work your way methodically through every book that looks like it
  2804.     might cover what you want to learn.  Look at the tables of contents;
  2805.     read a page or two from each book.  Then make your decision.  If
  2806.     money is a problem, or if you're not sure of your choice, check out
  2807.     your top two or three from your library.
  2808.  
  2809. Subject:  C06. Where are FAQ lists archived? (rev: 29 Mar 1994)
  2810.  
  2811.     Very possibly the FAQ list you want is already at your site.  Check
  2812.     the newsgroup news.answers; if your site doesn't carry news.answers,
  2813.     check comp.answers, rec.answers, etc., according to the top-level
  2814.     name in the FAQ list's "home" newsgroup.  Articles are posted to the
  2815.     *.answers groups in a way that should make them last until the next
  2816.     versions are posted.  If they expire sooner at your site, you might
  2817.     want to lobby your sysadmin to treat the moderated *.answers groups
  2818.     as a special case and grant them longer expiration times than other
  2819.     groups.
  2820.  
  2821.     To ftp most FAQ lists, connect to rtfm.mit.edu, and change to
  2822.     directory /pub/usenet/news.answers.  The name of the file that you
  2823.     want is the Archive-name from the top of the article.  For instance,
  2824.     if the Archive-name is software-eng/part1 you would retrieve
  2825.     /pub/usenet/news.answers/software-eng/part1.
  2826.  
  2827.     By email (only if you have no ftp access, please), the server is
  2828.     mail-server@rtfm.mit.edu .  It accepts "send" commands that omit the
  2829.     leading "/pub/" from file names; for example:
  2830.  
  2831.         send usenet/news.answers/software-eng/part1
  2832.  
  2833.     For full instructions about the mail server, send it a message
  2834.     consisting of these two lines:
  2835.  
  2836.         help
  2837.         index
  2838.  
  2839.     Not just FAQ lists, but every article listed in the "List of
  2840.     Periodic Informational Postings" (LoPIP) can be obtained by ftp or
  2841.     email from rtfm.mit.edu.  If you have an old copy of an
  2842.     informational article, look for an "Archive-name" at the beginning;
  2843.     rtfm.mit.edu stores it under that name in /pub/usenet/news.answers.
  2844.     If the article has no Archive-name, check the first name on the
  2845.     Newsgroups line and change to that directory under /pub/usenet.
  2846.  
  2847.     Or send email >>> with valid reply-to address << to brown@ncoast.org
  2848.     and you'll receive my canned instructions (about 8K) for retrieving
  2849.     FAQ lists for most newsgroups, including a few that aren't archived
  2850.     at rtfm.mit.edu.  (This offer may be withdrawn without notice
  2851.     depending on system constraints.)
  2852.  
  2853. Subject:  C07. Where can I get the latest copy of this FAQ list? (rev:
  2854.                30 Mar 1994)
  2855.  
  2856.     You can retrieve the latest version of this list as
  2857.  
  2858.         /pub/msdos/info/faqp*.zip from SimTel
  2859.         /pc/doc-net/faqp*.zip from Garbo.
  2860.  
  2861.     Check the date before downloading, to make sure that the archived
  2862.     version is actually newer than what you have.
  2863.  
  2864.     Like most FAQ lists, this one is archived at rtfm.mit.edu and a
  2865.     number of mirror sites.  If you have ftp access, retrieve either of
  2866.     these identical files:
  2867.  
  2868.         /pub/usenet/news.answers/msdos-programmer-faq/faq
  2869.         /pub/usenet/comp.os.msdos.programmer/dos-faq
  2870.  
  2871.     If you have no ftp access, see "C06. Where are FAQ lists archived?"
  2872.     for instructions on retrieving it by email.
  2873.  
  2874. Subject:  C08. How do I use ftp? (rev: 6 Apr 1994)
  2875.  
  2876.     I was much impressed with {The Whole Internet User's Guide and
  2877.     Catalog} by Ed Krol (O'Reilly & Associates, second edition ISBN
  2878.     1-56592-063-5).  It gives lots of information on using ftp, email,
  2879.     Telnet, Archie, etc.  As a new user of ftp (January 1993), I found
  2880.     the information made me productive quickly.  (Disclosure:  Though I
  2881.     don't believe it has biased my judgment, you should know that
  2882.     O'Reilly sent me a free evaluation copy.)
  2883.  
  2884.     You may also want to look for the "Beginner's Guide to FTP", posted
  2885.     periodically in comp.binaries.ibm.pc.  You can retrieve it from
  2886.     rtfm.mit.edu (see "C06. Where are FAQ lists archived?"), in
  2887.     /pub/usenet/comp.binaries.ibm.pc, as *ftp.man*.
  2888.  
  2889.     When downloading a file by ftp, make sure you have write access to
  2890.     your working directory on your local machine, and that your disk has
  2891.     enough space to hold the files.  Also make sure that if it's a ZIP
  2892.     file or other binary file type, you set the protocol to binary
  2893.     before downloading the file.
  2894.  
  2895. (end of comp.os.msdos.programmer FAQ)
  2896. -- 
  2897. Stan Brown, Oak Road Systems                    brown@Ncoast.ORG
  2898. Can't find FAQ lists?  ftp to 'rtfm.mit.edu' and look in /pub/usenet
  2899. (or email me >>> with valid reply-to address <<< for instructions).
  2900. I can also send "newbie" information on Usenet--just ask if you want it.
  2901.  
  2902.