Image Map Image Map
Page 1 of 5 12345 LastLast
Results 1 to 10 of 48

Thread: MASM 5.1 to .COM file under MS-DOS 6.22?

  1. #1
    Join Date
    Jun 2015
    Location
    Sioux Falls SD
    Posts
    336

    Default MASM 5.1 to .COM file under MS-DOS 6.22?

    After decades of being a TRS-80 collector, I got an IBM 5150 and 5160. My one and only MASM project back in the 80s was a TSR to collect instrument data from the serial port and save them to disk as a background task while the PC was used for data processing or word processing.

    I have the original source file, which included assembly instructions. The file will assemble to an .OBJ just fine. My instructions were to link using the /BI switch to create a .COM file. However, the /BI switch is not recognized. I no longer have the manuals, so need advice. How can I link the file to create a .COM file? Do I need to go back to an older DOS?

  2. #2

    Default

    MASM filename.ASM;
    LINK filename;
    EXE2BIN filename.EXE filename.COM

    Starting with MASM 6.0 you can do this in one step assuming the source code is setup to generate a .COM file (no relocations, ORG 100h)
    ML /AT filename.ASM

  3. #3
    Join Date
    Jan 2007
    Location
    Pacific Northwest, USA
    Posts
    32,545
    Blog Entries
    18

    Default

    ...in 6.0 and later, you can also just use the simplified segmentation directives. ".model tiny", IIRC, will automatically result in the generation of a .COM file.

    Something that ran in DOS 2.0 will almost certainly run in any later DOS.

  4. #4
    Join Date
    Jan 2005
    Location
    Principality of Xeon (NJ)
    Posts
    1,370

    Default

    I'd like to view the source if that's not asking too much.

    Is a tar by necessity a .com file? I would imagine as a tar taking up more then a single segment is a bit scary. All I remember is a certain interrupt instruction was needed to become a tsr.

  5. #5

    Default

    Quote Originally Posted by tipc View Post
    Is a tar by necessity a .com file? I would imagine as a tar taking up more then a single segment is a bit scary.
    A tar file is a Unix/Linux file archive.
    PM me if you're looking for 3" or 5" floppy disks. EMail For everything else, Take Another Step

  6. #6
    Join Date
    Jan 2007
    Location
    Pacific Northwest, USA
    Posts
    32,545
    Blog Entries
    18

    Default

    I think he means tsr. And no, an EXE file can operate as a TSR. Use Interrupt 21h/ah=31h for that. Interrupt 27h is the old way and is limited to a 64K program segment. 21h/31h is the preferred way, even returning a return code to the invocating program.

  7. #7
    Join Date
    Jun 2015
    Location
    Sioux Falls SD
    Posts
    336

    Default

    Yes, I meant a TSR (Terminate and Stay Resident). It hooks into one of the COM ports (IRQ 4 or 3), timer, DOS idle, and disk I/O functions (IRQs 8h, 28h, and 13h). It also had to reconnect the IRQs if the user used QuickBasic programs or Procomm+. The first version was in 1988. It easily fits into a single segment, and at the time, my knowledge was that .COM was the way to make TSRs. The program does use interrupt 31h for the tsr call. Never tried running as an .EXE, though.

    At this point, I'm trying to get the existing program to run as designed, which was as a .COM file. I'll try the EXE2BIN command suggested above. When did the /BI switch disappear? My program checks for DOS 3.1 or higher because of the temp file function use, so it must have been around then. I'm sure I wrote it in MASM 5.1, since that's the only version I've owned.

    Thanks for the comments and suggestion!

  8. #8

    Default

    Quote Originally Posted by lafos View Post
    Yes, I meant a TSR (Terminate and Stay Resident). It hooks into one of the COM ports (IRQ 4 or 3), timer, DOS idle, and disk I/O functions (IRQs 8h, 28h, and 13h). It also had to reconnect the IRQs if the user used QuickBasic programs or Procomm+. The first version was in 1988. It easily fits into a single segment, and at the time, my knowledge was that .COM was the way to make TSRs. The program does use interrupt 31h for the tsr call. Never tried running as an .EXE, though.

    At this point, I'm trying to get the existing program to run as designed, which was as a .COM file. I'll try the EXE2BIN command suggested above. When did the /BI switch disappear? My program checks for DOS 3.1 or higher because of the temp file function use, so it must have been around then. I'm sure I wrote it in MASM 5.1, since that's the only version I've owned.

    Thanks for the comments and suggestion!
    You mean INTs 8h, 28h, and 13h. IRQ 0-7 = INT 8-F.

    As far as I know, no version of MS LINK had a /BI switch. Until MASM 6.0 the way you generated a .COM file was MASM, LINK and EXE2BIN. Starting with MASM 6.0 you could execute ML /AT filename.ASM and generate a .COM in one step. ML actually called LINK with the new /TINY switch which didn't exist in previous versions.

  9. #9
    Join Date
    Jan 2007
    Location
    Pacific Northwest, USA
    Posts
    32,545
    Blog Entries
    18

    Default

    I just blew the dust off my MASM 5.0 manuals; /B sets the buffer size for MASM, so it's not there.

    Up until MASM 6, I've always gone the LINK+EXE2BIN route.

    Are you certain it was Microsoft's assembler and not, say, Borland's?

  10. #10
    Join Date
    Jun 2015
    Location
    Sioux Falls SD
    Posts
    336

    Default

    Quote Originally Posted by pcdosretro View Post
    You mean INTs 8h, 28h, and 13h. IRQ 0-7 = INT 8-F.

    As far as I know, no version of MS LINK had a /BI switch. Until MASM 6.0 the way you generated a .COM file was MASM, LINK and EXE2BIN. Starting with MASM 6.0 you could execute ML /AT filename.ASM and generate a .COM in one step. ML actually called LINK with the new /TINY switch which didn't exist in previous versions.
    Yes, you are right on INTs. I last looked at this code in Sept 1989, so I'm all rust on the terminology. The link instructions I wrote explicitly stated LINK /BI filename;
    to go directly to a .COM file. Could it have been a PC-DOS 3.1 link program? I'll have to look into that.

    Edit: Just looked at the PC-DOS manual. No mention of the /BI switch there either. Oh, well, I can get there with EXE2BIN.
    Last edited by lafos; November 2nd, 2019 at 06:13 PM.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •