- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I would like to include a few "ad-hoc" lines of source code to an already compiled Fortran code, can it be done?
The idea is to introduce a few system-specific calculations to a general purpose, and much bigger, Fortran code that should not be recompiled in that particular case.
I would like to know whether there is a viable way to do it.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Not possible.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It can be done, but will take exceptional skill to do so.
In the old days (1970's) we (I and others) would patch the executables (and operating systems) using a binary editor. The general technique was to replace an instruction with a Jump instruction to unused memory, issue the replacement code (including the overwritten instruction) then Jump back. In some cases where the patch code is smaller than the old (bad) code, the patch would overlay the old code (possibly padded with NOP or Jump).
So, the answer is it is possible, but difficult.
IIF (if and only if) the changes can be make pre-call or post-call to the Fortran code, you may be able to encapsulate the Fortran code.
Jim Dempsey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

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