News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu

Turbo Pascal 4 compatible cross-compiler

Started by litwr, 18:48, 21 May 20

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

litwr

I have made an interesting discovery recently.  I have found Turbo Pascal 4.0 compatible compiler for the 8080 based CP/M!  Its name is Express Pascal.  I knew its author, we met in 1991 but he wanted to sell his product that time.  This compiler is for a Russian computer https://en.wikipedia.org/wiki/Corvette_(computer) which has interesting graphic capabilities.  It produces code compatible with CP/M.  You only have to avoid using graphic functions.  I tried to compile several programs on the Corvette and then successfully ran them on the Amstrad CPC 6128 and BBC Micro under CP/M 2.2 and on an MSX computer.  However I can't run the code on the Amstrad CPC, PCW or Commodore 128 under CP/M+.  This compiler has very detailed documentation in Russian but any documentation about Turbo Pascal 4 can be used instead.  The compiler IDE uses English.  You need to know only differences between Express Pascal 2.0 and Turbo Pascal 4.0.  There are only a few of them:
1) no functions Freemem and Dispose, use only Release;
2) recursive functions can't have reference parameters (var-parameters);
3) no External or Interrupt procedures or functions.  It is possible to write interrupt routine but it can be done by other means;
4) you can use constant expressions anywhere instead of just plain constants;
5) a function type can be a set type;
6) you can use a reference on a variable in Absolute and Inline constructs;
7) the for-loop can use a reference instead of a variable;
8 ) an identifier length is limited to 127 characters;
9) you can use any number of procedures and functions;
10) it is possible to stop an executing program;
11) no types Single, Double, Extended, Comp - use Real instead of them;
12) the Mem-array uses unsigned integer indices;
13) system calls are different, use functions Bios and Bdos to call them (a record type Registers is provided);
14) only the next compilers directives are supported: $A, $R, $I, $S, $V;
15) you can use Private keyword inside units.
So if anybody wants to work with Turbo Pascal for his CP/M he has to use a Corvette for the cross-development.  It is quite easy because the Corvette has several good emulators.  Most of them work only under Microsoft Windows.  But there is an emulator for browsers in js, one for Android and at least two emulators for Linux.  A multi-computer emulator for Microsoft Windows - http://bashkiria-2m.narod.ru/index/files/0-11 - file emu.rar
There are also several utilities to work with disk images.  There is a package which supports a lot of retro-computer formats - http://era-cg.su/steinblume/#downloads - it is for Microsoft Windows only.  There is also a small and fast utility which is available for Microsoft Windows and Linux - https://bitbucket.org/marinovsoft/mst/src/master/
I have attached an archive with a disk image with the compiler (just type EP to run it) and documentation.
As this compiler generates the pure 8080 code DDT can be used for debugging as well as ZSID.
I dare to add several more words about the Corvette.  It was designed by several young men in Moscow State University who were very impressed by the Tandy TRS-80 in the early 80s.  So they designed their own PC and their design was supported as a standard computer for schools of the Soviet Union!  This story is similar one about Apple. :) The Corvette was made having also the MSX computers as a pattern.  It has large video memory (48 or 192 KB) and 512x256 color accelerated graphics.  Its unique detail is an independent text plain which allows to combine three graphic plains and the text plain.

AMSDOS

Peter Dassow would be interested in this, he can be reached through his website -> http://www.z80.eu/index.html
* Using the old Amstrad Languages :D   * with the Firmware :P
* I also like to problem solve code in BASIC :)   * And type-in Type-Ins! :D

Home Computing Weekly Programs
Popular Computing Weekly Programs
Your Computer Programs
Updated Other Program Links on Profile Page (Update April 16/15 phew!)
Programs for Turbo Pascal 3

mr.freeze

#2
I've found the Javascript Emulator : http://sam.ohnopub.net:10006/pk8020/pk8020.z-chat.ru/emulator/ but how to upload the disk image ?

litwr

