News:

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

Link Error(newbie)

Started by Magnamite, February 29, 2008, 01:34:54 AM

Previous topic - Next topic

Magnamite

I have downloaded Microsoft Visual C++ 2005 Express Edition and MASM 8.0.

I then got the 16 bit linker. I can not get the linker to work.

C:\Program Files\Micro8\VC\MASM>type test.asm
.MODEL small
stacksg segment stack
        dw      100h dup(?)
stacksg ends
datasg segment
        db      45h
        dw      1234H
datasg ends
codesg  segment
assume ds:datasg,cs:codesg
.186
_start:
        mov     ax,bx
codesg ends
END _start

C:\Program Files\Micro8\VC\MASM>ml /c test.asm
Microsoft (R) Macro Assembler Version 8.00.50727.104
Copyright (C) Microsoft Corporation.  All rights reserved.

Assembling: test.asm

C:\Program Files\Micro8\VC\MASM>link16 test.obj,,,,,

Microsoft (R) Segmented Executable Linker  Version 5.60.339 Dec  5 1994
Copyright (C) Microsoft Corp 1984-1993.  All rights reserved.

test.obj : fatal error L1101: invalid object module
Object file offset: 1 Record type: 4c

C:\Program Files\Micro8\VC\MASM>
02/28/2008  05:12 PM             1,230 test.obj
               1 File(s)          1,230 bytes

this is a dump from test.obj
13B9:0100  4C 01 07 00 F2 5B C7 47-AA 03 00 00 10 00 00 00   L....[.G........
13B9:0110  00 00 00 00 2E 74 65 78-74 00 00 00 00 00 00 00   .....text.......
13B9:0120  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
13B9:0130  00 00 00 00 00 00 00 00-20 00 22 60 2E 64 61 74   ........ ."`.dat
13B9:0140  61 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   a...............
13B9:0150  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
13B9:0160  40 00 22 C0 73 74 61 63-6B 73 67 00 00 00 00 00   @.".stacksg.....
13B9:0170  00 00 00 00 00 02 00 00-2C 01 00 00 00 00 00 00   ........,.......
13B9:0180  00 00 00 00 00 00 00 00-40 00 52 C0 64 61 74 61   ........@.R.data
13B9:0190  73 67 00 00 00 00 00 00-00 00 00 00 03 00 00 00   sg..............
13B9:01A0  2C 03 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ,...............
13B9:01B0  40 00 52 C0 63 6F 64 65-73 67 00 00 00 00 00 00   @.R.codesg......
13B9:01C0  00 00 00 00 02 00 00 00-2F 03 00 00 00 00 00 00   ......../.......
13B9:01D0  00 00 00 00 00 00 00 00-40 00 52 C0 2E 64 65 62   ........@.R..deb
13B9:01E0  75 67 24 53 00 00 00 00-00 00 00 00 6B 00 00 00   ug$S........k...
13B9:01F0  31 03 00 00 00 00 00 00-00 00 00 00 00 00 00 00   1...............
13B9:0200  40 00 10 42 2E 64 72 65-63 74 76 65 00 00 00 00   @..B.drectve....
13B9:0210  00 00 00 00 0D 00 00 00-9C 03 00 00 00 00 00 00   ................
13B9:0220  00 00 00 00 00 00 00 00-00 0A 00 00 00 00 00 00   ................
13B9:0230  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
13B9:0240  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
.
.
.
13B9:0400  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
13B9:0410  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
13B9:0420  00 00 00 00 00 00 00 00-00 00 00 00 45 34 12 8B   ............E4..
13B9:0430  C3 02 00 00 00 2F 00 09-00 00 00 00 00 28 43 3A   ...../.......(C:
13B9:0440  5C 50 72 6F 67 72 61 6D-20 46 69 6C 65 73 5C 4D   \Program Files\M
13B9:0450  69 63 72 6F 38 5C 56 43-5C 4D 41 53 4D 5C 74 65   icro8\VC\MASM\te
13B9:0460  73 74 2E 6F 62 6A 34 00-13 10 03 02 00 00 01 00   st.obj4.........
13B9:0470  00 00 00 00 00 00 08 00-00 00 27 C6 1D 4D 69 63   ..........'..Mic
13B9:0480  72 6F 73 6F 66 74 20 28-52 29 20 4D 61 63 72 6F   rosoft (R) Macro
13B9:0490  20 41 73 73 65 6D 62 6C-65 72 00 00 2F 45 4E 54    Assembler../ENT
13B9:04A0  52 59 3A 73 74 61 72 74-20 00 40 63 6F 6D 70 2E   RY:start .@comp.
13B9:04B0  69 64 27 C6 7D 00 FF FF-00 00 03 00 2E 74 65 78   id'.}........tex
13B9:04C0  74 00 00 00 00 00 00 00-01 00 00 00 03 01 00 00   t...............
13B9:04D0  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
13B9:04E0  2E 64 61 74 61 00 00 00-00 00 00 00 02 00 00 00   .data...........
13B9:04F0  03 01 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
13B9:0500  00 00 00 00 73 74 61 63-6B 73 67 00 00 00 00 00   ....stacksg.....
13B9:0510  03 00 00 00 03 01 00 02-00 00 00 00 00 00 00 00   ................
13B9:0520  00 00 00 00 00 00 00 00-64 61 74 61 73 67 00 00   ........datasg..
13B9:0530  00 00 00 00 04 00 00 00-03 01 03 00 00 00 00 00   ................
13B9:0540  00 00 00 00 00 00 00 00-00 00 00 00 63 6F 64 65   ............code
13B9:0550  73 67 00 00 00 00 00 00-05 00 00 00 03 01 02 00   sg..............
13B9:0560  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
13B9:0570  2E 64 65 62 75 67 24 53-00 00 00 00 06 00 00 00   .debug$S........
13B9:0580  03 01 6B 00 00 00 00 00-00 00 00 00 00 00 00 00   ..k.............
13B9:0590  00 00 00 00 5F 73 74 61-72 74 00 00 00 00 00 00   ...._start......
13B9:05A0  05 00 00 00 02 00 2E 64-72 65 63 74 76 65 00 00   .......drectve..
13B9:05B0  00 00 07 00 00 00 03 01-0D 00 00 00 00 00 00 00   ................
13B9:05C0  00 00 00 00 00 00 00 00-00 00 04 00 00 00 00 00   ................


sinsi

ML version 8 creates COFF object files by default. Use "ML /omf " to generate the older-style OMF object files.
Light travels faster than sound, that's why some people seem bright until you hear them.

Magnamite

Thank You. I now get an exe file!