Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

RATFOR for the SuperSoft fortran

235 views
Skip to first unread message

Андрей Никитин

unread,
Dec 30, 2021, 11:47:57 AM12/30/21
to
I have the source code of the preprocessor RATFOR for the SuperSoft fortran compiler under CP/M. However, one or more included files are missing. Maybe someone has them?
Andrey

ldkr...@gmail.com

unread,
Dec 31, 2021, 10:40:21 AM12/31/21
to
I have the Source direct from Dr. Scherrer shared "Software Tools Archive", if that is what you are looking for.
It was released into the public Domain and was sent to BITSAVERS for Uploading by Al.


Larry

Андрей Никитин

unread,
Dec 31, 2021, 10:56:08 AM12/31/21
to
пятница, 31 декабря 2021 г. в 18:40:21 UTC+3, ldkr...@gmail.com:
> I have the Source direct from Dr. Scherrer shared "Software Tools Archive", if that is what you are looking for.
> It was released into the public Domain and was sent to BITSAVERS for Uploading by Al.
>
>
> Larry

Many companies have released their own versions of the RATFOR preprocessor. Despite the general similarity, they differed in some details. The values of constants and their names could differ. Each vendor of the RATFOR preprocessor provided its own set of functions and versions of different vendors were not compatible with each other.
Thanks for the suggestion, but I'm interested in the RATFOR preprocessor implementation released by SuperSoft for CP/M or MSDOS.

Andrey

ldkr...@gmail.com

unread,
Dec 31, 2021, 6:25:21 PM12/31/21
to
Do you have a specific computer system that was known to use the RATFOR by Supersoft?
That might narrow down the global searches.

In the TRS-80 Model 4 area of Humongous CP/M Archive there are the following files:
[quote]

ratfor20.zip

Pass Paramters to RATFOR (19xx)(Author Unknown)[MAC].zip
RATFOR Compiler and Applications (19xx)(Author Unknown)[DSK].zip

RatFor Z-80 Disassembler v1.1.1 (1982)(James Beard)[CMD].zip
RatFor Z-80 Disassembler v1.1.1 (1987)(James Beard)[CMD].zip
[/quote]

Larry

Андрей Никитин

unread,
Dec 31, 2021, 6:49:13 PM12/31/21
to
суббота, 1 января 2022 г. в 02:25:21 UTC+3, ldkr...@gmail.com:
The source code of the RATFOR preprocessor for the Model 4 TRS-80 is missing. The executable file is incompatible with CP/M. The RATFOR program is presented there as a library in the rel format. I tried to extract the RATFOR modules into separate files and compile the executable for CP/M. But it didn't work out for me. I tried to adapt the source code of RATFOR programs to work with libraries in the rel format. I partially succeeded, but it is difficult to fix the code that depends on another operating system. It is for this reason that I am looking for the RATFOR source code from Supersoft.
Andrey

Андрей Никитин

unread,
Dec 31, 2021, 7:04:32 PM12/31/21
to
суббота, 1 января 2022 г. в 02:49:13 UTC+3, Андрей Никитин:
On https://github.com/nikitinprior/RELTOASM:
LIBEDIT.RAT - the source code of the LIBE program in the RATFOR language
LIBEDIT.txt - description of the LIBE program in English
Andrey

Martin

unread,
Dec 31, 2021, 8:31:57 PM12/31/21
to
Some files are in rlee peter's cp/m archive:

/rlee/M/MORROW/BACKUPS/M10/D1/

-rwxr-xr-x 1 martin users 36864 Apr 10 1999 LIBRARYS.REL
-rwxr-xr-x 1 martin users 8320 Apr 10 1999 LISTREL.COM
-rwxr-xr-x 1 martin users 640 Apr 10 1999 LISTREL.DOC
-rwxr-xr-x 1 martin users 4864 Apr 10 1999 LOADER.COM
-rwxr-xr-x 1 martin users 17152 Apr 10 1999 MLIB.REL
-rwxr-xr-x 1 martin users 9472 Apr 10 1999 PATCHREL.COM
-rwxr-xr-x 1 martin users 1280 Apr 10 1999 PATCHREL.DOC
-rwxr-xr-x 1 martin users 1152 Apr 10 1999 RATDEFS.RAT
-rwxr-xr-x 1 martin users 36736 Apr 10 1999 RATFOR.COM
-rwxr-xr-x 1 martin users 18048 Apr 10 1999 RATFOR.FOR
-rwxr-xr-x 1 martin users 17408 Apr 10 1999 RATFOR.RAT
-rwxr-xr-x 1 martin users 128 Apr 10 1999 README.RAT


Андрей Никитин

