home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / alt / msdos / programm / 2308 < prev    next >
Encoding:
Text File  |  1992-09-03  |  1.8 KB  |  47 lines

  1. Newsgroups: alt.msdos.programmer
  2. Path: sparky!uunet!cis.ohio-state.edu!zaphod.mps.ohio-state.edu!sdd.hp.com!elroy.jpl.nasa.gov!usc!cs.utexas.edu!tamsun.tamu.edu!zeus.tamu.edu!ski8032
  3. From: ski8032@zeus.tamu.edu (THE MAN BEHIND THE CURTAIN)
  4. Subject: Re: Calling ASM from BC++
  5. Message-ID: <3SEP199208574974@zeus.tamu.edu>
  6. News-Software: VAX/VMS VNEWS 1.41    
  7. Keywords: c++ asm  
  8. Sender: news@tamsun.tamu.edu (Read News)
  9. Organization: Texas A&M University, Academic Computing Services
  10. References: <1992Aug24.204813.16175@schunix.uucp>
  11. Date: Thu, 3 Sep 1992 13:57:00 GMT
  12. Lines: 33
  13.  
  14. In article <1992Aug24.204813.16175@schunix.uucp>, sonix@schunix.uucp (Duane Morin) writes...
  15. >I'm trying to call an assembly routine from some standard Borland C++ (2.0)
  16. >code.  Here's what I've got (in the C++):
  17. >..
  18. >..
  19. >..
  20. >But C++ fails to recognize the foo_bar3 function.  Keeps telling me 
  21. >unrecognized symbol.  As if it doesn't get the connection, because I'm not
  22. >declaring the two int parameters in the actual definition in the ASM file.
  23. >I got the syntax for doing this out of an "Interfacing C and ASM" book, so
  24. >I assume that maybe I need to do somethng else to make this work in C++.
  25.  
  26. The problem here, as was mentioned by someone else, is the name mangling
  27. that C++ performs.  If you don't wish to have to declare it as a C function,
  28. or even worse, have to painfully trudge through some compiler's rules for
  29. name mangling, then you could do the following:
  30.   Tell the compiler to generate ASM output.  Take a look at it, and see
  31. what name is generated for the function.  Then just use this name in
  32. your asm file.
  33.  
  34. >Thank you,
  35. > Duane Morin
  36. > Walker Sonix, Inc.
  37. > sonix@schunix.uucp
  38.  
  39. Incidentally, I tried to reply earlier, but your account bounced.  So I'm
  40. following up, hoping that you will see this.
  41.  
  42. Till next time,
  43.  
  44. <>  Sam Inala  <>
  45. ski8032@zeus.tamu.edu
  46.  
  47.