• HI-TECH C + FORTRAN-80

    From fridtjof.martin.weigel@gmail.com@21:1/5 to All on Thu Jul 29 12:16:09 2021
    Can we do it? Mix HI-TECH C and FORTRAN-80?

    Yes we can. Get OBJTOMAC.COM from

    https://github.com/ratboy666/mtrel

    And, LIBC.REL, LIBF.REL and ZCRTCPM.REL from there as well.

    Now, get

    https://github.com/ratboy666/mixed

    There is build, which shows how to start with c.c (check the source),
    which supplies main(). main() in turn call FORTRAN-80
    SUBROUTINE F(I,J) INTEGER I,J using NAMES.MAC, which maps
    names and does parameter munging for SUBROUTINE F. Easy?
    Sure is. Follow the template, and you are on your way.

    If you add in floatcnv.c, compiled with HI-TECH C you can convert
    float from HI-TECH to MicroSoft format, and pass INTEGER,
    INTEGER*4 and REAL values.

    Note that this also does "mixed I/O" -- from both C and FORTRAN.

    Just good fun!
    : fred@tara mixed $; zxcc test

    And here is some sample output:

    m1.c - main -- sign on from C

    calling fortran -- calling into FORTRAN code

    I= 10 J= 0 -- the passed-in parameters

    back from fortran -- return from FORTRAN to C

    i = 10, j = 15 -- and C printfs to show the changed value of j


    And that is all that was written!

    Fred Weigel

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)