unread,
Jan 1, 2022, 7:02:59 AM1/1/22
to
суббота, 1 января 2022 г. в 04:31:57 UTC+3, Martin:
The source code of RATFOR from SuperSoft is located at the specified address. However, there is one file missing, namely COMMON.FOR. Apparently, this is an included file with COMMON descriptions for this program. Without this file, it is impossible to compile an executable file for the preprocessor.

The COMMON.FOR file is present in the source code in the RATFOR language:

INCLUDE STDAFX.RAT

#MAIN
%#%#COMMON.FOR
CHARACTER*25 INP,OUT
DATA OUTFILE /1/, INFIL /1/

This is the file I'm trying to find.
Andrey

Martin

unread,
Jan 11, 2022, 1:11:30 AM1/11/22
to
Am 12/30/2021 05:47 PM, Андрей Никитин schrieb:
> I have the source code of the preprocessor RATFOR for the SuperSoft fortran compiler under CP/M. However, one or more included files are missing. Maybe someone has them?
> Andrey
>

It didn't look very difficult to create a small replacemtnt for
the missing "FCOMMON.FOR".

So after a few hours collecting variable types and dimensions,
here is my first version:

FCOMMON.FOR:
==== 8< =====
IMPLICIT INTEGER (A-Z)
CHARACTER*1000 SCRAT
CHARACTER*1000 GCBUF
CHARACTER*1000 FORSTK(10)
CHARACTER*1000 DTEXT
CHARACTER*1000 DNAMES
INTEGER BRKSTK(10)
INTEGER FORLEN(10)
LOGICAL EOFL
COMMON SCRAT,GCBUF,LGCBUF,
1 DTEXT,LDTEXT,DNAMES,LDNAMS,
1 BRKPTR,BRKSTK,
1 FORPTR,FORSTK,FORLEN,
1 INFIL,OUTFIL,
1 REASHR,LABEL,ERRCNT,EOFL
==== 8< =====


But this was not enough, whatever I tried, the resulting
executable failed with a lot of errors.

And hera began the funny part, placing WRITEs into the code
and looking whats going on.


I finally spotted the problem, a very silly type conversion problem.
In short, the compiler needs to do some form of padding when processing
INTERGER*1 types, a byte sized short integer type often used to hold
single characters.

Single quoted one-character constants were padded whith BLANK (32)
whereas function results (KHAR!) were padded with NULL (0).

The explicit conversion function INT1 also is used in some places,
it was very confusing at first.


Placing INT1 around every single character constant was enough to fix
the code:


