Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

IFORT and Assembly

jvoo
Beginner
708 Views
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.
0 Kudos
3 Replies
TimP
Honored Contributor III
708 Views
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.
0 Kudos
Steven_L_Intel1
Employee
708 Views
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.
0 Kudos
jvoo
Beginner
708 Views
Great!, Thanks!!
0 Kudos
Reply