Do you still remember the time?
There are at least 3 version of Turbo Pascal free for download (version 1, 3 and 5.5), I suggest to download Turbo Pascal 5.5.
Tutorial for Turbo Pascal 5.5.
1. download the software from here.
alternative download from http://altd.embarcadero.com/download/museum/tp55.zip
2. extracted the software, there are two directory DISK1 and DISK2, basically you just need DISK1.
3. run the software
> turbo
You can run the program direct from Windows terminal, if you are using Linux you can run it under a simulator. I am using the DosBox simulator.
You can download DosBox from sourceforge.
After running the DosBox, create the C drive by:
> mount C c:\tp55
or
> mount C /home/user/foo (unix system)
(the second parameter is your Turbo Pascal program path on your real hard disk)
4. Write your first pascal program, File, New.
Program hello(output); begin writeln('hello world!'); end.
File, Save as, hello.pas.
Compile the program shows ok, but if you run the program, you don't see the result. Actually it display the result but it was clear once the program terminate.
5. Make some modification
Program hello(output); var n: Integer; begin writeln('hello world!'); readln(n); end.
Run:
hello world! 1 (input anything thing and just press enter)
6. Make it to executable
Alternatively you can make it into executable
a. from IDE
Menu, Compile, Destination (set to Disk)
b. from dos prompt
> tpc hello.pas > dir hello.exe hello.exe
Take a look at the executable, how small it is, just about 2k in size.
What's next? May be you can try to compile the Mario clone.
No comments:
Post a Comment