JRT Pascal User's Guide version 3.0 NOT FOR SALE -11- 2. Operating JRT Pascal JRT Pascal is a fully CP/M compatible language system. The distribution disk does not contain a copy of the operating system due to copyright restrictions. It is recommended that the distribution disk be backed up immediately and not be used as the main running disk. 2.1 Writing Pascal programs Pascal programs can be developed using any standard editor program. The ASCII character set is used throughout JRT Pascal. The program file must have a CP/M filetype of '.PAS'. The output modules produced by the compiler, linker and assembler are given a filetype of '.INT'. When the compiler is processing, it creates temporary storage files with a filetype of '.$$$'. These are normally deleted, but if processing should be interrupted, they may remain on the disk, but will be deleted during the next operation of the compiler. 2.1.1 Identifiers Identifiers are the names assigned to variables, procedures, etc. They may be up to 64 characters long. All characters are significant. They are internally converted to upper case by the compiler. Identifiers must begin with an alphabetic character. Following characters may be alpha, numeric, the underline character and the dollar sign. Spaces are not allowed. x1 total_value DISTANCE ADDRESS compute_and_print_average INITIALIZE_PROC MTD_sales compute_and_print_totals percent_markup arc_cotangent Using meaningful data and procedure names greatly improves the readability of programs and serves as self-documentation. Copy compliments of Merle Schnick SECTION 2: Operating JRT Pascal JRT Pascal User's Guide version 3.0 NOT FOR SALE -12- 2.1.2 Numbers Integers or whole numbers in Pascal occupy two bytes of storage and range from -32768 to +32767. In both the Pascal program and in input/output, they can be entered in decimal or hexadecimal format. Hex format integers have an 'H' suffix character. If the first hex digit is A,B,C,D,E, or F then it must be preceded by a zero digit. 3AH 0EADH 12FH 0cf00h -0ffffh +50h Real numbers in JRT Pascal provide 14 digits of precision and floating point capability. The exponent can range from -64 to +63. The numbers are stored in an 8 byte binary-coded-decimal (BCD) format which eliminates errors in converting between internal and printable formats. 3.14159 0.000098 250000.000321 0.442e+35 2.0E-60 -15.011e+03 Real numbers must include the decimal point. (NOTE: This version of Pascal also requires that at least one digit exists to the RIGHT of the decimal, even if only a zero. i.e., the real number 3. will give a real number format error, where 3.0 will not. Also note that .1 is not legal, but 0.1 is). The exponent field is optional, but when used MUST be in a FIXED FORMAT: character 'e', sign, 2 digits. The sign, even if the value is positive, must be used. (NOTE: Forgetting to include the '+' sign in the exponent field of this version of Pascal does NOT produce a compile-time error, but the results are not predictable. i.e., 1.456e07 vs. 1.456e+07 input). 2.1.3 Comments Comments in Pascal can be inserted anywhere in the program. They can be enclosed by either braces { } or by the character pairs (* *). { comment sample } (* comment sample # 2 *) Copy compliments of Merle Schnick SECTION 2: Operating JRT Pascal JRT Pascal User's Guide version 3.0 NOT FOR SALE -13- 2.2 Compiling Pascal programs JRT Pascal is a one-step compiler; no assembly or link is ever required. The assembler and linker provided are for advanced programming with external procedures. To compile a program, enter: JRTPAS3 filename <$ options> Examples: JRTPAS3 TESTPGM JRTPAS3 STATISTC $E JRTPAS3 INVENTRY $ELP C:JRTPAS3 B:PROJECT1 $E JRTPAS3 D:PLOT $E The filetype of the program must be '.PAS'. The filename may be different from the program name. The compiler option switches are: E - error stop, interrupt processing on detection of an error, issue message to console, ask user whether or not to continue compiling. L - prepare program for line trace, identical to inserting %LTRACE directive at start of program. P - prepare program for procedure trace, identical to inserting %PTRACE directive at start of program. Tx - control the output listing, x may be: A..P - write listing to '.LST' file on disk x X - write listing to console device Y - write listing to list device Z - suppress the output listing If errors are detected, verbal error messages will be displayed at the console imbedded in the source listing. Copy compliments of Merle Schnick SECTION 2: Operating JRT Pascal JRT Pascal User's Guide version 3.0 NOT FOR SALE -14- The following files are required by the compiler: JRTPAS3.COM PASCAL.LIB PASCAL0.INT PASCAL1.INT PASCAL2.INT PASCAL3.INT PASCAL4.INT The compiler does not need to be located on the A: disk drive. The main compiler module JRTPAS3.COM and its external procedures can be placed on any disk drive. Initially, the compiler assumes a two disk system. The CUSTOMIZ program should be used to update the compiler's and EXEC's disk search lists. (See section 9). 2.3 Executing Pascal programs A program which has compiled with no errors can be executed by typing and entering: EXEC filename <$ options> Examples: B:EXEC D:PLOT EXEC TESTPGM $A EXEC B:PROJECT1 The file PASCAL.LIB must be present on one of the disks. The run-time option switches are: A - generate an Activan interrupt before program before program begins execution (refer to appendix for description of Activan, p.117). L - activate the line trace (program must have been compiled with $L option or the $LTRACE directive). Copy compliments of Merle Schnick SECTION 2: Operating JRT Pascal JRT Pascal User's Guide version 3.0 NOT FOR SALE -15- N - generates and Exec interrupt before the program begins execution, used for trace control (refer to section on debugging). P - activate the procedure trace (program must have been compiled with the $P option or %PTRACE direc- tive). While the program is running , keying Control-a or control-n will cause an Activan or Exec interrupt. At that time, certain system parameters can be modified. When in interrupt mode, keying a space character will cause a list of available commands to be displayed. Keying a control-p in interrupt mode causes most system displays to be echoed to the system printer. If any error or warning conditions occur during the running of the program, a verbal error message is displayed at the console. If the error is severe and the program must terminate, a formatted display of critical system data is provided. This display is described in the section on debugging. Copy compliments of Merle Schnick SECTION 2: Operating JRT Pascal  system data is provided. This display is described in the section on debugging.