User Tools

Site Tools


tutorials:pascal

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
tutorials:pascal [2021/11/03 02:00]
papa created
tutorials:pascal [2024/06/20 05:10] (current)
papa [Hello, World!]
Line 1: Line 1:
-====== Using TOPS-20 PASCAL ======+====== The Pascal Compiler ======
  
-The TOPS-20 PASCAL compiler can be invoked with either the standard @COMPILE command or with @PASCAL. The standard extension for Pascal source files is .PAS. @LOAD@SAVE@RUN@EXECUTE can be used as normal (see [[tutorials:compilers|TOPS-20 Compilers Tutorial]]).+The TWENEX.ORG Pascal compiler was originally developed at the 
 +University of Hamburg as "DECSystem-10 Pascal". The compiler was 
 +later modified and distributed by Rutgers University with fixes 
 +and updates contributed by CMUStanfordUSCSandia National 
 +Laboratories and other sites.
  
-===== References =====+The compiler can be invoked either with the [[tutorials:compilers|standard compile/load/execute commands]] or directly with the EXEC command ''PASCAL''. The standard extension for Pascal source files is ''.PAS''.
  
-  * //[[http://bitsavers.org/pdf/dec/pdp10/TOPS20/pascal/AA-L314A-TM_TOPS-20_PASCAL_Primer_Sep83.pdf|TOPS-20 PASCAL Primer]]//Digital Equipment Corporation, September 1983. +===== HelloWorld! =====
-  * //[[http://bitsavers.org/pdf/dec/pdp10/TOPS20/pascal/AA-L315A-TM_PASCAL_Language_Manual_Ver_1_Sep83.pdf|TOPS-20 PASCAL Language Manual]]//, Digital Equipment Corporation, September 1983.+
  
 +To create and run a //Hello, World!// program in Pascal:
 +
 +<code>
 +[KANKAN] PUBLIC:<~>@ create hello.pas
 +</code>
 +
 +Your default text editor will start. Enter and save the following:
 +
 +<code>
 +(* Hello program in Pascal *)
 +
 +program Hello (Output);
 +begin
 + writeln ('Hello, World!');
 +end.
 +</code>
 +
 +Return to EXEC then compile and run the program:
 +
 +<code>
 +[KANKAN] PUBLIC:<~>@ execute hello
 +PASCAL: HELLO
 +LINK: Loading
 +[LNKXCT HELLO execution]
 +OUTPUT     : 
 +Hello, World!
 +[KANKAN] PUBLIC:<~>
 +</code>
 +
 +  * Syntax of the EXECUTE command is ''EXECUTE //filename//[.//extension//]''. The file extension is optional if you used the standard source file extension (''.PAS'') and there are no other program source files with the same name in your default directory.
 +  * At the ''OUTPUT     :'' prompt, press ''Enter'' to direct output to your terminal.
 +
 +===== Additional Information =====
 +
 +Additional information on the Pascal compiler can be found in ''HELP PASCAL''. (The help file mentions a second Pascal compiler, PASSGO, which is not available on TWENEX.ORG.) Additional documentation is in the following files in directory ''NEO:<DOCUMENTATION>'' (''DOC:''):
 +  * PASCAL.DOC
 +  * PASCAL.HACKER
 +  * PASCAL.INCOMPATIBILITIES-DOC
 +  * PASCAL.MEM
 +  * PASCAL.UPDATE
 +  * PASCAL.USER
 +
 +The following is a reference on the ISO Pascal language standard:
 +
 +  * K. Jensen and N. Wirth, //[[http://pascal.hansotten.com/uploads/books/Pascal_User_Manual_and_Report_Fourth_Edition.pdf|Pascal User Manual and Report, 4th ed.]]// New York: Springer-Verlag, 1991. [Accessed: 2024/6/20]
tutorials/pascal.1635904820.txt.gz · Last modified: 2021/11/03 02:00 by papa