| CodeGuru Home | VC++ / MFC / C++ | .NET / C# | Visual Basic | Newsletters | VB Forums | Developer.com |
|
|||||||
| Assembly Questions and Answers for Assembly here! |
![]() |
|
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Linker problem
Problem with the masm32 linker.
I just wanted to test the masm32 assembler, my code couldn't be simpler: dosseg .model small .stack 200h .data .code start: mov ax, 4c00h int 21h end start This (called simple.asm) assembles fine, but f^*"s up on linking, I'll give you the compile log exactly as it appears in the command line: c:\Secondary\masm32\BIN>ml simple.asm Microsoft (R) Macro Assembler Version 6.14.8444 Copyright (C) Microsoft Corp 1981-1997. All rights reserved. Assembling: simple.asm Microsoft (R) Incremental Linker Version 5.12.8078 Copyright (C) Microsoft Corp 1992-1998. All rights reserved. /z2 "simple.obj" "simple.exe" NUL LINK : warning LNK4044: unrecognised option "z2"; ignored simple.obj : warning LNK4033: converting object format from OMF to COFF simple.obj : warning LNK4078: multiple ".data" sections found with different attributes (C0220040) LINK : fatal error LNK1181: cannot open input file "simple.exe" c:\Secondary\masm23/BIN> What did I do wrong? I'd really appreciate any help! |
|
#2
|
||||
|
||||
|
Re: Linker problem
How do you call your linker?
I think this page might be interesting to you. Another point: Are you trying to compile 16bit code with a 32 bit assembler? If so you rather should use Netwide Assembler or Flat Assembler. They are more reliable than the Microsoft Assembler. / This is my 666 post . Hope Simon don't sees this.
__________________
I am not offering technical guidiance via email or IM Come on share your photo with us! CG members photo album! Use the Code Tags! |
|
#3
|
|||
|
|||
|
Re: Linker problem
i'm afraid that didn't help, thanks anyway!
the nasm doesn't work either! It doesn't even assemble! |
|
#4
|
||||
|
||||
|
Re: Linker problem
Quote:
Worked for me! . It creates a flat exe (.com, .bin) if you want other object files to be created use the -f command line option.Yes it does assemble but everything runs in the background for example: nasm simple.asm -o simple.obj -f win32 Now you can give this another linker as input to create a 32 bit windows application. But to get this work you need additional modifcations in your source code: Code:
[Bits 32]
__________________
I am not offering technical guidiance via email or IM Come on share your photo with us! CG members photo album! Use the Code Tags! Last edited by NoHero; December 20th, 2004 at 03:14 PM. |
|
#5
|
|||
|
|||
|
Re: Linker problem
Which nasm assembler did you use?
Can you tell me the ftp URL? Thanks |
|
#6
|
||||
|
||||
|
Re: Linker problem
__________________
I am not offering technical guidiance via email or IM Come on share your photo with us! CG members photo album! Use the Code Tags! |
|
#7
|
|||
|
|||
|
Re: Linker problem
Is there absolutely no way of assembling it with masm32? By twiddling with some linker options?
Is there a place I can download the tasm assembler from? |
|
#8
|
||||
|
||||
|
Re: Linker problem
Quote:
Quote:
![]() / Like Andreas ...
__________________
I am not offering technical guidiance via email or IM Come on share your photo with us! CG members photo album! Use the Code Tags! |
|
#9
|
|||
|
|||
|
Re: Linker problem
Nope, still can't find tasm
See, I tried nasm, it just doesn't even assemble! At least masm32 assembles it into an obj file! Nasm always gives something like: parser: instruction expected I don't know what that means. |
|
#10
|
||||
|
||||
|
Re: Linker problem
Of course you cannot use the following instructions in nasm:
Code:
dosseg .model small .stack 200h .data .code TASM
__________________
I am not offering technical guidiance via email or IM Come on share your photo with us! CG members photo album! Use the Code Tags! Last edited by NoHero; December 22nd, 2004 at 09:00 AM. |
|
#11
|
||||
|
||||
|
Use MASM with DOS support. Go to THIS SITE and download MASM 6.11.
I Compiled ur code like this (simple.asm is in C:\MASM611 folder) Code:
C:\MASM611>bin\ml /c simple.asm Microsoft (R) Macro Assembler Version 6.11 Copyright (C) Microsoft Corp 1981-1993. All rights reserved. Assembling: simple.asm C:\MASM611>binr\link simple.obj,,,,, Microsoft (R) Segmented Executable Linker Version 5.31.009 Jul 13 1992 Copyright (C) Microsoft Corp 1984-1992. All rights reserved.
__________________
Rex Bagain
Last edited by rxbagain; December 23rd, 2004 at 09:03 PM. |
|
#12
|
|||
|
|||
|
Re: Linker problem
What's the five commas after simple.obj for? And why \binr? Why the "r"? I don't have a folder called binr. So all in all, it still doesn't assemble.
You guys, I really appreciate your help by the way, thank a lot! |
|
#13
|
||||
|
||||
|
Re: Linker problem
You have to install it with the DOS/Windows & NT to get the binaries for DOS (BINR folder).
The commas I used mean that I did not specify values for exefile, mapfile, libs, deffile and it will use default values if necessary. Hope it will help you.
__________________
Rex Bagain
|
![]() |
| Bookmarks |
|
||||||
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|