Mombu the Programming Forum sponsored links

Go Back   Mombu the Programming Forum > Programming > Create assembly obj to link with Windows objs
User Name
Password
REGISTER NOW! Mark Forums Read

sponsored links


Reply
 
1 12th March 13:49
spamtrap
External User
 
Posts: 1
Default Create assembly obj to link with Windows objs



Using MASM 5.1 and 6.x, I am able to compile and create an obj file.
However, I am unable to link it to objs created using other high-level
32-bit Windows languages. When doing so, I receive an "invalid format"
type message. Using ML.exe, I attempted to compile using the "/coff"
switch, but I received compile time errors.

Is there anything I can do so that I can create an obj that will link
with my Windows objs? (Other than rewriting the source code).

Thanks in advance.
  Reply With Quote


  sponsored links


2 12th March 13:49
tim roberts
External User
 
Posts: 1
Default Create assembly obj to link with Windows objs



If you have 16-bit MASM code (which uses segments), you cannot link it with
object code from 32-bit compilers. 16-bit and 32-bit executes in very
different environments. You cannot mix them (well, at least the linker
cannot).

So, assuming that you really do have 16-bit MASM code, your choices are (1)
find a 16-bit compiler to compiler your C code, or (2) port the MASM code
to 32-bit.
--
- Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.
  Reply With Quote
3 12th March 13:49
spamtrap
External User
 
Posts: 1
Default Create assembly obj to link with Windows objs


To the best of my knowledge, you cannot link together 16-bit obj code
with 32-bit obj code when creating PE files. You need to upgrade your
entire toolset to 32-bit:

http://www.masm32.com/

"Further Reading" on the PE formated file:

http://www.windowsitlibrary.com/Content/356/11/1.html
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/debug/base/pe_format.asp
http://www.nondot.org/sabre/os/articles/ExecutableFileFormats/

Nathan.
  Reply With Quote
4 12th March 17:28
das
External User
 
Posts: 1
Default Create assembly obj to link with Windows objs


I don't know much in MASM but NASM files can be assembled and linked.

try NASM. and if possible search for win32 assembly tutorial by "ice zelion"

same to you.
  Reply With Quote
5 12th March 17:28
pwlynch@gmail.com
External User
 
Posts: 1
Default Create assembly obj to link with Windows objs


All, much thanks for the direction. I will shift-down into first gear
and see what I can come up with.
  Reply With Quote
6 12th March 21:01
news.cybercity.dk
External User
 
Posts: 1
Default Create assembly obj to link with Windows objs


"Das" <spamtrap@crayne.org> skrev i en meddelelse
news:1131433976.763769.49900@g44g2000cwa.googlegro ups.com...

NASM is a fine assembler. However it doesn't emit debug information
for use with Visual Studio. So the choice of assembler and how to
create linkable .obj files depends on what tools are used for the
"32 bit Window languages".

If you use VC or other MS tools for your high level language programming,
use MASM for your assembler code. If you use Borland tools, NASM
might be a better choice.
  Reply With Quote
7 13th March 04:17
das
External User
 
Posts: 1
Default Create assembly obj to link with Windows objs


Great. You are right. you seem to be good at MASM can you tell any way
how to emit/produce debug info so that VC/MS tools can understand???
Again Is there any common format for debug info so that any compiler
can use it? I mean any stanard format for debug Info for all compilers.


Ofcourse I use turbo-c or DJGPP with NASM. They are fine combinations.
  Reply With Quote
8 13th March 04:18
news.cybercity.dk
External User
 
Posts: 1
Default Create assembly obj to link with Windows objs


Using VS2005 beta, my custom build step has this command line:

ML /c /Cx /Fm /Fr /H60 /Zd /Zi $(InputPath)

/c /Zd /Zi are the relevant ones, run ML /help for details.

HTH/Ole Nielsby
  Reply With Quote


  sponsored links


Reply


Thread Tools
Display Modes




Copyright © 2006 SmartyDevil.com - Dies Mies Jeschet Boenedoesef Douvema Enitemaus -
666