Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Eureka! -- Archimedes


devel / comp.os.cpm / HI-TECH C + FORTRAN-80

SubjectAuthor
o HI-TECH C + FORTRAN-80fridtjof.ma...@gmail.com

1
HI-TECH C + FORTRAN-80

<b58057e6-f732-4c31-bf0c-b922c211edb5n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=2670&group=comp.os.cpm#2670

  copy link   Newsgroups: comp.os.cpm
X-Received: by 2002:a37:8242:: with SMTP id e63mr6861002qkd.294.1627586169900;
Thu, 29 Jul 2021 12:16:09 -0700 (PDT)
X-Received: by 2002:a05:6808:1889:: with SMTP id bi9mr9068687oib.139.1627586169714;
Thu, 29 Jul 2021 12:16:09 -0700 (PDT)
Path: i2pn2.org!i2pn.org!aioe.org!news.mixmin.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.os.cpm
Date: Thu, 29 Jul 2021 12:16:09 -0700 (PDT)
Injection-Info: google-groups.googlegroups.com; posting-host=2607:f2c0:956b:6a00:4779:cd51:cd73:935f;
posting-account=KOfC_woAAAC0YBGf-3r2aV5g2Aifd9jO
NNTP-Posting-Host: 2607:f2c0:956b:6a00:4779:cd51:cd73:935f
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <b58057e6-f732-4c31-bf0c-b922c211edb5n@googlegroups.com>
Subject: HI-TECH C + FORTRAN-80
From: fridtjof...@gmail.com (fridtjof.ma...@gmail.com)
Injection-Date: Thu, 29 Jul 2021 19:16:09 +0000
Content-Type: text/plain; charset="UTF-8"
 by: fridtjof.ma...@gmail - Thu, 29 Jul 2021 19:16 UTC

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

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor