www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/01/26/11:52:49

From: "Lawrence Rust" <lvr AT NOsoftSPsystemAM DOT co DOT uk>
Newsgroups: comp.os.msdos.djgpp
Subject: Using MASM with DJGPP
Lines: 35
Organization: Software Systems
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4133.2400
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400
Message-ID: <Dchc6.1810$Jx5.65021@news2-win.server.ntlworld.com>
Date: Fri, 26 Jan 2001 15:50:12 -0000
NNTP-Posting-Host: 62.253.144.101
X-Complaints-To: abuse AT ntlworld DOT com
X-Trace: news2-win.server.ntlworld.com 980524963 62.253.144.101 (Fri, 26 Jan 2001 16:02:43 GMT)
NNTP-Posting-Date: Fri, 26 Jan 2001 16:02:43 GMT
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

I recently had to port a project to DJGPP that contained a number of Intel
format assembler source files together with a bunch of ANSI C sources.

I read the FAQ (17.2) regarding converting asm sources and tried ta2as,
intel2gas and nasm but without success.  The sources are large (500KB) and
use many complex macros and directives so and I couldn't face rewriting them
in AT&T format.

So I looked at the FAQ (17.5) on using .obj files with DJGPP and thought my
prayers were answered when it mentioned that masm COFF format obj files
could be linked to.  So I setup the makefiles and got everything building &
linking but when I ran the .exe all I got were SIGSEGV and similar.  Many
hours later, now becoming much more familiar with gdb than I'd really
wanted, I deduced that ld was incorrectly fixing up intermodule assembler
calls and local data references.

So I scratched my head and said shall I give up or shall I beat this thing?
Well I'm never one to miss a challenge so I wrote a utility to patch the
masm object files - masm2djg.  The end result is that now everything links
together; C can call assembler, assembler can call C and other assembler
functions and static data references work as expected!

I don't know if any of this would be useful to anyone but I've put together
an archive of the sources and an executable on my web server.  You can
download it from: http://www.softsystem.co.uk/masm2djg.zip

Enjoy

-- Lawrence Rust
Software Systems
6 Lode Avenue, Waterbeach, Cambs. CB5 9PX, UK
Tel/Fax +44 1223 862391
www.softsystem.co.uk


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019