News:

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

link Dos 16 program in MASM32

Started by Akmal Shah, October 10, 2009, 04:14:55 AM

Previous topic - Next topic

Akmal Shah

i got a problum when compiling a simple dos program with masm 32.

the error message was  "fatal error lnk1120"

the i got a solution on a forum.

the solution is given below.

------------------------

For DOS programs, there are three things you need to do differently.

1. Use and learn the revised code at the end of this message. All stripped lines are Windows specific and must not be there. All new/updated lines are required for DOS program in order to avoid any compiler error and warning.

2. Compile the ASM source to an OBJ file manually using the following command.

ml /c god2.asm

3. Link the OBJ file to produce the final EXE file. Note that the LINK.EXE can not produce DOS EXE file. Use the LINK16.EXE instead. The command should be entered like below. Note that there are 5 (five) commas at the end of the parameter.

link16 god2.obj,,,,,


--------------------------

my question is about the last line. why we use the 5 commas at the end of the file name.

kindly help me if any body know about it.

i will b very thank ful.

sinsi

The 16-bit linker took command-line parameters for .obj, .lst, .map, .lib and .exe
These were separated by commas. If there was nothing (just a comma) then the default was used.
Strictly speaking, "link16 god2,,,,," is the way to do it - or even "link16 god2;" uses all defaults.

Use "link16 god2" and you can see what it wants - it lets you type each parameter in.
Light travels faster than sound, that's why some people seem bright until you hear them.