Announcement

Collapse

Forum etiquette

Our mission ...

This forum is part of our mission to promote the preservation of vintage computers through education and outreach. (In real life we also run events and have a museum.) We encourage you to join us, participate, share your knowledge, and enjoy.

This forum has been around in this format for over 15 years. These rules and guidelines help us maintain a healthy and active community, and we moderate the forum to keep things on track. Please familiarize yourself with these rules and guidelines.


Remain civil and respectful

There are several hundred people who actively participate here. People come from all different backgrounds and will have different ways of seeing things. You will not agree with everything you read here. Back-and-forth discussions are fine but do not cross the line into rude or disrespectful behavior.

Conduct yourself as you would at any other place where people come together in person to discuss their hobby. If you wouldn't say something to somebody in person, then you probably should not be writing it here.

This should be obvious but, just in case: profanity, threats, slurs against any group (sexual, racial, gender, etc.) will not be tolerated.


Stay close to the original topic being discussed
  • If you are starting a new thread choose a reasonable sub-forum to start your thread. (If you choose incorrectly don't worry, we can fix that.)
  • If you are responding to a thread, stay on topic - the original poster was trying to achieve something. You can always start a new thread instead of potentially "hijacking" an existing thread.



Contribute something meaningful

To put things in engineering terms, we value a high signal to noise ratio. Coming here should not be a waste of time.
  • This is not a chat room. If you are taking less than 30 seconds to make a post then you are probably doing something wrong. A post should be on topic, clear, and contribute something meaningful to the discussion. If people read your posts and feel that their time as been wasted, they will stop reading your posts. Worse yet, they will stop visiting and we'll lose their experience and contributions.
  • Do not bump threads.
  • Do not "necro-post" unless you are following up to a specific person on a specific thread. And even then, that person may have moved on. Just start a new thread for your related topic.
  • Use the Private Message system for posts that are targeted at a specific person.


"PM Sent!" messages (or, how to use the Private Message system)

This forum has a private message feature that we want people to use for messages that are not of general interest to other members.

In short, if you are going to reply to a thread and that reply is targeted to a specific individual and not of interest to anybody else (either now or in the future) then send a private message instead.

Here are some obvious examples of when you should not reply to a thread and use the PM system instead:
  • "PM Sent!": Do not tell the rest of us that you sent a PM ... the forum software will tell the other person that they have a PM waiting.
  • "How much is shipping to ....": This is a very specific and directed question that is not of interest to anybody else.


Why do we have this policy? Sending a "PM Sent!" type message basically wastes everybody else's time by making them having to scroll past a post in a thread that looks to be updated, when the update is not meaningful. And the person you are sending the PM to will be notified by the forum software that they have a message waiting for them. Look up at the top near the right edge where it says 'Notifications' ... if you have a PM waiting, it will tell you there.

Copyright and other legal issues

We are here to discuss vintage computing, so discussing software, books, and other intellectual property that is on-topic is fine. We don't want people using these forums to discuss or enable copyright violations or other things that are against the law; whether you agree with the law or not is irrelevant. Do not use our resources for something that is legally or morally questionable.

Our discussions here generally fall under "fair use." Telling people how to pirate a software title is an example of something that is not allowable here.


Reporting problematic posts

If you see spam, a wildly off-topic post, or something abusive or illegal please report the thread by clicking on the "Report Post" icon. (It looks like an exclamation point in a triangle and it is available under every post.) This send a notification to all of the moderators, so somebody will see it and deal with it.

If you are unsure you may consider sending a private message to a moderator instead.


New user moderation

New users are directly moderated so that we can weed spammers out early. This means that for your first 10 posts you will have some delay before they are seen. We understand this can be disruptive to the flow of conversation and we try to keep up with our new user moderation duties to avoid undue inconvenience. Please do not make duplicate posts, extra posts to bump your post count, or ask the moderators to expedite this process; 10 moderated posts will go by quickly.

New users also have a smaller personal message inbox limit and are rate limited when sending PMs to other users.


Other suggestions
  • Use Google, books, or other definitive sources. There is a lot of information out there.
  • Don't make people guess at what you are trying to say; we are not mind readers. Be clear and concise.
  • Spelling and grammar are not rated, but they do make a post easier to read.
See more
See less

Turbo Pascal 4 compatible cross-compiler

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    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
    The archive mentioned above is here (its actual type is tar.bz2).
    ep.tar.bz2.zip

    Comment


      #3
      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/

      Comment


        #4
        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.

        Comment


          #5
          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.

          Comment


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

            Comment


              #7
              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/

              Comment


                #8
                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

                Comment


                  #9
                  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 or Logabax 1600
                  - Music Construction Set, IBM Music Feature edition (has red sticker on front stating IBM Music Feature)

                  Comment


                    #10
                    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 28, 2020, 01:48 AM.

                    Comment


                      #11
                      Maybe I can answer my own question. I thought that the suggestion was that EP could run on any 8080 CP/M 2.2 computer but that is not the case?
                      Sounds like the Korvet applications don't run on standard CP/M.
                      So you have to run EP inside a Korvet emulator, but the compiled application might be able to run on standard CP/M 8080 so long as you avoid graphics.

                      Do I understand correctly now ?

                      Comment


                        #12
                        I guess one last thought. The Corvette is an 8080 based machine, and so it is disappointing EP.COM does not run on a standard CP/M machine also.
                        Would the issue be that the CRT is "memory mapped" and not acting like a terminal?
                        I did download and attempt to run EP.COM on a more or less standard CP/M 2.2 machine with no luck.

                        Is there a way to get this to run with a terminal CRT?

                        Comment


                          #13
                          I guess I will keep this thread moving along...
                          So, I am wondering what it would take to get EP.COM running on a standard CP/M rig.
                          After all, Turbo Pascal for 8080 has been on many a wish list.

                          So the next clue is that the Korvet computer will run "stock" CP/M applications.
                          Sample set of one, but the Korvet simulator allowed me to load and run VEDIT.COM unchanged.

                          Therefor standard CRT/console works for text, and I assume that the Pascal UI uses text console and not graphics.

                          So - why would EP.COM not run on a standard CPM-80 machine? When I try it, the application displays nothing and seems to hang. Bank switching memory ?

                          Comment


                            #14
                            I have tried EP and EP2 on my Microbee running both cp/m 2.2 and 3.1 and no go. All I get is a some obscure characters on the 24th line of the screen and the whole system hangs.

                            Comment


                              #15
                              Originally posted by ChickenMan View Post
                              I have tried EP and EP2 on my Microbee running both cp/m 2.2 and 3.1 and no go. All I get is a some obscure characters on the 24th line of the screen and the whole system hangs.
                              yah, seems like 2 things are going on. EP is using the graphics mode of the hardware to display, and it is leveraging bank switching in memory. Both of these are going to make it hard to get EP running on a stock CP/M box.

                              Microbee is Z80 though right? You can run "stock" Turbo Pascal can you not?

                              Comment

                              Working...
                              X