From: brown@NCoast.ORG (Stan Brown)
Newsgroups: comp.os.msdos.programmer,news.answers
Subject: comp.os.msdos.programmer FAQ diffs
Date: 20 Dec 92 20:04:33 GMT
Expires: Thu, 14 Jan 1993 20:04:33 GMT
Followup-To: comp.os.msdos.programmer
Organization: Oak Road Systems, Cleveland Ohio USA

Archive-name: msdos-programmer-faq/diff1
Last-modified: 20 December 1992


As the FAQ list is quite long, I'm posting diffs for those of you who
already have copies of last month's edition (dated 15 November).  If you
want the complete list, don't worry:  I'm posting it at about the same
time but as a separate thread:  look for "comp.os.msdos.programmer FAQ
part" in the Subject line.

As usual, I've omitted trivial diffs, those involving only formatting
and punctuation, and those that show renumbered Qs with no text change.

Key:  "-" lines were in last month's FAQ list; "+" lines are in this
month's.  Line numbers are approximate only.

-  67>    207. What's the difference between .COM and .EXE formats?
+  67>    207. What's the format of an .OBJ file?
+  68>    208. What's the format of an .EXE header?
+  69>    209. What's the difference between .COM and .EXE formats?

-  91>    407. What's the format of an .EXE header?
-  92>    408. What's the format of an .OBJ file?
+  96>    410. What's the format of .OBJ, .EXE., .COM files?

+ 176>New contributors this month:  Paul Ducklin, Mike Iarrobino, Duncan
+ 177>Murdoch, Anders Thulin, Curt Tilmes, rujo@extern.uio.no

- 260>    Readership report for Oct 92" in news.lists shows 40,000 readers of
- 261>    this newsgroup worldwide.
+ 265>    Readership report for Nov 92" in news.lists shows 42,000 readers of
+ 266>    this newsgroup worldwide.  Traffic was 1090.7 Kbytes (exclusive of
+ 267>    crossposts), comprised in 611 articles.

- 314>      notices here.
+ 320>      notices to comp.os.msdos.programmer.

- 327>    - comp.binaries.ibm.pc.archives used to explain how to use the
- 328>      archive sites, especially garbo and Simtel; but the archive
- 329>      managers have stopped posting notices of uploads.  There is a vote
- 330>      (through 7 December 1992) on creating a moderated group,
- 331>      comp.archives.msdos.announce, to replace it.  In the meantime, you
- 332>      can subscribe to upload announcements by sending mail containing
- 333>      the text line "subscribe msdos-ann" and no signature to
- 334>      listserv@tacom-emh1.army.mil.
+ 333>    - comp.binaries.msdos.announce (moderated) explains how to use the
+ 334>      archive sites, especially garbo and Simtel, and lists files
+ 335>      uploaded to them.  Discussions belong in comp.binaries.msdos.d,
+ 336>      which replaced comp.binaries.ibm.pc.archives.

+ 351>    - Turbo Vision is a mailing list, not a newsgroup; send email to
+ 352>      listserv@vtvm1.cc.vt.edu if you want to subscribe.

+ 522>Q207. What's the format of an .OBJ file?
+ 524>    Here's what I've been told, though I have verified any of these
+ 525>    references myself:
+ 527>    - base .OBJ format:  Intel's document number #121748-001, {8086
+ 528>      Relocatable Object Module Formats}.  (Note however that both
+ 529>      Microsoft and Borland formats have extended the .OBJ format.)
+ 531>    - Microsoft-specific .OBJ formats:  a "Microsoft OMF Specification"
+ 532>      (document number ??), as well as a section in the MS-DOS
+ 533>      encyclopedia.
+ 535>    - A "tutorial on the .OBJ format" comes with the VAL experimental
+ 536>      linker, which is VAL-LINK.ARC in PD1:<MSDOS.PGMUTL> at Simtel.
+ 538>    If you have specific references, either to fpt-able documents or to
+ 539>    published works (author, title, order number or ISBN), please email
+ 540>    them to brown@ncoast.org for inclusion in the next edition of this
+ 541>    list.
+ 543>Q208. What's the format of an .EXE header?
+ 545>    See pages 349-350 of {PC Magazine}'s June 30, 1992 issue (xi:12) for
+ 546>    the old and new formats.  For a more detailed layout, look under INT
+ 547>    21 function 4B in Ralf Brown's interrupt list.  Ralf Brown's list
+ 548>    includes extensions for Borland's TLINK and Borland debugger info.

