Image Map Image Map
Page 1 of 4 1234 LastLast
Results 1 to 10 of 33

Thread: Turbo Pascal 4 compatible cross-compiler

  1. #1

    Default Turbo Pascal 4 compatible cross-compiler

    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 couldn'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 4 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.
    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/ Cpmtools can be used only for disk browsing (format v1050), I was not able to configure cpmtools to do a proper copy.
    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.
    korvet1.pngkorvet2.png

  2. #2

    Default

    The archive mentioned above is here (its actual type is tar.bz2).
    ep.tar.bz2.zip

  3. #3

    Default

    This is very interesting and thanks for explaining all of it, but are there specific advantages to using this over using the Turbo Pascal 3 version for CPM? Given that there aren't specifically pre-built graphics libraries for this version.

    Also, I see from the wiki article about the Corvette computer that it was built to be fully compatible with the MSX graphics standard in the BASIC implementation, but is it hardware compatible? Because if so there are some pre-existing TP3 libraries for it here: (description: ) http://www.msxarchive.nl/pub/msx/pro...ssaari/00index (directory: ) http://www.msxarchive.nl/pub/msx/pro...l/lammassaari/

  4. #4

    Default

    Quote Originally Posted by bifo86 View Post
    This is very interesting and thanks for explaining all of it, but are there specific advantages to using this over using the Turbo Pascal 3 version for CPM? Given that there aren't specifically pre-built graphics libraries for this version.

    Also, I see from the wiki article about the Corvette computer that it was built to be fully compatible with the MSX graphics standard in the BASIC implementation, but is it hardware compatible?
    I were using Turbo Pascal 3, 5, 6, and 7 for some time so I don't know much details about Turbo Pascal 4. I used Express Pascal only several times for small programs several days ago and I know rather little about it. Therefore I can give only some details about Express Pascal 2 advantages over Turbo Pascal 3.

    1) it offers good types for integers: byte, shortint, word, integer, longint;
    2) an identifier length is limited to 127 characters;
    3) you can use units;
    4) you can use Break inside loops;
    5) it produces the 8080 code (compatible with the z80 or 8085).

    I can also add a list of functions/procedures in standard library, which should work with every CP/M: Abs, Addr, Append, Arctan, Assign, Bdos, Bios, BlockRead, BlockWrite, Break, ChDir, CheckState, Chr, Close, Concat, Copy, Cos, Dec, Delete, DiskFree, DiskSize, Eof, Eoln, Erase, Exit, Exp, FilePos, FileSize, FillChar, Frac, GetDir, GetMem, Halt, Hi, Inc, Insert, Int, IoResult, Length, Ln, Lo, Mark, Memavail, Move, New, Odd, Ord, ParamCount, ParamStr, Pi, Pos, Pred, Ptr, Random, Read, ReadLn, Release, Rename, Reset, Rewrite, Round, Seek, SeekEof, SeekEoln, Sin, SizeOf, Sqr, Sqrt, Str, Succ, Swap, Trunc, Truncate, UpCase, Val, Write, WriteLn.

    The next standard library function probably will not work with any CP/M: ClrScr, Delay, GotoXY, KeyPressed, Randomize, ReadKey, ReadKeyExt.

    Graphic functions are useful only for the Corvette: Circle, ClrGScr, GetPixel, Line, PutPixel, Rectangle, SetColor.

    There are also several predefined variables in the standard library, for instance, RandSeed.

    Express Pascal IDE is very convenient and fast.

    The Corvette hardware is not compatible with the MSX. The Corvette uses very easy graphic system which consists of three 16 KB plains which gives us 8 colors and 512x256 resolution. The palette is 16 colors. The text plain is independent of graphics, it is like sprites.

  5. #5

    Default

    Quote Originally Posted by vol.litwr View Post
    I were using Turbo Pascal 3, 5, 6, and 7 for some time so I don't know much details about Turbo Pascal 4. I used Express Pascal only several times for small programs several days ago and I know rather little about it. Therefore I can give only some details about Express Pascal 2 advantages over Turbo Pascal 3.

    1) it offers good types for integers: byte, shortint, word, integer, longint;
    2) an identifier length is limited to 127 characters;
    3) you can use units;
    4) you can use Break inside loops;
    5) it produces the 8080 code (compatible with the z80 or 8085).
    The big wins here are the unsigned and long integer types, and the units.

    I'm curious how the units work in practice. They're certainly practical in their application, but one of Turbos big benefits is its compile speed. It manifests through doing everything in memory. When you start adding include files, or writing to COM files, it certainly starts slowing down. Add in UNITS to the compilation, plus now a linkage step (Turbo original did not have a link phase), and I wonder how much that impacted the overall development cycle. It should be noted that it still skips the assembly step, which it not nothing to be sure.

    But I have to think that UNITS and linking are cheaper than including source code every time as was historically done.

    The next standard library function probably will not work with any CP/M: ClrScr, Delay, GotoXY, KeyPressed, Randomize, ReadKey, ReadKeyExt.
    The ClrScr, Delay, GotoXY were all stock on CP/M, since Turbo itself used the same routines. The game there was you'd configure Turbo to work on your system and then Turbo programs would benefit from that configuration. Can't speak to the rest.

  6. #6
    Join Date
    Aug 2006
    Location
    Chicagoland, Illinois, USA
    Posts
    6,539
    Blog Entries
    1

    Default

    Very nice find. It looks like TP4 with the TP3 editor environment.
    Offering a bounty for:
    - A working Sanyo MBC-775, Olivetti M24, or Logabax 1600
    - Music Construction Set, IBM Music Feature edition (has red sticker on front stating IBM Music Feature)

  7. Default

    Turbo Pascal 4 introduced Units, which could be compiled
    separately and reused, this was a huge improvement over
    previus versions.
    BTW Borland released Turbo Modula 2 for CP/M, a very good
    compiler (units in Turbo Pascal 4 were clearly derived
    from MODULA) that was quickly dropped ...

    https://books.google.it/books?id=AC8...la%202&f=false

    https://techtinkering.com/2013/03/12...ula-2-for-cpm/

  8. #8

    Default

    Quote Originally Posted by whartung View Post
    I'm curious how the units work in practice. They're certainly practical in their application, but one of Turbos big benefits is its compile speed. It manifests through doing everything in memory. When you start adding include files, or writing to COM files, it certainly starts slowing down. Add in UNITS to the compilation, plus now a linkage step (Turbo original did not have a link phase), and I wonder how much that impacted the overall development cycle. It should be noted that it still skips the assembly step, which it not nothing to be sure.
    But I have to think that UNITS and linking are cheaper than including source code every time as was historically done.
    The ClrScr, Delay, GotoXY were all stock on CP/M, since Turbo itself used the same routines. The game there was you'd configure Turbo to work on your system and then Turbo programs would benefit from that configuration. Can't speak to the rest.
    To tell the truth, I've never used units with any TP. My experience with EP is below an hour. So I can't help much with it.
    IMHO it should be easy to configure screen code dependent routines for any CP/M but I didn't try to do such things.
    EP allows also to use quite good inline assembly, for instance,
    Code:
    prosedure DoByte (b:byte; var r: byte);
       begin
       inline (iLHLD /addr(b)-1 {comment}
             / iMVI_C  /8
             / iDAD_H
             / iJNZ   / *+-3

  9. #9
    Join Date
    Aug 2006
    Location
    Chicagoland, Illinois, USA
    Posts
    6,539
    Blog Entries
    1

    Default

    Quote Originally Posted by whartung View Post
    But I have to think that UNITS and linking are cheaper than including source code every time as was historically done.
    Precompiling code into UNITS and then linking them in is always, 100% of the time, faster than compiling all of your source. Units are about half the size of their source files, so they load in half the time, and on top of that you don't need to spend additional time compiling them.
    Offering a bounty for:
    - A working Sanyo MBC-775, Olivetti M24, or Logabax 1600
    - Music Construction Set, IBM Music Feature edition (has red sticker on front stating IBM Music Feature)

  10. #10

    Default

    Why do you call this a cross compiler?

    Seems like it runs and compiles on the same machine..

    This sounds very interesting as a solution for pascal on 8080.
    Last edited by Twospruces; May 28th, 2020 at 01:48 AM.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •