Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!rutgers!ames!ptsfa!hoptoad!academ!uhnix1!nuchat!steve From: steve@nuchat.UUCP (Steve Nuchia) Newsgroups: comp.lang.c Subject: Re: Assembly langauge subroutines for use with C Message-ID: <277@nuchat.UUCP> Date: Sat, 1-Aug-87 13:40:19 EDT Article-I.D.: nuchat.277 Posted: Sat Aug 1 13:40:19 1987 Date-Received: Thu, 6-Aug-87 07:18:56 EDT References: <3647@watdcsu.waterloo.edu> Distribution: na Organization: Public Access - Houston, Tx Lines: 22 Keywords: assembly function Summary: how (in general) to incant assembly In article <3647@watdcsu.waterloo.edu>, ryders@watdcsu.UUCP writes: > How does one go about writing an assembly function that can be linked > and used by a C program? I have tried several times to get my modules > to link properly but with the end result of "Unresolved external". > I have prefaced the function name with an underscore and I still can't > manage to get my C code to realize that yes, there is an assembly function > by that name in one of the linked modules. HELP! > I'm using MSC 4.0 on an IBM-PC AT. First, I suspect you've left off whatever magic phrase tells the assembler that the entry point to your function is a global symbol. Secondly, the method I use when I have to hack up an assembly module for some compiler is to coax it into emitting an assembly source from a C source containing a stub of the routine to be implemented. This way you have a good go-by. Of course this doesn't work if your compiler won't write assembly source; I don't know about MSC 4.0, but I do know that I wouldn't buy a compiler that didn't emit assembly source, no matter how good the debugger is. Steve Nuchia {{soma,academ}!uhnix1,sun!housun}!nuchat!steve