Quote from: mr.freeze on 16:23, 29 May 20
I've found the Javascript Emulator : http://sam.ohnopub.net:10006/pk8020/pk8020.z-chat.ru/emulator/ but how to upload the disk image ?
Thank you.  I didn't know about this page.  I tried this emulator installed on my computer but I also failed to mount a disk image there. :(
The emulator mentioned above is very easy to use, it is with English interface.  Just run it, select Korvet-RMU, attach disk with EP, it's all.
You can find another my thread about EP here - https://vcfed.org/forum/showthread.php?75236-Turbo-Pascal-4-compatible-cross-compiler - it has more additional information

mr.freeze

Thanks. But It's been a long time since I gave up Windows.

litwr

#5
Quote from: mr.freeze on 18:06, 29 May 20
Thanks. But It's been a long time since I gave up Windows.
I can run it using VirtualBox and an old Windows XP. :)
There is an emulator Linux - https://bitbucket.org/esl/korvet-pk8020-emulator
However I have solved the problem of disk image attaching.  Just drag and drop an image onto I:, F: works poorly for me, it crashes after a disk write. I have added several screenshots to clarify things more.  Remove  the check mark if you want to mount an image r/w.
I have also added a screenshot of Treasure Island for the Corvette. :) Is this game available for Amstrad CPC6128?

mr.freeze

Thanks, I eventualy managed to load the image onto I: with the JS emulator.

But it always gives me a "oshibka sintaksisa" whatever I type. I typed "I:",  "DIR", "EP", "EP.COM".
But I'm not even frustrated as I've learned some cyrillic letters and two russian words using a transliteration table and a dictionary.

Now, I'm wondering what would be the hardest for me. Learn some Russian or installing Windows to use the Windows emulator  :P

litwr

Quote from: mr.freeze on 17:05, 31 May 20
Thanks, I eventualy managed to load the image onto I: with the JS emulator.

But it always gives me a "oshibka sintaksisa" whatever I type. I typed "I:",  "DIR", "EP", "EP.COM".
But I'm not even frustrated as I've learned some cyrillic letters and two russian words using a transliteration table and a dictionary.

Now, I'm wondering what would be the hardest for me. Learn some Russian or installing Windows to use the Windows emulator  :P
I don't understand what caused this problem for you.  The emulator works very well for me.  I have never got messages in Cyrillic in CP/M command line... Indeed, don't use I: under CP/M - it is a web virtual drive.  Have you tried the emulator for Linux?  It is also good.  Or are you just joking? :)


mr.freeze

Don't worry, I'm just stupid. I'v been trying to run EP from the BASIC. Now, I've associated the CP/M image uploaded on the Webdrive (I:) to A: and rebooted and it works.
In my defense, the JS emulator interface is in Russian (I think) and even Express Pascal recognises cyrillic characters as illegals :-P (joke).

A longint type is a big plus and also the fact that it supports the 8080! Also, the fact that the compiler forbid reference parameters in recursive function is well seen. TP3 allows this and it can be a nightmare to debug.
I'm currently experimenting the compiler with the touché-coulé game (battleship, I think in English) but it doens't seem to use units, only include files ? and so compilation takes a long time.
I'm still in the discovery mode and I wonder if the units can be compiled separately? If it is the case, it would be great.

Also, as you know the author, do you think it would be possible to open source EP ?

litwr

Thank you.  Yes, I knew the author but it was too long ago. I don't have any idea where to find him or sources. :( I just found EP disks but I never used it besides several tests.  Its documentation claims that it supports units but maybe they are about include files.  I have never used units with any Turbo Pascals, I always preferred sources including.

mr.freeze

#10
It supports separate compilation! Units are saved as .epi files and use the same syntax as TP4 (unit/interface/implementation/uses).

However, when I try to compile the unit to disk, it gives me an error 24: out of memory. The test unit is small and there is enough space left on the disk. It works when I compile it to memory but it is quite useless then.

The next step is to extract the documentation files and send that to Deepl for translation. The encoding is KOI8-R apparently.