- 528>    ISBN 1-55615-329-5.  Ralf Brown's interrupt list also documents the
- 529>    .EXE header (including extensions by Borland's TLINK) at INT 21
- 530>    function 4B, including New Executable and Linear Executable formats.
+ 553>    ISBN 1-55615-329-5.

- 517>Q207. What's the difference between .COM and .EXE formats?
- 519>    To oversimplify:  a .COM file is a direct image of core, and an .EXE
- 520>    file will undergo some further relocation when it is run (and so it
- 521>    begins with a relocation header).  A .COM file is limited to 64K for
- 522>    all segments combined, but an .EXE file can have as many segments as
- 523>    your linker will handle and be as large as RAM can take.
+ 555>Q209. What's the difference between .COM and .EXE formats?
+ 557>    To oversimplify:  a .COM file is a direct image of core, and an .EXE
+ 558>    file will undergo some further relocation when it is run (and so it
+ 559>    begins with a relocation header).  A .COM file is limited to 64K for
+ 560>    all segments combined, but an .EXE file can have as many segments as
+ 561>    your linker will handle and be as large as RAM can take.
+ 563>    The actual file extension doesn't matter.  DOS knows that a file
+ 564>    being loaded is in .EXE format if its first two bytes are MZ or ZM;
+ 565>    otherwise it is assumed to be in .COM format.  For instance, I am
+ 566>    told that DR-DOS 6.0's COMMAND.COM is in .EXE format.

- 915>Q407. What's the format of an .EXE header?
- 917>    See pages 349-350 of {PC Magazine}'s June 30, 1992 issue (xi:12) for
- 918>    the old and new formats.  For a more detailed layout, look under INT
- 919>    21 function 4B in Ralf Brown's interrupt list.
- 921>Q408. What's the format of an .OBJ file?
- 923>    I have seen a reference to Intel's document number #121748-001,
- 924>    {8086 Relocatable Object Module Formats}, which covers the Intel
- 925>    .OBJ format.  However, both Microsoft and Borland formats differ
- 926>    from the base Intel format.  If you have specific references, either
- 927>    to fpt-able documents or to published works (author, title, order
- 928>    number or ISBN), please email them to brown@ncoast.org for inclusion
- 929>    in the next edition of this list.

- 957>Q410. How can I read, create, change, or delete the volume label?
- 959>    You can't do it using the more modern DOS functions (3C, 41, 43),
- 960>    but the older FCB-oriented directory functions will do the job.
- 961>    Specifically, you need to allocate a 64-byte buffer and a 41-byte
- 962>    extended FCB (file control block).  Call INT 21 AH=1A to find out
- 963>    whether there is a volume label.  If there is, AL will return 0 and
- 964>    you can change the label using DOS function 17 or delete it using
- 965>    DOS function 13.  If there is no volume label, function 1A will
- 966>    return FF and you can create a label by using function 16.
- 968>    The following MSC 7.0 code worked for me, where the parameter is 0
+ 977>Q408. How can I read, create, change, or delete the volume label?
+ 979>    In DOS 5.0 (and, I believe, in 4.0 as well), there are actually two
+ 980>    volume labels: one, the traditional one, is an entry in the root
+ 981>    directory of the disk; and the other is in the boot record along
+ 982>    with the serial number (see next Q).  The DIR and VOL commands
+ 983>    report the traditional label; the LABEL command reports the
+ 984>    traditional one but changes both of them.
+ 986>    In DOS 4.0 and later, use INT 21 function 69 to access the boot
+ 987>    record's serial number and volume label together; see the next Q.
+ 989>    Assume that by "volume label" you mean the traditional one, the one
+ 990>    that DIR and VOL display.  Though it's a directory entry in the root
+ 991>    directory, you can't change it using the newer DOS file-access
+ 992>    functions (3C, 41, 43); instead, use the old FCB-oriented directory
+ 993>    functions.  Specifically, you need to allocate a 64-byte buffer and
+ 994>    a 41- byte extended FCB (file control block).  Call INT 21 AH=1A to
+ 995>    find out whether there is a volume label.  If there is, AL returns 0
+ 996>    and you can change the label using DOS function 17 or delete it
+ 997>    using DOS function 13.  If there's no volume label, function 1A will
+ 998>    return FF and you can create a label via function 16.  Important
+ 999>    points to notice are that ? wildcards are allowed but * are not; the
+1000>    volume label must be space filled not null terminated.
+1002>    The following MSC 7.0 code worked for me in DOS 5.0; the functions
+1003>    it uses have been around since DOS 2.0.  The function parameter is 0

- 971>    root directory for volume labels.  This code should work for DOS
- 972>    2.0+, though I tested it only under DOS 5.0.  (I don't know what
- 973>    happens with networked drives.)
- 975>    Important points to notice are that ? wildcards are allowed but *
- 976>    are not; the volume label must be space filled not null-terminated.
+1006>    root directory for volume labels.  (I didn't try to change the
+1007>    volume label of any networked drives.)
+1009>    // Requires DOS.H, STDIO.H, STRING.H

-1023>Q411. How can I get the disk serial number?
+1055>Q409. How can I get the disk serial number?

+1061>    This function also gets and sets the volume label, but it's the
+1062>    volume label in the boot record, not the volume label that a DIR
+1063>    command displays.  See the preceding Q.
+1065>Q410. What's the format of .OBJ, .EXE., .COM files?
+1067>    Please see section 2, "Compile and link".

-1256>    I'm outside my expertise on this one, but in November 1992 Jamshid
-1257>    Afshar (jamshid@emx.utexas.edu) kindly supplied the following:
+1296>    I'm outside my expertise on this one, but in late 1992 Jamshid
+1297>    Afshar (jamshid@emx.utexas.edu) kindly supplied the following, which
+1298>    incorporates some corrections agreed with Duncan Murdoch (dmurdoch@
+1299>    mast.queensu.ca).  If you have any corrections or comments, please
+1300>    send them to both the above addresses.

-1260>    1. Use XMS memory (don't bother with EMS).  There are some libraries
-1261>    available at Simtel to access XMS.  The disadvantage is that you
+1303>    1. Use XMS or EMS memory.  XMS is preferable in most cases, but
+1304>    some machines won't provide it.  There are some libraries available
+1305>    at Simtel to access XMS or EMS.  The disadvantage is that you

-1268>    program will run on even 286s.
-1270>    2. Program under MS Windows.  MS Windows functions as a DOS extender
-1271>    (see #3).  Borland/Turbo C++ 3.0 includes EasyWin [and Microsoft
-1272>    C/C++ 7.0 has QuickWin --ed.] which is a library that automatically
-1273>    lets you compile your current code using C/C++ standard input or
-1274>    <conio.h>'s gotoxy() into a MS Windows program so your code can
-1275>    immediately allocate many MBs of memory (Windows enhanced mode even
-1276>    does virtual memory).  The disadvantage of MS Windows is that any
-1277>    one object (e.g., a single malloc( )) is still restricted to 64K
-1278>    (unless you want to mess with huge pointers in Windows).
-1280>    3. Use a DOS extender.  This is definitely the best solution from
-1281>    the programmer's standpoint.  You just allocate as much memory as
-1282>    you need using malloc( ) or `new' and you don't have to worry about
-1283>    any 64K limits.  It doesn't require source code changes and unlike
-1284>    option #1 your code is portable and not obsolete in a few months.
-1285>    Your options for this solution are:
-1287>    - Buy PharLap's DOS extender (286 or 386 version) that works with
-1288>      BC++ 3.0+ (just requires a relink).  Note, the BC++ 3.1 upgrade
-1289>      came with PharLap "lite".
-1291>    - Get the GNU (free,copylefted) gcc 2.1 compiler/extender that was
-1292>      ported to MS-DOS and runs on 386 machines (supports C and C++).
-1293>      FTP to barnacle.erc.clarkson.edu and get pub/msdos/djgpp/readme.
-1295>    - Wait for Borland's DOS extender package (in BC++ 4.0) that is
-1296>      supposed to be released at the end of this year.  I believe MS is
-1297>      also doing the same.  Zortech 3.0 comes with a DOS extender, but I
-1298>      wouldn't recommend the product.
-1300>    4. This option doesn't really count since it's not a solution in
+1312>    program will easily run on even 286s.
+1314>    2.  Program under MS Windows.  MS Windows functions as a 16-bit DOS
+1315>    Extender (see #3).  Borland/Turbo C++ 3.x includes EasyWin [and
+1316>    Microsoft C/C++ 7.0 has QuickWin --ed.] which is a library that
+1317>    automatically lets you compile your current code using C/C++
+1318>    standard input or <conio.h> into a MS Windows program so your code
+1319>    can immediately allocate many MBs of memory (Windows enhanced mode
+1320>    even does virtual memory).  The disadvantage is that like any 16-bit
+1321>    Extender a single malloc() is restricted to 64K (unless you want to
+1322>    mess with huge pointers in Windows).  Also, EasyWin's screen output
+1323>    is significantly slower than a DOS character-mode program's and you
+1324>    must of course run the program from Windows.
+1326>    3.  Use a 16-bit or 32-bit DOS Extender.  This is definitely the
+1327>    best solution from the programmer's standpoint.  You just allocate
+1328>    as much memory as you need using malloc() or 'new'.  A 16-bit
+1329>    Extender still has 16-bit ints and restricts arrays to 64K, but a
+1330>    32-bit Extender has 32-bits ints (which makes porting a lot of UNIX
+1331>    code easier) so there are no 64K limits.  A 32-bit Extender requires
+1332>    a 32-bit compiler and the program will not run on 286s.  Some
+1333>    Extenders also do virtual memory.  Using an Extender doesn't require
+1334>    source code changes and unlike option #1 your code is portable and
+1335>    not obsolete in a few months.  Your options for this solution are:
+1337>    - Buy PharLap's 16-bit Extender that works with BC++ 3.0+ and MSC
+1338>      (just requires a relink).  Note, the BC++ 3.1 upgrade came with
+1339>      PharLap "lite".  Pharlap's 32-bit Extender works with 32-bit
+1340>      compilers like [?]
+1342>    - Get the GNU (free,copylefted) gcc 2.x compiler which DJ Delorie
+1343>      ported from UNIX and which uses his 32-bit Extender.  It supports
+1344>      C and C++, but the Extender is VCPI which means neither the
+1345>      compiler nor programs it produces will run in a DOS session under
+1346>      Windows.  FTP to barnacle.erc.clarkson.edu and get
+1347>      pub/msdos/djgpp/readme.
+1349>    - Get a 32-bit compiler or one that comes with a DOS Extender.
+1350>      Zortech comes with 16-bit and a 32-bit Extenders (no debugger for
+1351>      32-bit programs, but Flashtek sells one).  Watcom also makes a C
+1352>      [and C++?] 32-bit compiler.  [If anyone else has products or plans
+1353>      to announce, please let me know.]
+1355>    - Buy Borland Pascal 7.0.  It includes a 16 bit royalty-free DOS
+1356>      extender using the same interface as MS Windows.  It functions
+1357>      under a DPMI server like Windows or QDPMI from Quarterdeck, and
+1358>      also provides its own server which you can distribute with your
+1359>      programs.
+1361>    4.  This option doesn't really count since it's not a solution in

-1302>    OS/2 2.0 or UNIX (or Win32/NT when it comes out).  Borland is
-1303>    putting its OS/2 compiler into beta now.  OS/2 is doing well (and it
-1304>    runs DOS or Windows programs).  BC++ for OS/2 should also be a
-1305>    success and there should be a good upgrade path from current Borland
-1306>    compilers.
+1363>    OS/2 2.0 or UNIX (or NT when it comes out).  I believe Win32 will
+1364>    allow you to write 32-bit Windows programs.  [can someone fill me in
+1365>    on what exactly Win32 is?]

-1605>    In PD1:<MSDOS.PGMUTL> at Simtel you'll find RCS55.ZIP.  I haven't
+1664>    In PD1:<MSDOS.PGMUTL> at Simtel you'll find RCS56DOS.ZIP.  I haven't

-1607>    utility, but is limited to one-character extensions on filenames (no
-1608>    .CPP).  A correspondent wrote that he has an RCS port to DOS that is
-1609>    not limited to one-character extensions, but he doesn't remember
-1610>    where he got it.  Anyone have a verified archive site?
+1666>    utility, and is no longer limited to one-character extensions on
+1667>    filenames (so .CPP and .BAS are fine).

(end of diffs for comp.os.msdos.programmer FAQ)
-- 
Stan Brown, Oak Road Systems                      brown@Ncoast.ORG
Cleveland, Ohio, USA
Newsgroups: comp.os.msdos.programmer