Monday, September 1, 2008

Running Turbo Pascal 1.0, on the CP/M, on the Spectrum +3 (emulated on Windows)

I've never been a fan of the Pascal programming language; actually, I can't stand it... for a lot of reasons, many of which can be found in the (old and must-read) paper "Why Pascal is not my Favorite Programming Language" by Brian Kernighan.

However, Turbo Pascal was different. The language was still not my favorite, but I have to admit it was far better than the standard one and the IDE was quite revolutionary for its time. I've used Turbo Pascal in the early nineties for some projects in high-school and college and, after that, I thought that was it.

Well, never say never I guess: today, when I've come across Turbo Pascal 1.0, in a wave of nostalgia I felt the urge to write and compile an "Hello World" program in dare I say ... Pascal! ;-)

It turns out that my favorite computer, in its +3 flavor, can run CP/M... how interesting! In the picture you can see Spectaculator (probably the best Spectrum emulator around) running my just-written one-liner Pascal program, compiled with Turbo Pascal one-oh :-)

In preparing this little experiment, I've found invaluable the French program (with, luckily, a French/English GUI) Manage DSK, that can create DSK disk images from a collection of files on your PC. In my case, the files contained in the Turbo Pascal ZIP archive.

For unknown reasons, in the conversion process I had to pretend that all the files were ASCII even if they're clearly not. I've noticed that in converting the files as binaries the program prepends some sort of header, which makes them unusable (maybe this has something to do with how the Amstrad CPC handles files, I don't know).

My experiment is not over though: now I have to run it on the real hardware. So, I need to find a way to put the Turbo Pascal files on an actual 3-inch disk. I think I can use an SD card and the almighty ;) zxmmc+ interface to bring the data in the real-Speccy realm, so I can then dump the image on an actual disk. This will be (probably) the topic for a future post: stay tuned.

1 comment:

Spacetime said...

I'm a big fan of Pascal programming language and Turbo Pascal is still the most popular Pascal compiler....