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

Calling API from ML64

Ken_Woolridge
Beginner
122 Views

Good day.  This is not specifically a Fortran compiler question, however, it's close.  Perhaps someone knows the answer to this question.

In ml64, I can no longer use INVOKE, I must use CALL.  Does the CALL instruction still use the stack (i.e. PUSH)?  I cannot get this to work.  Thanks for any help.

0 Kudos
1 Reply
jimdempseyatthecove
Honored Contributor III
55 Views

First 4 arguments are register, room for this made on stack, remaining args on stack

Default argument passing by reference.

Use BIND(C) for calling convention:

SUBROUTINE INTEROP_SUB (ARG) BIND(C,NAME="InteropSub")

FUNCTION INTEROP_FUN (ARG) BIND(C,NAME="InteropFun") RESULT (IAMFUN)

Suggest you make an exemplative shell function in Fortran, enable assembly output with source, edit that down to minimal code, then fill-in the body of the function.

 

Jim Dempsey

 

0 Kudos
Reply