• Please review our updated Terms and Rules here

STRANGE COMPILER ERROR PROSPERO FORTRAN CP/M-80

plore90

Member
Joined
Dec 7, 2022
Messages
13
Hi all, 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. Any help and suggestion is welcome from all.
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
 

Attachments

  • ERRORSUMCOMPLEX.jpg
    ERRORSUMCOMPLEX.jpg
    319.4 KB · Views: 18
  • ErrorPass2.jpg
    ErrorPass2.jpg
    148.2 KB · Views: 21
  • Prospero ProFortran.zip
    108.9 KB · Views: 9
Hi,

There he is!! try to compile the program that adds two complex variables and see if it gives you the same error as me....
 

Attachments

  • ProsFort.zip
    109.1 KB · Views: 9
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????
 
22Disk transforms .COM files to .CPM to prevent DOS from trying to execute them. DOS has no checking for the validity of .COM files.

CP/M has a rename function. It's the same as the DOS one: REN old new.
 
Hello,

To confirm this, the auto rename is rename ONLY, does nothing else. So you can merely rename back. I've done this often.

I normally use NSWP for this sort of job.

Geoff
 
Hi,
i used BSWP for renaming PROFOR.CPM and PROFOR2.CPM to PROFOR.COM and PROFOR2.COM but same compiler error!!!!😔
😔
 
Can any of you here provide me with a working version of the Prospero Fortran Compiler under CP/M-80??
 
I played a bit with the compiler and was only able to reproduce your results.

The compiler throws an internal error and then compiles the rest of the code, also throwing the same error when linking.
What this internal error means is unclear.

The resulting executable file runs, but the complex functions seem to have been simply omitted.
If I use the library tool to list the content of the library .REL file I can see that the library indeed contains functions like "CADD", which is probably the complex addition routine.
So the compiler should be capable of compiling that code, but fails.
Maybe an additional file is missing or it expects a certain disk arrangement (with files on two drives?)

I only remember that colleagues used the Prospero compiler on Atari 68000 computers, I did not even know that there was a CP/M-80 version.
 
hi,
a few steps further, I installed the JOICE emulator for AMSTRAD PCW 9512. I have a version of Prospero Fortran (1.77) running on CP/M-80 for PCW 9512. I tried the PROFOR.COM compiler by importing it under Z80EMU and AppleWIN but yes block immediately by displaying 'ONLY FOR AMSTRAD...'. There's probably some routine that tests the HW and realizes it's not amstrad... Probably if someone could hack into the compiler code and modify this routine, eliminating it, everything would work on other cp/m-80 machines as well. The Amstrad version of PROFORT.COM (1.77) works perfectly on operations with complex variables without error. In the JOYCE emulator I compiled and linked the COMPLEX.FOR program without errors!!!. At this point the problem is the PROFOR.COM compiler of the standard version for CP/M-80. If someone could modify the custom version for AMSTRAD, eliminating the test on the AMSTRAD HW, surely it would work on all CP/M-80 environments.
 
I edited the AMSTRAD PROFOR.COM with a HEX-EDITOR and with a FIND I found the phrase 'ONLY For Amstrad...'
 
This is the Amstrad CP/M-80 version of PROSPERO PRO FORTRAN
 

Attachments

  • PROFORTAMSTRAD.ZIP
    80.9 KB · Views: 13
An additional problem is that the compiler checks his own integrity. If you patch it, he recognizes the modification and stops.
So one would also have to deactivate the checksumming code...
 
Right observation...we need to find someone who knows how to work on z80 assembler code, unfortunately I don't know him...
 
Hi Martin, I really have to thank you so much!!!!! You have done a GREAT high computer surgery job on the PROFOR2.COM file!!!!!!!!!!. You have shown that you have a tremendous knowledge of low level programming!!!!!!. It must have been a very heavy job to overcome the various check statuses of the compiler that PROSPERO's engineers had placed to protect the file... CHAPEAU'... You are truly GREAT!!! and you made me really happy to be able to use this old but powerful and complete FORTRAN IV compiler on any CP/M-80/8088 system. By now I had lost all hope!!!!. I tested it deeply with all the operations with complex numbers and it works like a beauty!!!. Thanks again so much!!!!. When you have 2 minutes of time I would like to know how you found the key to overcome all obstacles..... A big hello and a big thank you from me and all the community of programmers who still love the old FORTRAN language!
 
No, no, it was quite easy to patch the CPC version to work under generic CP/M 2.2.

Only the first pass PROFOR checks for the Amstrad system and whether it has been tampered with.
The second pass does not check its checksum and can be modified.

The only "problem" was, that the generic CP/M version of PROFOR uses different file names for the temporary files it writes for processing by the second pass PROFOR2 than the CPC version. Therefore , I simply changed the file names in PROFOR so that they match the names expected by the Amstrad version of PROFOR2.
Before that I disassembled the PROFOR program partially, but found this too cumbersome.

I also see that a handful of non-standard library routines exist in FORLIB.REL:
IBYTE=IPEEK(IADDR,IBYTE) POKE(IADDR,IBYTE) GETCOM(BUFFER,LENGTH) ... not sure about these parameters, there may be a 3rd one INP(PORT) OUTP(PORT,BYTE)
could be handy. But one has to be careful in providing the correct type and number parameters (some are INTEGER*1 and INTEGER*2 for addresses)
 
Perfect and efficient approach to solve the problem...Thanks. Can you give me permission to post the link of this thread on other CP/M-80 forums where I also asked for help, unfortunately without success, and where also other users would be happy to be able to use your solution for Prospero Fortran?
Thanks...
 
Back
Top