Path: senator-bedfellow.mit.edu!dreaderd!not-for-mail Message-ID: Supersedes: Expires: 10 Jun 2006 04:18:05 GMT References: X-Last-Updated: 2003/08/14 From: jeffrey@carlyle.org (Jeffrey Carlyle) Sender: jeffrey@carlyle.org (Jeffrey Carlyle) Reply-To: jeffrey@carlyle.org (Jeffrey Carlyle) Approved: news-answers-request@MIT.edu Organization: JeffC.org Subject: comp.os.msdos.programmer FAQ part 5/5 Newsgroups: comp.os.msdos.programmer,alt.msdos.programmer,comp.answers,alt.answers,news.answers Followup-To: poster Summary: Frequently asked questions from DOS programmers with tested answers. Originator: faqserv@penguin-lust.mit.edu Date: 07 May 2006 04:18:12 GMT Lines: 497 NNTP-Posting-Host: penguin-lust.mit.edu X-Trace: 1146975492 senator-bedfellow.mit.edu 577 18.181.0.29 Xref: senator-bedfellow.mit.edu comp.os.msdos.programmer:129718 alt.msdos.programmer:55969 comp.answers:63595 alt.answers:82215 news.answers:307550 Archive-name: msdos-programmer-faq/part5 Comp-os-msdos-programmer-archive-name: dos-faq-pt5.txt Posting-frequency: 28 days Last-modified: 14 Aug 2003 comp.os.msdos.programmer FAQ Version 2003.08.14 This is the Frequently Asked Questions list for the newsgroup comp.os.msdos.programmer. COPYRIGHT Copyright 2003 by Jeffrey Carlyle. All rights reserved. This article is not in the public domain, but it may be redistributed so long as this notice, the acknowledgments, 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 to the FAQ would be polite. This FAQ is not to be included in any static: archive (e.g. CD-ROM or book); however, a pointer to the FAQ may be included. See [Where can I get the latest copy of this FAQ list?] for a link to the latest version of the FAQ.) This is part 5 of 5 parts. TABLE OF CONTENTS PART 1: Section 1. General FAQ and Newsgroup Information - Is MS-DOS Dead? - What is this article for? - Who has contributed to this article? - How can I search this article for a particular topic? - Are the answers guaranteed to be correct and complete? - What is comp.os.msdos.programmer about? - Is comp.os.msdos.programmer just for C programmers? - What is comp.sys.ibm.pc.programmer? - Is comp.os.msdos.programmer available as a mailing list? - What's this netiquette? - How can I learn more about Usenet? - What other technical newsgroups should I know about? - Where are FAQ lists archived? - Where can I get the latest copy of this FAQ list? Section 2. General Reference - Are there any good on-line references for PC hardware components? - Are there any good on-line references for PC interrupts? - What and where is Ralf Brown's interrupt list? - Where can I find lex, yacc, and language grammars? - What's the best book to learn programming? - Why won't my code work? - Are there any good sources of example code? - What and where is SNIPPETS? - Is the source code MS-DOS available? - What are my alternatives for MS-DOS compatible OSes? - What and where is FreeDOS? - Where can I find out about batch files? PART 2: Section 3. Compile and link - What the heck is DGROUP > 64K? - How do I fix 'automatic data segment exceeds 64K' or 'stack plus data exceed 64K'? - Will Borland C code and Microsoft C code link together? - Why did my program bomb at run time with 'floating point formats not linked' or 'floating point not loaded'? - How can I change the stack size in Borland's C compilers? - What's the format of an .OBJ file? - What's the format of an .EXE header? - What's the difference between .COM and .EXE formats? - How do I create a .COM file? - Where is EXE2BIN located? - What does this message mean: 'A20 already enabled so test is meaning less?' Section 4. Keyboard - How can I read a character without echoing it to the screen, and without waiting for the user to press the Enter key? - How can I find out whether a character has been typed, without waiting for one? - How can I disable Ctrl-C/Ctrl-Break and/or Ctrl-Alt-Del? - How can I disable the print screen function? - How can my program turn NumLock (CapsLock, ScrollLock) on or off? - How can I speed up the keyboard's auto-repeat? - What is the SysRq key for? - How can my program tell what kind of keyboard is on the system? - How can I tell if input, output, or stderr has been redirected? - How can I increase the size of the keyboard buffer? - How can I stuff characters into the keyboard buffer? PART 3: Section 5. Disks and files - What drive was the PC booted from? - How can I boot from drive B:? - Which real and virtual disk drives are valid? - How can I make my single floppy drive both a: and b:? - How can I disable access to a drive? - How can a batch file test existence of a directory? - Why won't my C program open a file with a path? - How can I redirect printer output to a file? - How can I redirect the output of a batch file? - How can I redirect stderr? - How can my program open more files than DOS's limit of 20? - How can I read, create, change, or delete the volume label? - How can I get the disk serial number? - What's the format of .OBJ, .EXE., .COM files? - How can I flush the software disk cache? - How can I see if a drive is a RAM drive? - How can I determine a hard drive's manufacturer? - Where can I find information about the ATA/ATAPI specification? - How can I copy files to or from filenames containing date information? Section 6. Serial ports (COM ports) - How do I set my machine up to use COM3 and COM4? - How do I find the I/O address of a COM port? - But aren't the COM ports always at I/O addresses 3F8, 2F8, 3E8, and 2E8? - How do I configure a COM port and use it to transmit data? PART 4: Section 7. Other hardware questions and problems - Which 80x86 CPU is running my program? - How can a C program send control codes to my printer? - How can I redirect printer output? - Which video adapter is installed? - How do I switch to 43- or 50-line mode? - How can I find the Microsoft mouse position and button status? - How can I access a specific address in the PC's memory? - How can I read or write my PC's CMOS memory? - How can I access memory beyond 640K? - How can I use the protected mode? - How can I tell if my program is running on a PS/2-style machine. - Is there a 80x87 math unit installed? - How can I power off the computer from a batch file? Section 8. Other software questions and problems - How can a program reboot my PC? - How can I time events with finer resolution than the system clock's 55 ms (about 18 ticks a second)? - How can I find the error level of the previous program? - How can a program set DOS environment variables? - How can I change the switch character to - from /? - How can I write a TSR (terminate-stay-resident utility)? - Why does my interrupt function behave strangely? - How can I write a device driver? - What can I use to manage versions of software? - What's this 'null pointer assignment' after my C program executes? - How can a batch file tell whether it's being run in a DOS box under Windows? - How can my program tell if it's running under Windows? - How can a program tell whether ANSI.SYS is installed? - How do I copyright software that I write? - How can I place date and time information into environment variables? PART 5: (this part) Section 9. Downloading - What are SimTel and Garbo? - Can I get archives on CD-ROM? - Where do I find program ? Section 10. Vendors and products - How can I contact Borland? - How can I contact Microsoft? - What is the current version of DJGPP? - What and where is DJGPP? - Are there any good shareware/freeware compilers? - Where is QBASIC? - What is a vendor's web site address? ------------------------------ Subject: Section 9. Downloading Date: 5 Feb 2002 22:03:03 -0400 Where to do it and how to do it. ------------------------------ Subject: - What are SimTel and Garbo? Date: 8 Feb 2002 20:39:08 -0400 These are three of the most popular archive sites, with a few bazillion files available for free downloading by ftp. Many of the files are shareware and you're expected to send a payment directly to the authors if you use them regularly. SimTel can be found at: Garbo can be found at: A few words about file names and versions: Many files at the archive sites are updated from time to time. I verified every filename in this FAQ as of 08 Feb 2002 by ftping to the named sites, or by consulting their index files. If you can't find a file given in these articles as mumble12.zip, perhaps there's a newer version; try mumble13.zip or mumble14.zip, or mumble*.zip if your ftp program supports wildcards (most do so). Please let me know of any out-of-date file names. This FAQ should show both Garbo and SimTel directory and file names, if available, for every file mentioned for downloading. If you see a listing for only one of them, it means that the file was not found at the other site, or that the other site's catalog shows an old version. Also remember that caps and lower case filenames are not interchangeable at most archive sites. ------------------------------ Subject: - Can I get archives on CD-ROM? Date: 5 Feb 2002 22:03:03 -0400 Copies of the SimTel MS-DOS, Macintosh and Unix-C collections (also of wuarchive, cica, and others) are available from Walnut Creek CDROM, 1547 Palos Verdes, Suite 260, Walnut Creek, CA 94596-2228, telephone (800) 786-9907 or +1 510 674-0783, or FAX +1 510 674-0821, or email rab@cdrom.com. For a catalog of disks available, send email to info@cdrom.com, or ftp the catalog as /cdrom/catalog from cdrom.com. ------------------------------ Subject: - Where do I find program ? Date: 5 Feb 2002 22:03:03 -0400 You are asking about shareware, freeware, or public-domain programs, right? Commercial software is not legally distributed through the net, in general. (Occasionally vendors will make patches available, but these are useful only to upgrade software you already own.) That said, the quickest way to find a program you are looking for is to use a WWW search utility such as Google at . There are also several newsgroups to help you find a program. comp.binaries.ibm.pc.wanted is generally the best place to ask your question. Please review the guidelines in [What other technical newsgroups should I know about?] ------------------------------ Subject: Section 10. Vendors and products Date: 5 Feb 2002 22:03:03 -0400 Where to find them. ------------------------------ Subject: - How can I contact Borland? Date: 8 Feb 2002 01:50:16 -0400 On the Web: Information about Borland products can be found at: Please notice Borland is marketing the newsest version of Borland C++ as Borland C++Builder and the newest version of Borland Pascal as Borland Delphi. For awhile, Borland was known as Inprise, but now the name is back to Borland. ------------------------------ Subject: - How can I contact Microsoft? Date: 7 Feb 2002 01:08:35 -0400 Microsoft has stopped developing MS-DOS and most of the programming information they now provide is focused more on Windows development instead of MS-DOS programming. In ther past, individual employees of Microsoft (not MicroSoft, please!) have posted here. Their addresses all take the form person@microsoft.com. However, Microsoft as a company does not answer individual questions via email through the Internet. On the Web: Microsoft's Web server contains information on their products and allows users to search the Microsoft Knowledge Base. Via ftp: Microsoft's anonymous FTP server offers a variety of information for developers. This ftp server is run using Windows NT, so it supports both UNIX- like and DOS-like path names. For example \SOFTLIB\INDEX.TXT and /SOFTLIB/INDEX.TXT are both valid. Filenames are not case sensitive. Informarion related to MS-DOS can be found in the /SOFTLIB directory and the /PEROPSYS directory. ------------------------------ Subject: - What is the current version of DJGPP? Date: 5 Feb 2002 22:03:03 -0400 See [What and where is DJGPP?] ------------------------------ Subject: - What and where is DJGPP? Date: 5 Feb 2002 22:03:03 -0400 DJGPP is a 32-bit C/C++/Ada95 development environment created by D.J. Delorie for the MS-DOS environment, based on the GNU tools. A 16-bit version of DJGPP also exists at: DJGPP can be retrieved from the following sites: More information on DJGPP can be found in the following places: The DJGPP FAQ: (Where * is the current version.) WWW Home Page: Newsgroup: (preferred over the mailing list) ------------------------------ Subject: - Are there any good shareware/freeware compilers? Date: 8 Feb 2002 20:44:31 -0400 Borland has issued free versions of several Borland C and Pascal compilers. Users can download the Borland C++ Compiler 5.5 from . It is an ANSI compliant C++ compiler for Win32 with a number of extra feature; however, it does not include a GUI and does not appear to support MS-DOS executables. Users can also download Turbo Pascal 1.0, 3.02, and 5.5 and Turbo C 1.01 and 2.01 from the Borland Community Museum if they first register as Borland Community members at . There are several shareware/freeware compilers for MS-DOS, here are just a few: Digital Mars C and C++ compilers for Win32, Win16, DOS32 and DOS. Fast compile and link times, powerful optimization technology, design by contract, complete library source, HTML browsable documentation, disassembler, librarian, resource compiler, make, etc., command line and GUI versions, tutorials, sample code, online updates, Standard Template Library, and more. CC386: K&R C with some ANSI extensions; 32 bit, requires 386+; a port/re-write of a C compiler for the Motorola 68000 processor; freeware. DJGPP D.J. Delorie has ported the GNU C/C++ compiler to the 32-bit DOS platform. There is also an incomplete 16-bit port. Supports ANSI C and C++. Reported to be difficult for novice users. Very well supported by a large user community. Covered under GNU GPL. For more information see section [What and where is DJGPP?]. LCC: LCC supports ANSI C and support a wide variety of development platforms. Well documented in the book {A Retargetable C Compiler: Design and Implementation} ISBN 0-8053-1670-1; however, there is little free documenation. Not intended for novice users. Source code is freely available. Freeware, but not public domain. Magic Assembler: Magic Assembler is a small easy-to-use x86 assembly language compiler. It can produce .COM files as well as boot sector programs. It can also print the source using the correct addresses. (Public Domain) * * MICRO-C: Large ANSI subset; 16-bit; includes a DOS-based IDE and command-line tools; well document (approx. 400 pages); Comprehensive PC library (~300 functions) including: TSR, windowing, serial communications, and graphics; large collection of example programs (over 120); freeware; commercial versions available for many embedded processors; library source available with commercial version. MIRACLE C: Supports K&R C with minor ANSI extensions; 16 bit, compiled code runs under DOS; Compiler/IDE requires windows, 386+; Somewhat documented (approx 30 pages + windows help file); Compiler source code is available with registration; Shareware. NASM: NASM, the Netwide Assembler, is a free assembler for Intel 80x86 series of microprocessors. Not only is the assembler compatible with MS-DOS, but it will also work under Windows 95, Linux, and OS/2. More information can be found on The Netwide Assembler Project website at: Open Watcom: One of the old standards of DOS programming, the Watcom C++ compiler, will soon be released as open source software. Sybase, the owners of Watcom are currently (21-Jun-2001) in the process of preparing an open source license for the compiler. Watcom C++ is a complete package containing 16-bit and 32-bit compilers, an IDE, maker, linker, assembler, and other tools. It supports DOS, Windows, and OS/2. PACIFIC C: Supports ANSI C; 16 bit, runs on 8088+; Includes nice DOS IDE + command line tools; Well documented via large PDF file (350+ pages); Commercial versions available for several embedded processors; Freeware, but not public domain. PCC Personal C Compiler: Supports K&R C only; 16 bit, runs on 8088+; Command line interface only; Does not appear to be under current development / support; Well documented (approx 100 page text file); Shareware. Much thanks to comp.os.msdos.programmer reader Dave Dunfield for providing information about many of these compilers. ------------------------------ Subject: - Where is QBASIC? Date: 6 Feb 2002 20:53:45 -0400 QBASIC is a stripped down version of Microsoft's QuickBASIC interpretter. It is distributed with MS-DOS versions greater than 4.00. (Earlier versions included GW-BASIC or BASICA.) At first glance, Windows 95 and greater no longer included QBASIC; however, they can still be found on Windows' CDs. To find QBASIC, use the Find utility on the Start menu to search for "qbasic.*" on the Windows CD. Once you have located "qbasic.exe" and "qbasic.hlp", copy them to a folder on your hard drive. Users without Windows CDs can download QBASIC from here: . ------------------------------ Subject: - What is a vendor's web site address? Date: 5 Feb 2002 22:03:03 -0400 Have you tried http://www..com? If that doesn't work use a directory service like the Open Directory Project or a search engine like Google to search for your vendor's name. ------------------------------ Subject: Conclusion This is the end of part 5 of 5 parts. This text is copyright 2003 by Jeffrey Carlyle. All rights reserved. Please see the top of this article for additional copyright information.