News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Unable to produce .com file with masm32

Started by fat_cat, February 12, 2005, 03:38:17 AM

Previous topic - Next topic

fat_cat

Hi all,

This is my first post on the forum. I wanted to learn assembly lang programming , decided to start with 8086, downloaded masm32 from the internet, installed it and tried to compile and link a test program. Well, the .obj file was created but no .com file.....the link command exits with the following message....


Assembling : tst1.asm
Microsoft (R) Incremental Linker Version 5.12.8078
Copyright (C) Microsoft Corp 1992-1998. All rights reserved.

/z2
"tst1.obj" /t
"tst1.com"
NUL
LINK : warning LNK4044: unrecognized option "z2"; ignored
LINK : warning LNK4044: unrecognized option "t"; ignored
tst1.obj : warning LNK4033: converting object format from OMF to COFF
tst1.obj : fatal error LNK1190: invalid fixup found. type Ox0001


I waded thru all pages in 'The campus', but was not able to find a similar query...... I checked the linker options of masm32 but am not able to understand what I should do to get a .com file......I don't know if I missed doing some task before compiling.....much obliged if someone out there could pl. help me out here......?

MichaelW

Linker Version 5.12.8078 is a 32-bit linker that cannot be used to link a 16-bit DOS executable (EXE or COM). You can download a 16-bit linker that will do the job here:

http://spiff.tripnet.se/~iczelion/download.html

And you can assemble and link a COM file with:

ml /c filename.asm
link16 /tiny filename.obj;

(The linker will issue a harmless warning regarding the file name extension)

But if you are just starting out, why not bypass DOS and go straight to Windows programming. The coding mechanics for Windows are somewhat simpler than they are for DOS, and what this saves you on the learning curve can be applied to learning the API.
eschew obfuscation

OceanJeff32

You can also use a great command-line tool called DEBUG.EXE to produce assembly code.  (even .com files)

In fact, it's easier to make a .com file with DEBUG than any other type of file (.exe)

Search Google for DEBUG tutorials or something along those lines.  I haven't worked with debug for a few months, but I have some examples that I can send you if you want.

Jeff C
:U

P.S. Just send me an email if you want, and I'll reply with some DEBUG .com examples.

P.P.S. DEBUG is already on your computer, just type DEBUG at the command-line and ? for help I believe.
:wink
Any good programmer knows, every large and/or small job, is equally large, to the programmer!

BogdanOntanu

MASM32 package is designed for producing Win32ASM applications and not old DOS applications.
Ambition is a lame excuse for the ones not brave enough to be lazy.
http://www.oby.ro

Robert Collins

It seems like when I used to make .COM files I just made sure that all the code and data was in a single segment (the code segment CS), no stack segment used, compiled it as usual, got that no stack message, and it created a .EXE file. Then I had to use a DOS utility called EXE2BIN to convert the .EXE to a .COM file. This was a few years back so maybe today it isn't quite the same but if you had those tools it would still work.

I think that MASM.EXE (old DOS version), LINK.EXE, and EXE2BIN.EXE are on your system. I know when I installed my Windows OS they were present in the c:\windows\command directory.

pbrennick

#5
Robert,
You cannot use the linker that comes with masm32 to produce an exe that can be converted to a com file, you have to use the 16bit linker which is still available as Michael has already said.
Paul

Robert Collins

Quote from: pbrennick on February 13, 2005, 10:10:42 PM
Robert,
You cannot use the linker that comes with masm32 to produce a com file, you have to use the 16bit linker which is still available as Michael has already said.
Paul


Yeah, I know. I was refering to all the stuff in the \command directory which in my case was the old DOS MASM, LINK, and EXE2BIN files. I know this because I used them to make a .COM file.

pbrennick

Yeah, well it is interesting that XP continues to include exe2bin.exe in its installation.

Paul

Robert Collins

I am using Win 98. I too find it interesting that XP still includes any old DOS stuff since I thought that XP no longer supported DOS,  but I don't have XP so I don't know for sure whearher DOS is supported or not. In both my Win 95 and Win 98 OSes DOS commands were included in the \command directory so I just used them to make DOS applications including .COM files.

pbrennick

Robert,
Yes, there is still a lot of com files in XPs system32 directory, I find that very confusing.  link.exe is gone, though and the dos type files are dated 2001.
Paul