The Simple Guide to Using Turbo Pascal 3 in CP/M v2.2 on an CPC! Okay, so I've got all this stuff on my site, I can view it on the web browser, though I wanna run it and play around with it, though I don't know what I need to do it or the stuff I've got isn't working with it – well hopefully you have a CPC emulator or else it's gonna be a long night! :-o Okay, I must stress out the '.pas' programs on my website are specific to turbo pascal 3 – to obtain that form of Pascal here are some sites you can get it from (only one copy will do so you won't need to download it twice) – there are other sites as well: http://www.cantrell.org.uk/mirrors/ftp.nvg.ntnu.no/pub/cpc/utils/cpc/turbopas.zip ftp://ftp.nvg.ntnu.no/pub/cpc/utils/cpc/turbopas.zip There are other types of Pascal available for the Amstrad CPC line of machines (HiSoft Pascal is one which comes to mind, though there's probably a few more than that), though for these programs you -will- need Turbo Pascal 3 to run all my programs. The simple reason I'm stressing to use Turbo Pascal is because the programs are written to be run under CP/M v2.2 and in some cases CP/M Plus. Some of the generic code which I believe will run on other systems may run under other Pascal compilers on a CPC though I don't guarantee it since I haven't checked, the samples I've got there maybe merely statements which are only used in TP as TP adds additional statements on top of Generic Pascal code – so in some ways it's a bummer. Okay so you have the Turbo Pascal disc or disc image (.dsk file) and emulator (I use Caprice though Winape should be fine or CPCEMU if you perfer that – you will merely have to insert the disc into the 'A' drive for however that emulator deals with it or Insert the Disc into the 'A' drive if you have a real CPC (I hope you have a 'B' drive on that thing cause that's where I insert the disc with the pascal programs on – emulators avoid this problem cause you get a 'b' drive!). I guess the other dilemma for people out there is the fact I've got the programs on my website though it's not on a Disc Image ready to Inserted into an Emulator for Turbo Pascal to Compile and Run it, at the time of setting up this little place I wanted to make it easy to display the files and there are programs out there (CPCFS and CPCXFS) which allow you to upload it to a disc image, the other possibility (for people who don't want to type-in the programs) is if they have an emulator like CPCEMU put the file into the tape directory and use a program like JL-COPY (which should be in the above sites mentioned, in the same directory) to transfer it to disc (they are only text files). If people aren't still happy then I'll have a talk with Kev Thacker and see if Kev's happy to host a Disc Image of my Pascal Programs. Okay, so now you have Turbo Pascal (drive A), the programs are on a program disc in drive B, what now?? Okay lets start Turbo Pascal, to do this with this Disc Image type |CPM Next you will see a message 'CP/M 2.2 ----- Turbo Pascal' and 'A>turbo' with a cursor next to it -> simply press enter. Now you get the 'Include error messages (Y/N)?' messages – I usually say 'Y' if you say 'N' and type in the programs yourself and make a mistake I can only stress you had save it first, always better to say yes even though it has to load an error file (which uses up a little bit of memory) all of my programs will work when the error messages file is in memory. Now you come to the Main Menu this is where you can all sorts of things – load your files, save them, compile, run, edit – which sends you to the editor, as well as the compiler options, etc. If you want to type-in my Pascal program, perhaps best to have a blank Disc Image in Drive B, press [L] for Logged Drive and then [E] for Edit. Upon pressing [E] it will ask for a name for the program – perhaps easiest to use the same name (if you still have it) of the program you printed from my website – though anything's fine really, it's merely a name to which you will call the file though. After all that you can start typing in that program. If however, you have a Disc with Pascal Programs on it in Drive B then at the main menu 'select logged drive' press [L] and specify [B] for drive B. In order to know which program to run you will need a Directory Listing – at the main menu press [D] and at the Dir Mask type '*.pas' which will display all the Pascal files (assuming they have that '.pas' extension). To load one of those press [w] for Work file and at 'Work file name:' type the full filename of one of the '.pas' files (e.g. 'Printhex.pas') To view and edit that file press [E] to which you enter the editor. NOW, to exit the editor type [CTRL]+[k] followed by [d] which brings up the '>' prompt, pressing any of the arrow keys or enter will simply view the Main Menu again. To Run that program press [R] – program may actually compile first and then run or run depending on if it's been compiled or not previous (a second run will run it instantly without compiling again), once it's finished at the '>' prompt either press enter or any of the arrow keys to view the main menu. To Compile the program to a CP/M '.COM' file select [O] for 'Compiler options', then select [C] for COM-file. Then [Q] to Quite and to generate that file press [C] to compile that file (to Disc or Disc image). Okay, so some of you are probably wonderning that now I've done all of that and made this file to help people in using Turbo Pascal 3 in CP/M – Why?!? Why I made this guide was perhaps mostly due to having a small site with some Turbo Pascal programs on and thought it would be benefitical for anyone interested or had seen my site numerous times though only saw it as some bunch of programs with no instructions on how to use them, any simple guide to aid anyone who wants to use Turbo Pascal is better than nothing or trying to find some other site with the Turbo Pascal 3 manual on it or TP 3 Tutorial which I can't even find nowadays! :-o Why Turbo Pascal and CP/M?? Mostly personal reasons – I started learning Turbo Pascal (or Pascal on a Mac), though picked up using Turbo Pascal on a PC in DOS (might have been TP 7 or something). A few years ago (2000-2002) I was porting TP programs written in those later versions of TP for TP 3 – I had TP 3 on an old IBM XT (PC-DOS version which had all the extra goodies) and started playing around with CP/M in 1999 after some interest I got from it while doing a Diploma in Technology (Computing) course – for which I never completed! In '99 I got a bootup disk of CP/M-86 v1.1 for the IBM PC/XT which had been patched to work on later processors and a lot of work was going into making CP/M enter the 21st century with the ability use 1.44Mb Floppy Disks and a RAMDisk program which allowed Extended memory(?) to be used as a RAMDisk – I had a 386 based laptop with 4Mb on top of the 640 which CP/M was happy to run in so 4Mb is a huge mass for it. So out of interest I had the pleasure to convert DOS like programs and have them working in CP/M-86! :-D CP/M is merely the Operating System Turbo Pascal is available for – version 3 is the last, I guess the only people who really know why TP is only found on CP/M is Borland, though my guess is due to the dominance of CP/M on a range of systems in the 80s and the number of different processors which CP/M is found on (not just 8bit computers) has something to do with it to simply make Turbo Pascal more broadly available to a large audience. And CPC?? Well the CPC is something I've had since I was a kid – I still have an CPC6128, though tend to play around with the emulators a bit. CP/M-86 v1.1 (which is the same as CP/M v2.2 on an 8bit) allowed me to do a lot of nice things which the IBM had in it's arsenal – mostly hardware interrupts which could be used in DOS as well as CP/M-86! It allowed somebody to make a program with the approriate hardware to make it look modern with things like Games, Video dazzlers, etc. So of course when I learned about CP/M v2.2 being able to access the Firmware on a CPC, I got hooked with that! :-D Of course to write code like this mean's you're actually depending on the computer itself which means another machine running CP/M v2.2 may not necessarily run the code. I've tried to be cautious here by documenting the code which is CPC related and what should work under CP/M v2.2 (or CP/M-80 some say) using TP 3 on a different system. Yes I'm probably breaking all those rules about CP/M having portable programs, though I've tried to add something for everyone here while also simply creating a little spot for CPC programs under CP/M – I haven't seen quite any other site which does this. I guess my legacy to this as well is somewhat personal, I was duped into thinking CP/M sucks by some CPC magazines (I won't name them though I think you probably know) and was once dubbed the “program to format the disks!” or something along those lines, BASIC for them was the norm! For years I felt CP/M was bugged and couldn't get it to work which were merely hurdles for myself to try and understand it better. In CP/M v2.2 you need to [CTRL]+[C] when changing disks for example (same applied in CP/M-86 v1.1), doesn't worry be a bit and it's something I've come a custom to. Program wise Turbo Pascal on it's own is very Raw in CP/M and I believe you need GSX if you want graphics, though with the firmware in play, you can quickly do all that and more with colour – the other possibility is to use the control codes in 'Write' (Pascal's equivalent of 'Print') statements, so with the firmware in place programs in Turbo Pascal quickly become comparable to Locomotive BASIC programs. Locomotive BASIC has one distinct advantage I'd found so far over Turbo Pascal and that's the ability to quickly calculate mathemathical solutions and display the results sooner (so for example a simple circle which is calculated in BASIC takes a lot less time than the same equivalent program in Turbo Pascal), the main reason for this is because BASIC is an interpreted language and with that has a built-in lookup table which allows it to get quicker answers – Turbo Pascal being a compiled language does not. The best way around a problem like this in Turbo Pascal is to use an Array and simply feed the answers into it as it asks for it, this way I've found Turbo Pascal programs run a lot faster when constant arrays are used. Anyway that's about all which comes to mind for the minute, if you have any more questions simply email me: cpm22_user@yahoo.com exactly how far you can go in terms of producing something in Turbo Pascal is mainly a guess for me – with the ability of incorporating Inline Machine code (as some of my samples have) it maybe possible to make something 'near' once commercial quality. What I like about Turbo Pascal 3 is the ability to produce a '.com' file where's Locomotive BASIC doesn't without some 3rd party aid program.