Newsgroups: comp.os.msdos.programmer,comp.answers,news.answers Subject: comp.os.msdos.programmer FAQ part 1 of 4 Expires: +27 days Followup-To: comp.os.msdos.programmer Distribution: world Message-ID: References: none Supersedes: Approved: news-answers-request@MIT.Edu Keywords: Archive-name: msdos-programmer-faq/part1 Last modified: 24 Sep 1993 This is the FAQ list (Frequently Asked Questions list) for the newsgroup comp.os.msdos.programmer. Parts 2 through 4 of this article are posted as followups in the same thread. Starting 2 Feb 1993, new and revised answers are marked with "new:" or "rev:" and the change date. The changes from the previous issue are posted in a separate article, with subject line "comp.os.msdos.programmer FAQ diffs". If the posting date shown above is more than four weeks in the past, see instructions in part 4 of this list for how to get an updated copy. (A separate article, posted before this one, holds the changes from the previous edition. Look for the subject line "comp.os.msdos.programmer FAQ diffs".) FAQ lists are intended to reduce the noise level in their newsgroups that results from the repetition of the same questions, correct answers, wrong answers, corrections to the wrong answers, corrections to the corrections, debate, etc. This list should serve as a repository of the canonical "best" answers to the questions in it. The names of folks who have helped to improve this FAQ list follow the table of contents. If you know a better answer or even a slight change that improves an answer, please tell me! (Use email, please. Traffic in this group is high, and I may miss a relevant posted article.) See the "From:" line in the header, or simply reply (rather than followup) to this article. Stan Brown, Oak Road Systems, Cleveland, Ohio, USA brown@ncoast.org Subject: Search tips This list is in digest format (if it's set up right). To skip one topic and go to the next: Search for "Subject" starting in column 1. In trn and similar newsreaders, the command "g^Subject", or a simple Ctrl-G, does that. To search for specific topics: See the list of questions in the Table of Contents (immediately below) to find which article (part 2, 3, or 4) you need. Then, in that part, search for that question number. For example, while you're reading part 2 of this list, the trn newsreader command "g 203" (note the two spaces) goes to question 203. If your newsreader doesn't support searches, you can extract these articles to a file and use your favorite editor's search commands. Subject: Table of Contents (Sections 1-3 are in part 2 of this article; sections 4-7 in part 3, and sections A-C in part 4.) section 1. General questions 101. Why won't my code work? 102. What is this newsgroup about? 103. Is comp.os.msdos.programmer just for C programmers? 104. What's the difference from comp.sys.ibm.pc.programmer? 105. Is comp.os.msdos.programmer available as a mailing list? 106. What's this "netiquette"? 107. How can I learn more about Usenet? 108. What other technical newsgroups should I know about? section 2. Compile and link 201. What the heck is "DGROUP > 64K"? 202. How do I fix "automatic data segment exceeds 64K" or "stack plus data exceed 64K"? 203. Will Borland C code and Microsoft C code link together? 204. Why did my program bomb at run time with "floating point formats not linked"? 205. Why did my program bomb with "floating point not loaded"? 206. How can I change the stack size in Borland's C compilers? 207. What's the format of an .OBJ file? 208. What's the format of an .EXE header? 209. What's the difference between .COM and .EXE formats? section 3. Keyboard 301. How can I read a character without echoing it to the screen, and without waiting for the user to press the Enter key? 302. How can I find out whether a character has been typed, without waiting for one? 303. How can I disable Ctrl-C/Ctrl-Break and/or Ctrl-Alt-Del? 304. How can I disable the print screen function? 305. How can my program turn NumLock (CapsLock, ScrollLock) on/off? 306. How can I speed up the keyboard's auto-repeat? 307. What is the SysRq key for? 308. How can my program tell what kind of keyboard is on the system? 309. How can I tell if input, output, or stderr has been redirected? 310. How can I increase the size of the keyboard buffer? 311. How can I stuff characters into the keyboard buffer? section 4. Disks and files 401. What drive was the PC booted from? 402. How can I boot from drive b:? 403. Which real and virtual disk drives are valid? 404. How can I make my single floppy drive both a: and b:? 405. How can I disable access to a drive? 406. How can a batch file test existence of a directory? 407. Why won't my C program open a file with a path? 408. How can I redirect printer output to a file? 409. How can I redirect the output of a batch file? 410. How can I redirect stderr? 411. How can my program open more files than DOS's limit of 20? 412. How can I read, create, change, or delete the volume label? 413. How can I get the disk serial number? 414. What's the format of .OBJ, .EXE., .COM files? 415. How can I flush the software disk cache? section 5. Serial ports (COM ports) 501. How do I set my machine up to use COM3 and COM4? 502. How do I find the I/O address of a COM port? 503. But aren't the COM ports always at I/O addresses 3F8, 2F8, 3E8, and 2E8? 504. How do I configure a COM port and use it to transmit data? section 6. Other hardware questions and problems 601. Which 80x86 CPU is running my program? 602. How can a C program send control codes to my printer? 603. How can I redirect printer output to a file? 604. Which video adapter is installed? 605. How do I switch to 43- or 50-line mode? 606. How can I find the Microsoft mouse position and button status? 607. How can I access a specific address in the PC's memory? 608. How can I read or write my PC's CMOS memory? 609. How can I access memory beyond 640K? 610. Where can I find a list of 80x86 opcodes? section 7. Other software questions and problems 701. How can a program reboot my PC? 702. How can I time events with finer resolution than the system clock's 55 ms (about 18 ticks a second)? 703. How can I find the error level of the previous program? 704. How can a program set DOS environment variables? 705. How can I change the switch character to - from /? 706. Why does my interrupt function behave strangely? 707. How can I write a TSR (terminate-stay-resident) utility? 708. How can I write a device driver? 709. What can I use to manage versions of software? 710. What's this "null pointer assignment" after my C program executes? 711. How can my program tell if it's running under Windows? 712. How do I copyright software that I write? section A. Downloading A01. What are Simtel, Garbo, and wustl? A02. I have no ftp access. How can I get files from the archives? A03. Can I get archives on CD-ROM? A04. Where do I find program ? A05. How can I check Simtel or Garbo before I post a request for a program? A06. How do I download and decode a program I found? A07. Where is UUDECODE? A08. Why do I get errors when extracting from a ZIP file I downloaded? section B. Vendors and products B01. How can I contact Borland? B02. How can I contact Microsoft? B03. What's the current version of UNZIP? B04. What's in Borland Pascal/Turbo Pascal 7.0? B05. What's in Microsoft Visual C++? B06. Where is Microsoft C 8.0? B07. What is the phone number for a vendor's BBS? section C. More information C01. Are there any good on-line references for PC hardware components? C02. Are there any good on-line references for PC interrupts? C03. What and where is "Ralf Brown's interrupt list"? C04. Where can I find lex, yacc, and language grammars? C05. What's the best book to learn programming? C06. Where are FAQ lists archived? C07. Where can I get the latest copy of this FAQ list? C08. How do I use ftp? Subject: Acknowledgements Through September 1993 this list was edited by Stan Brown, Oak Road Systems, Cleveland, Ohio. "SB" in some answers refers to him. Many articles posted in comp.os.msdos.programmer sparked ideas or provided information for the first version of this list. Though they are not responsible for any errors, thanks are due to the following persons for posted articles or private email that led to improvements in this FAQ list: Jamshid Afshar, Mark Aitchison, Sanjay Aiyagari, George Almasi, Aaron Auseth, Robert Baker, Preston Bannister, Scott Barman, Denis Beauregard, Per Bergland, Mike Black, Chris Blum, Mark Brader, Jon Brinkmann, Andrew James Bromage, Glynn Brooks, Paul Brooks, Ralf Brown, Shaun Burnett, Raymond Chen, Denny de Jonge, Eric DeVolder, Alan Drew, Paul Ducklin, Gary Dueck, Roland Eriksson, Mark Evans, Markus Fischer, George Forsman, Roger Fulton, Vincent Giovannone, Robert Grunloh, B.Haible, Janos Haide, Klaus Hartnegg, Kris Heidenstrom, Tom Haapanen, Joel Hoffman, Ari Hovila, Chin Huang, Joe Huffman, Michael Holin, Mike Iarrobino, Byrial Jensen, Rune Jorgensen, Ajay Kamdar, Everett Kaser, Jeff Kellam, Jen Kilmer, Reinhard Kirchner, Dave Kirsch, Chad Knudsen, Samuel Ko, Benjamin Lee, Stephen Lee, Jim Lynch, Greg Malknecht, Sidney Markowitz, Jim Marks, Dimitri Matzarakis, Fred McCall, Ken McKee, Doug Merrett, Tom Milner, Bill Moore, Duncan Murdoch, Steve Murphy, Daniel Neri, Mert Nickerson, David Nugent, John Oldenburg, David Pape, Keith Petersen, Karl Riedling, Arthur Rubin, Gerald Ruderman, Timo Salmi, Tapio Sand, John Schmid, Russell Schulz, Huseyin Sevay, Ajay Shah, Steve Summit, Tom Swingle, Anders Thulin, Curt Tilmes, Rick Watkins, Ya-Gui Wei, Joe Wells, Scott Winder, Gregory Youngblood, khill@vax1.umkc.edu New contributors this issue: Chin Huang Subject: Legalistic stuff This article is not in the public domain, but it may be redistributed so long as this notice, the acknowledgements, and the information on obtaining the latest copy of this list are retained and no fee is charged. The code fragments may be used freely; credit would be polite. Copyright (C) 1993 Stan Brown, Oak Road Systems. All rights reserved. THERE IS NO WARRANTY ON THE CODE. All the code included below has been tested; but the testing may not have been perfect, and machines and configurations vary. (Except where otherwise noted, code was tested with both BC++ 2.0 and MSC 5.0.) The mention of particular books or programs must not be construed to reflect unfavorably on any that are not mentioned. (continued in part 2)