User Tools

Site Tools


tutorials:pascal

Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
tutorials:pascal [2024/06/11 05:43]
papa
tutorials:pascal [2024/06/20 05:10] (current)
papa [Hello, World!]
Line 1: Line 1:
-====== Pascal ======+====== The Pascal Compiler ======
  
-The TWENEX.ORG Pascal compiler was developed by LOTS based on the DECUS PASCAL compiler from Hamburg University.+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 CMU, Stanford, USC, Sandia National 
 +Laboratories and other sites.
  
-The compiler can be invoked either with the [[tutorials:compilers|standard compile/load/execute commands]] or directly with ''@PASCAL''. The standard extension for Pascal source files is ''.PAS''.+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''.
  
-Additional information on the LOTS Pascal compiler can be found in ''@HELP PASCAL''.+===== Hello, World! =====
  
-(The following reference documents are for the DEC TOPS-20 PASCAL compilerwhich is not installed on TWENEX.ORG, not the LOTS compiler. Although the two compilers differ in some respects, the TOPS-20 compiler documents may provide some useful guidance.)+To create and run a //HelloWorld!// program in Pascal:
  
-===== References =====+<code> 
 +[KANKAN] PUBLIC:<~>@ create hello.pas 
 +</code>
  
-  * //[[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. +Your default text editor will startEnter and save the following:
-  * //[[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.+
  
 +<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.1718084615.txt.gz · Last modified: 2024/06/11 05:43 by papa