Edit: The section 9.2 (Moduli) in EP9.TXT is about units I think.

litwr

Quote from: mr.freeze on 14:39, 09 June 20
It supports separate compilation! Units are saved as .epi files and use the same syntax as TP4 (unit/interface/implementation/uses).

However, when I try to compile the unit to disk, it gives me an error 24: out of memory. The test unit is small and there is enough space left on the disk. It works when I compile it to memory but it is quite useless then.

The next step is to extract the documentation files and send that to Deepl for translation. The encoding is KOI8-R apparently.

Edit: The section 9.2 (Moduli) in EP9.TXT is about units I think.
You have pushed me to try the units. :) I could compile one to a disk and get a .EPU-file - it works fine for me. But I have failed to attach this EPU module with `uses' keyword. :( Maybe I just missed something.  Anyway documentation about units is rather too brief...

mr.freeze

Ah yes .EPU, not .EPI. I'm losing my Latin.
I managed to compile successfully a unit with empty interface, implementation and main sections and to compile a program using this unit.

But if I add a procedure or a constant, it gives a memory full error or it seems to loop indefinitely. I've experienced that on the JS emulator and the Linux one with the 1.1 and 2.0 ROMs.

litwr

Quote from: mr.freeze on 14:28, 11 June 20
Ah yes .EPU, not .EPI. I'm losing my Latin.
I managed to compile successfully a unit with empty interface, implementation and main sections and to compile a program using this unit.

But if I add a procedure or a constant, it gives a memory full error or it seems to loop indefinitely. I've experienced that on the JS emulator and the Linux one with the 1.1 and 2.0 ROMs.
Sorry, I have just found a bug list for EP 2:
1) units do not work;
2) option "Find run-time error" doesn't work;
3) range check doesn't work;
4) parameters without type do not work.
:(
This list was dated August 1991.

mr.freeze



mr.freeze


litwr

Quote from: mr.freeze on 18:39, 11 June 20
I see. What's the 5th point?
It is a minor issue. The compiler gives a wrong line number when an error encountered and it is in an include file.

mr.freeze

I find the 5th point annoying, especially when units doesn't work. Nevertheless, it's still a very interesting compiler and it lets me learn at least 12 russian words!

I took a closer look to the emulator, the version for Linux. It has a 8080 debugger and even a tool to cheat at games!

EP.COM takes 37890 bytes and EP2.COM 45312 whereas TURBO.COM of TP3 takes 39671 bytes and is less capable. What's the difference between EP and EP2? Each one are announcing a 2.0 15/03/91 version for CP/M 8080.

I didn't yet manage to compile the tool to read the disk image with Free Pascal under Linux.


litwr

#19
Quote from: mr.freeze on 16:56, 16 June 20
I find the 5th point annoying, especially when units doesn't work. Nevertheless, it's still a very interesting compiler and it lets me learn at least 12 russian words!

I took a closer look to the emulator, the version for Linux. It has a 8080 debugger and even a tool to cheat at games!

EP.COM takes 37890 bytes and EP2.COM 45312 whereas TURBO.COM of TP3 takes 39671 bytes and is less capable. What's the difference between EP and EP2? Each one are announcing a 2.0 15/03/91 version for CP/M 8080.

I didn't yet manage to compile the tool to read the disk image with Free Pascal under Linux.
The error list claims that it is easy to find a true line number for the case, just subtract 2.  My knowledge of French is even below 12 words. :(
People at VCFED found out that EP and EP2 are the same compiler but one file is compressed.
I have attached the mentioned tool compiled. I didn't try to compile.  It has some minor bugs.  The erase function doesn't work for me but the copy function works. Sometimes I have to run Steinblume tools under Microsoft Windows under Virtual box.  IMHO it is possible to tune cpmtools but I failed with it.

mr.freeze

Thanks, the tool works for me now. I'm sure you know more than 12 French words, if we count loan words ;-)

Powered by SMFPacks Menu Editor Mod