$ diff RATFOR0.RAT RATFOR0.RAT
178c178
< | TOKEN == LEXDO | TOKEN == LEXDIGITS | INT1(TOKEN) == '[[' ) [
---
> | TOKEN == LEXDO | TOKEN == LEXDIGITS | INT1(TOKEN) == INT1('[[') ) [
188,189c188,189
< IF ( INT1(TOKEN) == ']' )
< IF ( INT1(LEXTYP(SP)) == '[[' )
---
> IF ( INT1(TOKEN) == INT1(']') )
> IF ( INT1(LEXTYP(SP)) == INT1('[[') )
223c223
< IF ( INT1(LEXTYP(SP)) == '[[' ) RETURN
---
> IF ( INT1(LEXTYP(SP)) == INT1('[[') ) RETURN
282c282
< IF (LEX1 == ';' | LEX1 == '[[' | LEX1 == ']' ) BREAK
---
> IF (LEX1 == INT1(';') | LEX1 == INT1('[[') | LEX1 == INT1(']') ) BREAK
343c343
< IF (K1!=' ' & K1!=TAB) BREAK
---
> IF (K1!=INT1(' ') & K1!=INT1(TAB)) BREAK
747c747
< IF (KHAR(GCBUF,1)!='(')
---
> IF (KHAR(GCBUF,1)!=INT1('('))
809c809
< IF (KHAR(INBUF,1)!='%') BREAK
---
> IF (KHAR(INBUF,1)!=INT1('%')) BREAK
855c855
< 3 IF (KHAR(INBUF,I+1) != '=')
---
> 3 IF (KHAR(INBUF,I+1) != INT1('='))
862c862
< 4 IF (KHAR(INBUF,I+1) != '=')
---
> 4 IF (KHAR(INBUF,I+1) != INT1('='))
869c869
< 5 IF (KHAR(INBUF,I+1) != '=')
---
> 5 IF (KHAR(INBUF,I+1) != INT1('='))
877c877
< IF (KHAR(INBUF,K) == '!')
---
> IF (KHAR(INBUF,K) == INT1('!'))
879c879
< ELSE IF (KHAR(INBUF,I+1) != '=')
---
> ELSE IF (KHAR(INBUF,I+1) != INT1('='))
886c886
< 7 IF (KHAR(INBUF,I+1) == '&')
---
> 7 IF (KHAR(INBUF,I+1) == INT1('&'))
892c892
< 8 IF (KHAR(INBUF,I+1) == '|')
---
> 8 IF (KHAR(INBUF,I+1) == INT1('|'))


These are the commands I used to build the preprocessor.
The two step "loader /h" + "sssload" helps to spot
the data areas inside the code.



A>ratfor
SSS/SUPERSOFT RATFOR TRANSLATOR VER. 4.1.

INPUT FILE? RATFOR.RAT
OUTPUT FILE? RATFOR.FOR
INCLUDING FILE: RATDEFS.RAT
TRANSLATING SUBROUTINE ADDTO(LSCRAT,GCBUF,I)
TRANSLATING INTEGER FUNCTION BYFILL(BUF,I)
TRANSLATING INTEGER FUNCTION KEYLUK(STR)
TRANSLATING CHARACTER*1000 FUNCTION LOOKUP(STRING)
TRANSLATING SUBROUTINE PARSE
TRANSLATING SUBROUTINE UNSTAK(SP,LEXTYP,LABVAL,TOKEN)
TRANSLATING INTEGER FUNCTION LEX(LEXSTR)
TRANSLATING SUBROUTINE DEFST
TRANSLATING SUBROUTINE INCLST
TRANSLATING SUBROUTINE IFCODE(LAB)
TRANSLATING SUBROUTINE WHILEC(LAB)
TRANSLATING SUBROUTINE WHILES(LAB)
TRANSLATING SUBROUTINE OTHERC(LEXSTR)
TRANSLATING SUBROUTINE REPCOD(LAB)
TRANSLATING SUBROUTINE UNTILS(LAB,UN)
TRANSLATING SUBROUTINE FORCOD(LAB)
TRANSLATING CHARACTER*80 FUNCTION CLAUSE(STRING)
TRANSLATING SUBROUTINE FORS(LAB)
TRANSLATING SUBROUTINE DOCODE(LAB)
TRANSLATING SUBROUTINE PUSH(LAB)
TRANSLATING SUBROUTINE DOSTAT(LAB)
TRANSLATING SUBROUTINE EXIT(CODE)
TRANSLATING INTEGER FUNCTION LABGEN(EXTRA)
TRANSLATING SUBROUTINE EATUP(LSCRAT)
TRANSLATING SUBROUTINE BALPAR(LSCRAT,DOSPLT)
TRANSLATING SUBROUTINE ERROR(IAR)
TRANSLATING SUBROUTINE READCD(BUF)

A>for ratfor ;d
COPYRIGHT (C) 1983 SMALL SYSTEMS SERVICES INC.

A>loader ratfor/h/l,mlib
SSS/SUPERSOFT LINKING LOADER VER 3.2
COPYRIGHT 1983 SMALL SYSTEMS SERVICES INC



A>sssload ratfor

Андрей Никитин

unread,
Jan 11, 2022, 8:35:27 AM1/11/22
to
вторник, 11 января 2022 г. в 09:11:30 UTC+3, Martin:
I think that actually solving this problem is not as easy as it seems.
1. You needed to make corrections to the source code of the RATFOR.RAT preprocessor. This fact suggests that the source code of the FCOMMON file.FOR is not restored quite correctly.
2, Although the modified file is processed by the preprocessor RATFOR.COM and compiled by the program FOR.COM without error messages, there is no certainty that the output after compilation creates the correct relocatable object file RATFOR.REL.
3. Next, you create an image of the executable file as a file in hexadecimal format with the extension .HEX., and not immediately as a binary file with the extension .COM.
I couldn't generate the executable file directly.
4. Then you create an executable file from a hexadecimal image. Outwardly, I managed it as well as you. However, the size of the executable file was 53 KB, instead of 37 KB in the original executable file. And most importantly, the newly created file does not work fine.

Your work on restoring the FCOMMON.FOR file is not entirely correct, since it does not lead to the creation of a properly working preprocessor program.

Andrey

Андрей Никитин

unread,
Jan 11, 2022, 9:01:56 AM1/11/22
to
вторник, 11 января 2022 г. в 16:35:27 UTC+3, Андрей Никитин:
Perhaps your final version of FCOMMON.FOR is different from the first one?
In fact, there are errors during compilation, but they are not displayed on the screen, but are located in the listing file.
Errors are just in the content area of the included file.
If the final version of FCOMMON.FOR is different, please post it.

Andrey

Андрей Никитин

unread,
Jan 11, 2022, 9:22:41 AM1/11/22
to
вторник, 11 января 2022 г. в 17:01:56 UTC+3, Андрей Никитин:
I apologize. I created the FCOMMON.FOR file incorrectly. After fixing it, everything worked.

Andrey

Андрей Никитин

unread,
Jan 11, 2022, 10:16:14 AM1/11/22
to
вторник, 11 января 2022 г. в 17:22:41 UTC+3, Андрей Никитин:
Martin

Fortran was the first programming language that I managed to learn and subsequently write programs in it, and even in the Fortran IV version. For CP/M, I know two versions of the compiler. These are Microsoft's F80 and SuperSoft's sss Fortran. Unlike Nevada Fortran, compilers of these companies are able to work with object files and form a program from several files, including libraries. It's almost like on big computers. At the present time, on toy computers with limited memory, it was possible to create such compilers. It was a miracle at the time of their creation and remains so to this day.
I am very grateful to you for restoring the FCOMMON.FOR file for the RATFOR preprocessor from SuperSoft. Another program has been restored, the source code of which has been partially lost for several decades. In those early days, the RATFOR preprocessor was in demand and represented a convenient extension of the capabilities of standard Fortran.
In fact, Fortran had significant limitations compared to subsequent programming languages. However, even complex system programs were written on it, for example, the PL/M compiler for the i8080 processor. Implementations of the Fortran IV compiler for CP/M are great and should be known to modern programmers.

Once again, I thank you for recreating the lost included file and I apologize that it was not the first time I managed to compile the program.

Regards
Andrey

Dennis Boone

unread,
Jan 11, 2022, 10:30:31 AM1/11/22
to
> In fact, Fortran had significant limitations compared to subsequent
> programming languages. However, even complex system programs were
> written on it, for example, the PL/M compiler for the i8080 processor.
> Implementations of the Fortran IV compiler for CP/M are great and should
> be known to modern programmers.

Even some operating systems were written mostly in fortran.

De

Martin

unread,
Jan 11, 2022, 1:00:25 PM1/11/22
to
Am 01/11/2022 04:16 PM, Андрей Никитин schrieb:

[...] Very hard work left out :-)

