- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
My laptop is running Windows 10 32-bit and I use the Intel compiler "ifort". From Fortran I can call assembly routines assembled using Masm32. My desktop is running Windows 10 64-bit and I use the Intel OneAPI compiler "ifx". I now assemble the assembler routine with ml64 in the Visual Studio 2022 package. However, any calls from Fortran to an assembly routine bombs with the following error:
forrtl: severe (157): Program Exception - access violation
Image PC Routine Line Source
FF.EXE 00007FF7C66D8A19 Unknown Unknown Unknown
Exception is raised during stack walking
Does anyone know what this error means and how I can fix this program?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Don't Touch Me There - What error 157 (Access Violation) is trying to tell you - Doctor Fortran
The calling mechanisms on x64 are very different from IA-32, with the first few arguments passed in registers. You probably need to rewrite the assembler code to compensate.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Don't Touch Me There - What error 157 (Access Violation) is trying to tell you - Doctor Fortran
The calling mechanisms on x64 are very different from IA-32, with the first few arguments passed in registers. You probably need to rewrite the assembler code to compensate.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Where can I get a reference manual for 64-bit assembly language which better explains this manner of calling assembly routines?
What registers is IFX sending the assembly routine?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ifx follows the x64 calling convention. x64 Calling Convention | Microsoft Learn
The Intel documentation has never discussed calling assembler, as it is, nowadays, an esoteric topic.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It is not an "esoteric topic" for me. Is there NO information on this???
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Esoteric for me, last used it in 1989 to talk to a "device" attached to a serial port. I asked AI and the answer was:
"Yes, assembly language is still used in modern software development, though its usage is specialized and often found in performance-critical or low-level contexts. While high-level languages are dominant for general-purpose programming, assembly remains relevant for tasks requiring direct hardware manipulation, specialized processor instructions, or optimizing performance bottlenecks. "
So I think the AI agent thinks it esoteric also.... A GITHUB entitled "Understanding Windows x64 Assembly" looked like it might be helpful.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you program in assembler, and I did so for decades, there is adequate information on how calls are made and arguments passed. You will definitely want to declare your assembler routine as BIND(C) in Fortran so that arguments are passed in a more regular fashion.
I will say that in the nearly 40 years I did Fortran support, I can count the number of times I was asked about calls to assembly on one hand.

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