[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference turris::fortran

Title:Digital Fortran
Notice:Read notes 1.* for important information
Moderator:QUARK::LIONEL
Created:Thu Jun 01 1995
Last Modified:Fri Jun 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:1333
Total number of notes:6734

1230.0. "Assembly code from Fortran - common blocks" by NETRIX::"[email protected]" (Donna McLaughlin) Wed Mar 19 1997 08:23

Hi, I have a Fortran program (a collection of individual subroutine modules) 
which uses COMMON blocks to pass data into/out of subroutines. I want to
use/edit
the assembly code of one of these subroutines but any variable passed using a
COMMON block becomes zero in the assembled code. Any variable passed as a 
parameter is fine. To alter the code to explicitly pass all variables would be
a very long job. Does anybody know of any way to solve the problem?

Thanks in advance.
Donna
[Posted by WWW Notes gateway]
T.RTitleUserPersonal
Name
DateLines
1230.1Your question is a bit too general to have a good answerTLE::EKLUNDAlways smiling on the inside!Wed Mar 19 1997 14:5617
    	I do not have a general answer to your question.  A labelled
    COMMON block is typically divided up into disjoint pieces by the
    compiler with certain names used for each piece.  Variables falling
    into any particular piece are transformed into the base symbol for
    the piece together with an offset.  Code is generated accordingly.
    I have not looked at how easy/hard this may make the resulting .s
    file to modify.
    
    	I have a couple of suggestions.  Give us an example of what you
    are trying to do.  Perhaps we can offer either a clear Fortran solution
    (preferred), or a way to do what you want using ASMs (next best) or
    a way to modify your existing Fortran source to make the .s file easier to
    tailor to your needs.
    
    Cheers!
    Dave Eklund