>
> Martin
>
> Fortran was the first programming language that I managed to learn and subsequently write programs in it, and even in the Fortran IV version. For CP/M, I know two versions of the compiler. These are Microsoft's F80 and SuperSoft's sss Fortran. Unlike Nevada Fortran, compilers of these companies are able to work with object files and form a program from several files, including libraries. It's almost like on big computers. At the present time, on toy computers with limited memory, it was possible to create such compilers.. It was a miracle at the time of their creation and remains so to this day..
> I am very grateful to you for restoring the FCOMMON.FOR file for the RATFOR preprocessor from SuperSoft. Another program has been restored, the source code of which has been partially lost for several decades. In those early days, the RATFOR preprocessor was in demand and represented a convenient extension of the capabilities of standard Fortran.
> In fact, Fortran had significant limitations compared to subsequent programming languages. However, even complex system programs were written on it, for example, the PL/M compiler for the i8080 processor. Implementations of the Fortran IV compiler for CP/M are great and should be known to modern programmers.
>
> Once again, I thank you for recreating the lost included file and I apologize that it was not the first time I managed to compile the program.
>
> Regards
> Andrey
>

[Sorry, I could not reply earlier]

You are welcome, nothing to apologize!

I'm also often finding me in the such situations ...

I'm very happy, you posted in such a direct way, your positive and
enthusiastic occupation enlights me.

And a *VERY BIG* thank you for your huge reverse engineering work!

I have to thank you.
Martin


Udo Munk

unread,
Jan 11, 2022, 1:09:13 PM1/11/22
to
Can you guys make then end result available somewhere, thanks.

Андрей Никитин

unread,
Jan 11, 2022, 2:14:52 PM1/11/22
to
вторник, 11 января 2022 г. в 21:09:13 UTC+3, Udo Munk:
> Can you guys make then end result available somewhere, thanks.

The source code of the RATFOR preprocessor for SuperSoft fortran for CP/M is hosted on github. It can be found at the following address:

https://github.com/nikitinprior/P_RATFOR

Andrey

Martin

unread,
Jan 11, 2022, 2:15:34 PM1/11/22
to
Am 01/11/2022 07:09 PM, Udo Munk schrieb:
> Can you guys make then end result available somewhere, thanks.
>

So, for my part...

Andrey, I would be grateful if you want to reuse my initial work.

Especially, if this working RATFOR preprocessor somehow helps to
resurrect a more complete manual, that would be fantastic.


Martin

Udo Munk

unread,
Jan 11, 2022, 4:08:21 PM1/11/22
to
Cool, thanks for the link. And the SuperSoft compiler is available somewhere too?

Martin

unread,
Jan 11, 2022, 4:34:20 PM1/11/22
to
Am 01/11/2022 10:08 PM, Udo Munk schrieb:
> Cool, thanks for the link. And the SuperSoft compiler is available somewhere too?
>


http://www.z80.eu/for-compiler.html
0 new messages