STRANGE COMPILER ERROR PROSPERO FORTRAN CP/M-80

  • Hi all, I moved the old thread to this section hoping for better luck.

    I installed the Vdos emulator on my pc (Windows 10 pro 64b) and the Z80EMU emulator inside Vdos to have a CP/M-80 environment. It all works fine. I then created a directory C:\PROSPERO in Z80EMU and copied all the Prospero PRO Fortran v. compiler files. zz 1.2 (cp/m-80 version). I tried compiling various .FOR sources and everything worked fine. I then created a simple COMPLEX.FOR program where I defined 3 variables A, B, Z of type complex and then I made the simple sum Z=A+B and then printed the result. When I launch the PROFOR compiler COMPLEX.FOR appears after Pass 1 without errors, Pass2 which gives me "Error C at address 1D5F" Continue Y/N?. This happens only if in the program there are arithmetic operations (+,-,*,/) between complex variables, if in the program operations of addition, subtraction, multiplication or division are not performed between complex variables, but all the other mathematical operations and trigronometric functions on complex variables everything compiles fine. The error appears only if there are basic arithmetic operations. The same error appear on a real APPLE//e with CP/M card..Any help and suggestion is welcome from all.

    Code
    If anyone could kindly provide a working copy of the Prospero fortran compiler under CP/M-80 I would be very grateful...

    PROGRAM COMPLE

    IMPLICIT REAL (A-H,O-Z)

    COMPLEX A,B,Z

    Z = (0.0, 0.0)

    A = (3.5, 3.5)

    B = (4.0, 5.0)

    Z = B + A

    WRITE(1,10) A, B, Z

    10 FORMAT(1H ,2F11.3,2H ,2F11.3,2H ,2F11.3)

    PAUSE

    STOP

    END

    ProFort.rar

  • This doesn't look like a compile error, but rather a runtime error of the compiler pass 2 itself (Prospero Fortran only prefixes run-time errors with letters).

    Interesting...the error is repeated on all Z80 emulators (and also on the real and emulated AppleIIe...) what I don't understand is why only when I add, subtract, multiply and divide two complex variables, the exponentiation, square root, sine, cosine etc. etc. of a complex variable does not throw the error...

    Only with the four mathematical operations +,-.*,/

  • The compiler run "PROFOR Source file.for

    or PROFOR 'enter' and

    and he asks you for the name of the source file and then the various compilation options.

    I tried it under Virtual DOS and Z80Emu and it works fine also on APPLE IIe with Z80 card and CPM 2.0, apart from the error it gives me when executing the instructions of addition, subtraction, multiplication and division of two complex variables. Transcendental functions on complex variables work perfectly even in double precision!!!

    I can't remember which website I downloaded it from, I can't find it anymore by doing various searches on google with prospero fortran compiler etc. etc. but i have the original downloaded and unzipped. I suspect that I simply renamed the files profor.cpm, profor2.cpm, prolink.cpm and prolib.cpm, i.e. all the files with the .cpm extension in .COM. Maybe there was another intermediate step to perform that I I don't know and for this reason the compiler is corrupted?. I found that the 22DISK software transforms a file from cp/m to DOS (with a utility that first changes the extension from .com cp/m to .CPM and then converts from .CPM to .COM dos and the file can run under DOS environment.So I think the owner who published the compiler put it on the web having partially transformed it with 22DISK into .CPM and then shared it on the web.But how can you get it back to .COM cpm without simply rename it like I did (and evidently corruptended the PROFOR.CPM file!!!)

  • Is there anyone here who can tell me how to convert an executable file (PROFOR.CPM) with extension .CPM into an executable file in CP/M-80 environment with extension .COM (i.e. PROFOR.COM)????

  • In the meantime ... I played a little bit with the Prospero FORTRAN compiler for CP/M.


    The Prospero compiler Version 1.2 for CP/M consists of two passes:

    PROFOR.COM which parses the FORTRAN code and creates a temporary file.

    It then calls the second pass PROFOR2.COM to create the final *.REL object file.

    For linking with FORLIB.REL on uses PROLINK.COM.


    All COMPLEX intrinsic library functions like CSIN() or CABS() seem to work.

    The COMPLEX operators for addition, subtraction, multiplication and division do not work.

    They raise a compiler error in the second pass PROFOR2.COM.

    The resulting object file can be linked and executed, but the COMPLEX operators simply do nothing.


    It is interesting to note, that there are functions like $CADD and $CSUB inside the FORLIB.REL library. So the support for complex operators is there, but the compiler does not apply them to complex arguments.


    Solutions:

    A) Roll-your-own replacement functions

    Of course, it is possible to write your own replacement functions, but then you must call them like so

    C = CADD(A,B)

    instead of the direct operator

    C = A+B

    B) Modify the compiler

    There is a variant of the compiler for the Amstrad/Schneider CPC CP/M computers.

    Unfortunately, the PROFOR.COM driver of this variant checks whether it is executed on a CPC computer and quits, if not.

    It also checks whether it has been tampered with and quits if this is the case.


    Luckily, the second pass program PROFOR2.COM does not check whether it runs on a CPC system.

    Therefore, I replaced the second pass of the generic CP/M version with the one from the CPC.


    Additionally, the CPC version uses different file names for its intermediate files.

    CPC: PTEM$IL2.$$$ PTEM$NAM.$$$

    CP/M: PRO$TEM$.IL2 PRO$TEM$.NAM


    So I also patched the file names in the CPC version of PROFOR2.COM to match the names used by the generic CP/M version of PROFOR.COM.


    And ... it seems to work. The operators like +-*/ now produce the expected results.

    The library FORLIB.REL is identical and can be left unchanged.



    Test Program