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

Fortean.assembly programming and Interrupt 21h

ehedman
Beginner
1,189 Views
I recently purchased a new computer with Windows XT. I have several mixed programs that I want to revise, using Compaq Visual Fortran v 6.6.C and MASM 6.15. Existing programs use DOS Interrupt 21h to write to disk and printer, but I cannot get recompiled programs to do so. I get the following error:

forrtl: severe [157] Program Exception - access violation

As I said, existing programs run without any problem, but I cannot get new versions of these same programs to work.

I even tried to call FORTRAN routines from the assembler routines, and can get the file to open, but not to write.

Does anyone have any suggestions?
0 Kudos
1 Reply
Paul_Curtis
Valued Contributor I
1,189 Views
Access to DOS interrupt functions via an assembler routine with a Fortran interface was easy and common using MS (and possibly other) 16-bit compilers. I did this for years with MSF5.1, and thereby extended my Fortran programs to almost any function, with excellent performance. This interrupt function no longer exists within 32-bit Windows (NT, 2K, XP),but rather is simulated as part of Win32 support of a "virtual" DOS environment for 16-bit "legacy" programs; it isn't available at all for native 32-bit programs such as are produced with CVF and IVF.
If you want your Fortran programs to have directaccess to low-level functions, the way to do this in a Win32 environment is to use Win32 API calls, which provide a richer and vastly more capable access to all aspects ofopsys functionality (also more complex: there were some 60 sub-flavors of Int21H, but there areabout 4000 Win32 API functions in the basic set). This restrictsprograms to Win32 systems only, but can also provide vast improvements overFortran-only coding. For example, replacing Fortran file i/o statements with Win32 API calls provides much greater versatility and probably 10x speed improvement. I can provide sample Fortran-Win32 file i/o code on request (pcurtis@kiltel.com).
0 Kudos
Reply