- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Is it possible to call subroutines/functions written in x86 assembly from Fortran? There seems to be plenty of info on how to do this with C++ but I haven't been able to find much for Fortran. Thanks.
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You could use ISO C binding if you want to make your assembly function with a C interface. Then you can use mixed C, C++, and inline asm. Maybe you consider it cheating, but the obvious way for assembly source is to write a Fortran skeleton for your function, compile with -S, fill it in, and compile again with Fortran compiler.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It's really the same as calling from C. Just make sure the routine name has the proper case and underscore decoration, and understand that character lengths are passed at the end of the argument list.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Great!, Thanks!!

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page