home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / pascal / compiler / surpas / surpas.doc < prev    next >
Text File  |  1987-10-20  |  46KB  |  1,243 lines

  1. .pl 66
  2. .op
  3. .mt 0
  4. .mb 0
  5. .po 5
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.                              S U R P A S
  24.  
  25.                   Pascal Program Development System
  26.  
  27.  
  28.                              Version 1.0
  29.  
  30.  
  31.  
  32.  
  33.  
  34.                    O P E R A T I N G   M A N U A L
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.                           Copyright (C) 1987
  63.  
  64.                             Tixaku Pty Ltd
  65.                              P.O. Box 373
  66.                             Wentworthville
  67.                               NSW   2145
  68.                               AUSTRALIA
  69.  
  70. .pa
  71.  
  72.  
  73.                               COPYRIGHT
  74.  
  75.  
  76. Copyright (C) 1987,  1988 by Tixaku Pty Ltd.  All rights reserved.  No 
  77. part  of  this  publication may be  copied,  duplicated  or  otherwise 
  78. distributed,  in any form or by any means,  without the prior  written 
  79. permission of Tixaku Pty Ltd,  P.O. Box 373, Wentworthville, NSW 2145, 
  80. AUSTRALIA.
  81.      
  82. This  package is NOT Public Domain  nor is it FREEWARE,   although its 
  83. distribution is similar to that of "freeware".
  84.  
  85. The   basic   difference between the license for  SURPAS and  that  of 
  86. software  that  is freeware is that the use of SURPAS  beyond  a  free 
  87. trial  period,  is  subject to a low  mandatory usage royalty  payment 
  88. instead  of a voluntary contribution.  Unlike most commercial software 
  89. vendors,  we  believe that you are entitled to a test drive  with  our 
  90. software.  On the other hand,   like many commercial software vendors, 
  91. we feel that if you continue using our software you  should pay us for 
  92. the   privilege.   The  price you  pay should still be  fair,  but  it 
  93. should not be free.
  94.  
  95. Use  of  SURPAS  (or SPAS87)  beyond ten days of  first  use   of  the 
  96. program,  the  "free  trial period",  is subject to a mandatory  usage 
  97. royalty  payment  of $20.00 (twenty dollars)  per   computer   console 
  98. (CRT) on which it may be used simultaneously.
  99.  
  100. This usage royalty  payment must be forwarded directly to  Tixaku Pty. 
  101. Ltd.  at the  address indicated  at the end of this document. The free 
  102. trial period is intended to allow you to try the program before paying 
  103. for it.  If at the end of the free trial period, you decide you do not 
  104. want to pay the usage royalty, this may be done provided all copies of 
  105. the  program which are or will be  in your possession are never   used 
  106. by you again.  Even in this case  they may be further distributed.
  107.  
  108. Obviously, even though payment is legally mandatory, we are relying on
  109. your honesty, because in most cases,  we do not have  much capability 
  110. to enforce it. Remember that your payment will help us to afford to 
  111. develop other fine programs that you may also be interested in using.
  112.  
  113. The program SURPAS and its documentation is copyrighted by Tixaku Pty. 
  114. Ltd.  We give  restricted permission to make unlimited copies for your 
  115. personal  use.  We  also give restricted permission to make  unlimited 
  116. number  of  copies of the entire package for distribution  to  others. 
  117. This  includes  making the package available  for others  to  download 
  118. from non-commercial electronic bulletin boards.
  119.  
  120. Distributed copies of this  package  must not be modified  in any way,  
  121. except  for  dividing it up into  several smaller files that  must  be 
  122. made available at the same time,   and all copies must contain all the 
  123. files  included in the list below.
  124.  
  125. No charge  whatsoever,  except for a nominal  copying fee and the cost 
  126. of the media  (diskette etc.),   may be demanded or  received for such 
  127. distribution.
  128.  
  129.  
  130. .pa
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.                               DISCLAIMER
  139.  
  140. Tixaku Pty Ltd makes no representations or warranties with respect  to 
  141. the  contents hereof and specifically disclaims any implied warranties 
  142. of  merchantability or fitness for any particular  purpose.   Further, 
  143. Tixaku Pty Ltd  reserves the right to revise this publication  without 
  144. obligation of Tixaku Pty Ltd notify any person of such revision.
  145.  
  146.  
  147.  
  148.  
  149.  
  150.                               TRADEMARKS
  151.  
  152. SURPAS, SURPAS Pascal, SURPAS is trademark of Tixaku.
  153. MS-DOS is a trademark of Microsoft Inc.
  154. .pa
  155. .pn
  156. SURPAS Pascal Operating Manual                       Table of contents
  157.  
  158.  
  159.                           TABLE OF CONTENTS
  160.  
  161.  
  162. 0   Introduction
  163.  
  164.     0.1 System requirements
  165.     0.2 The distribution package
  166.     0.3 Notations used in this manual
  167.  
  168. 1   Running SURPAS
  169.  
  170.     1.1 Invoking SURPAS
  171.     1.2 Command lines
  172.     1.3 The HELP command                                    (
  173.  
  174. 2   Loading, saving and naming source texts
  175.  
  176.     2.1 The LOAD command
  177.     2.2 The SAVE command
  178.     2.3 The NAME command
  179.  
  180. 3  The editor
  181.  
  182.    3.1 Cursor movement commands
  183.    3.2 Mode selection commands
  184.    3.3 Editing commands
  185.    3.4 Block commands
  186.    3.5 Search/replace commands
  187.    3.6 The ADJUST mode
  188.    3.7 Other editor commands
  189.    3.8 Editor error messages
  190.  
  191. 4  The compiler
  192.  
  193.    4.1 The COMPILE command
  194.    4.2 The RUN command
  195.    4.3 The PROGRAM command
  196.    4.4 The OBJECT command
  197.    4.5 The FIND command
  198.    4.6 The WHERE command
  199.    4.7 Error handling
  200.  
  201. 5  Further commands
  202.  
  203.    5.2 The USE command
  204.    5.3 The MEMORY command
  205.    5.4 The ZAP command
  206.    5.5 The QUIT command
  207.  
  208. .pa
  209. Section 0                                                 Introduction
  210.  
  211.  
  212.  
  213. SURPAS  is a program development package based upon the  block  struc 
  214. tured  programming language Pascal.  SURPAS supports the 8087 floating 
  215. point co-processor.
  216.  
  217. SURPAS includes all facilities required to create,  edit, compile, run 
  218. and  debug programs written in Pascal.  The system consists of  a  run 
  219. time package,  an on-screen editor,  and a Pascal compiler,  and it is 
  220. fully contained in a single program occupying only 32K bytes.
  221.  
  222. SURPAS  Pascal  closely follows the definition of Standard  Pascal  as 
  223. contained in the "User Manual and Report" by K.  Jensen and N.  Wirth.  
  224. In  addition  SURPAS Pascal offers some extensions to  furthermore  in 
  225. crease the versatility of the language.
  226.  
  227. This  manual describes how to operate the SURPAS package.   In  progra 
  228. mming  matters  you  are referred to the  "SURPAS  Pascal  Programming 
  229. Manual".
  230.  
  231. .pa
  232. Section 0                                                 Introduction
  233.  
  234.  
  235. 0.1 System requirements
  236.  
  237. To  use  SURPAS the following requirements must be fulfilled  by  your 
  238. computer system:
  239.  
  240.         .   8086 or 8088 microprocessor.
  241.         .   MS-DOS operating system.
  242.         .   At least one disk drive.
  243.         .   At least 64K bytes of RAM available to programs.
  244.  
  245. Note  that  SURPAS  will not run on systems with an 8080  or  an  8085 
  246. microprocessor.
  247.  
  248.  
  249. 0.2 The distribution package
  250.  
  251. The  distribution  package contains the following  files: 
  252.  
  253. README.DOC     A  text  file  which  describes  the  current   version               
  254.                of  the SURPAS.  Before using SURPAS please display and 
  255.                read  this file,  for instance using a  'TYPE'  command 
  256.                from the operating system.
  257.  
  258. SURPAS.COM     This  file  contains the SURPAS  system  itself,   i.e. 
  259. SURPAS.COM     the runtime package,   the editor,  and the Pascal com
  260.                piler.
  261.  
  262. SURPAS.ERM     The error messages file.  This fi!e contains a list  of 
  263.                error  messages used by the compiler for reporting com
  264.                pilation errors.
  265.  
  266. SURPAS.HLP     The help texts file.  This file contains the help texts 
  267.                displayed  by  the  HELP command and by the  ^J  editor 
  268.                command.
  269.  
  270. CPAS87.COM     The 8087 version of SURPAS.  This version uses the 8087 
  271.                NDP (numeric coprocessor)  for  floating point calcula
  272.                tions, but in a!l other aspects it is equivalent to the 
  273.                standard version.   If your system is equipped with  an 
  274.                8087  co-processor,  you will probably want to use this 
  275.                version instead of the standard version.
  276.  
  277. INSTALL.COM    The SURPAS install program.   If you have got an  unin
  278.                stalled  version of SURPAS,  use this program to confi
  279.                gure  the  package  for use on  your  specific  system. 
  280.                INSTALL  may  also  be used to  modify  a  preinstalled 
  281.                version  to suit your  individual  needs.  The  INSTALL 
  282.                program is fully self-explanatory.
  283.  
  284. INSTALL.TRM    Install   program  data  files.   These  files  contain 
  285. INSTALL.DAT    configuration  data  for up to  50  different  computer            
  286.                systems and terminals.
  287.  
  288.  
  289. .pa
  290. Section 0                                                 Introduction
  291.  
  292.  
  293.  
  294. The distribution package may furthermore contain various demonstration 
  295. programs as source texts (i.e.  as '.PAS' files).
  296.  
  297.  
  298. .3 Notations used in this manual
  299.  
  300. Whenever  the  term "filename" is used it refers to a disk file  name. 
  301. The general format of a disk file name is:
  302.  
  303.                          <drive>:<name>.<ext>
  304.  
  305. where <drive> is the disk drive identifier (A-O), <name> is any combi
  306. nation of up to 8 letters or digits,  and <ext> is any combination  of 
  307. up to three letters or digits.  The <name> field must always be speci
  308. fied,  whereas the <drive> field and the <type> field are optional. If 
  309. the  <drive>  field  (and  the colon following  it)  is  omitted,  the 
  310. currently logged drive is assumed.  If the <ext> fie]d (and the period 
  311. preceding it) is omitted,  a default extension is assumed depending on 
  312. the context.
  313.  
  314.  
  315. Throughout the manual,  hex numbers (numbers to base 16) are  preceded 
  316. by a '$' character, e.g.  $16EO.
  317.  
  318. .pa
  319. Section   1                                             Running SURPAS
  320.  
  321.  
  322.  
  323.                               Section 1
  324.  
  325.                             Running SURPAS
  326.  
  327.  
  328.  
  329. 1.1 Invoking SURPAS
  330.  
  331. To invoke SURPAS enter the command line:
  332.  
  333.                                 SURPAS
  334.  
  335. If  the SURPAS.COM file is not located on the currently logged  drive, 
  336. first  log in this drive (for instance by entering 'B:',  if SURPAS is 
  337. on the disk in drive B). Once loaded the system prompts:
  338.  
  339.         SURPAS V1.0 (MS-DOS version, 8086 CPU)
  340.                 Copyright (C) 1987 Tixaku Pty Ltd
  341.                 Include error messages (Y/N)?
  342.  
  343.  
  344. Now type 'Y' to load the error message file (SURPAS.ERM), or any other 
  345. character to omit it. If you type 'Y' at this point, the compiler will 
  346. display an error message on locating an error.   Other wise,  only the 
  347. error  number is displayed,  and you will yourself have to look up the 
  348. error in the "SURPAS Pascal Programming Manual".
  349.  
  350. Following a cold-start (as described above), SURPAS may be warmstarted 
  351. from  MS-DOS using the command line:
  352.  
  353.                                SURPAS *
  354.  
  355. This  of  course  requires  that  no  vital  memory  areas  have  been 
  356. overwritten by other programs run in the meantime.
  357.  
  358.  
  359. 1.2 Command lines
  360.  
  361. SURPAS prompts by printing two angle brackets ('>>').   Each time this 
  362. prompt appears,  SURPAS is ready to accept and process a command line. 
  363. When you enter a command line, you may use the following editing keys:
  364.  
  365. BACKSPACE     Backspaces one character. On most keyboards this code is 
  366.               generated by pressing the key marked BS,  BACK,  or BACK 
  367.               SPACE, or by pressing CTRL/H.
  368.  
  369. DEL           Same  as  BACKSPACE described above.  On most  keyboards 
  370.               this code is generated by pressing the key marked DEL or 
  371.               RUBOUT.
  372.  
  373. CTRL/X        Backspaces to the beginning of the line.
  374.  
  375. RETURN        Terminates the input line.  On most keyboards this  code 
  376.               is generated by pressing the key marked RETURN or ENTER.
  377.  
  378.  
  379. .pa
  380. Section 1                                               Running SURPAS
  381.  
  382.  
  383. Below  is  shown  a list of the commands recognized  by  SURPAS  (each 
  384. command is described in full in the subsequent sections). All commands 
  385. may be abbreviated to their first letter.
  386.  
  387.         HELP      Display help texts.
  388.         LOAD      Load a source text.
  389.         SAVE      Save the source text.
  390.         NAME      Set current file n#me.
  391.         EDIT      Invoke the on-screen editor.
  392.         COMPILE   Compile the source text.
  393.         RUN       Run the current program.
  394.         PROGRAM   Compile into a program file.
  395.         OBJECT    Compile into an object file.
  396.         FIND      Find a run time error.
  397.         WHERE     Find error location in an include file.
  398.         DIR       Display disk directory.
  399.         USE       Change current logged drive and user.
  400.         MEMORY    Display size of text and free memory.
  401.         ZAP       Delete the source text.
  402.         QUIT      Return to the operating system.
  403.  
  404.  
  405. 1.3 The HELP command
  406.  
  407. The  HELP command is used to display help texts.  Use it whenever  you 
  408. are  in doubt as to what to type on a command line.   The command line 
  409. format of the HELP command is:
  410.  
  411.                             HELP <command>
  412.  
  413. Where  <command>  is  one of the commands shown above  (or  the  first 
  414. letter of one of them).   If <command> is not specified, HELP displays 
  415. a command summary.   Otherwise,  it displays a complete description of 
  416. that particular command.
  417.  
  418. The HELP command only works if the SURPAS.HLP text file is present  on 
  419. the  disk  from which SURPAS was executed.   If this is not the  case, 
  420. HELP displays:
  421.  
  422.                       No SURPAS.HLP file on disk
  423.  
  424. If you try to obtain help on an non-existing command, HELP displays:
  425.  
  426.                           No such help text
  427.  
  428. .pa
  429. Section 2                          Loading, saving and naming files
  430.  
  431.  
  432.                               Section 2
  433.  
  434.                    Loading, saving and naming files
  435.  
  436.  
  437.  
  438. 2.1 The LOAD command
  439.  
  440. The LOAD command is used to load a source text into the memory buffer. 
  441. The command line format is:
  442.  
  443.                            LOAD <filename>
  444.  
  445. The file type defaults to '.PAS'.  When a file is loaded,  it is appen 
  446. ded  to  the end of the source text already  held  within  th,  memory 
  447. buffer. On loading the file, SURPAS displays:
  448.  
  449.                         Loading d:filename.ext
  450.  
  451. If the file specified does not exist, SURPAS displays:
  452.  
  453.                              No such file
  454.  
  455. If  loading  the entire file would overflow the memory  buffer  SURPAS 
  456. displays:
  457.  
  458.                              File too big
  459.  
  460. For  both  error conditions the text already within the memory  buffer 
  461. remains unchanged.
  462.  
  463. When  a file is successfully loaded,  the current file name is se|  to 
  464. the  name of that file.  The current file name is used  by  th,  SAVE, 
  465. PROGRAM,  and  OBJECT  commands if a file name is  not  explici.   tly 
  466. stated.
  467.  
  468.  
  469. 2.2 The SAVE command
  470.  
  471. The  SAVE  command  is used to save the text held  within  the  memory 
  472. buffer in a disk file. The command line format is:
  473.  
  474.                            SAVE <filename>
  475.  
  476. The  file  extension  defaults to '.PAS'.   If <filename>  is  omitted 
  477. entirely,  the current file name is used.  On saving the file,  SURPAS 
  478. displays:
  479.  
  480.                         Saving d:filename.ext
  481.  
  482. If a file of the same name and extension exists on the disk  specified 
  483. its extension is changed to '.BAK' before the new file is created (the 
  484. backup file facility may be disabled using the INSTALL program so that 
  485. duplicate  files are simply deleted).  If the disk directory is  full, 
  486. SURPAS displays:
  487.  
  488.                           Directory is full
  489.  
  490.  
  491. .pa
  492. Section 2                             Loading, saving and naming files
  493.  
  494.  
  495. If  there is not enough room on the disk to create a new file,  SURPAS 
  496. displays:
  497.  
  498.                              Disk is full
  499.  
  500. If one of the above errors are reported,  insert a new disk, log it in 
  501. using the USE command, and try SAVE again.
  502.  
  503.  
  504. 2.3 The NAME command
  505.  
  506. The NAME command is used to display and optionally change the  current 
  507. file name. The command line format is:
  508.  
  509.                            NAME <filename>
  510.  
  511. If  <filename> is omitted entirely,  the current file name is not chan 
  512. ged,  but  only displayed.  Otherwise the current file name is set  to 
  513. <filename>.   The default file extension is '.PAS'.   The NAME command 
  514. ends by displaying:
  515.  
  516.                     Current file is d:filename.ext
  517.  
  518.  
  519.  
  520. .pa
  521. Section 3                                                  The editor
  522.  
  523.                               Section 3
  524.  
  525.                               The editor
  526.  
  527.  
  528. The SURPAS on-screen editor is used to enter and edit sourc texts. The 
  529. maximum  size  of  a source text is up to 60K bytes depending  on  the 
  530. amount  of  memory available (usually enough memory  is  available  to 
  531. allow  source  texts of all 60K bytes).  If a program grows to be  too 
  532. large for the editor to handle it in one piece, you must break it into 
  533. one or more seperate text and use include files.
  534.  
  535. The editor is invoked using the command:
  536.  
  537.                                  EDIT
  538.  
  539. The  on-screen  editor  is specifically designed for  use  with  video 
  540. displays.  On entering the editor,  the start of the text held  within 
  541. the  memory buffer is displayed on the screen.  If the tex is too long 
  542. for the screen,  which it usually is,  then only th' first portion  is 
  543. displayed.  This  is the concept of a "window" The whole text is there 
  544. and  accessible by editor commands,  but only a portion of it  can  be 
  545. seen through the "window" of the screen. When any editor command would 
  546. take  you  to  a position it  the text which  is  not  displayed,  the 
  547. "window" is moved to show that portion of the text.
  548.  
  549. The  cursor  marks  a  position in the text and can be  moved  to  and 
  550. position occupied by text.  The window shows the portion of text  near 
  551. the cursor. To see another portion of the text, simply move the cursor.
  552.  
  553. Lines  of a text may be as long as you wish,  but the editor is   only 
  554. able to display the first part of a line.   If a line is  longer  than 
  555. the screen width, a '+' is displayed in the last  position of the line 
  556. on the screen.
  557.  
  558. When  you use the SURPAS editor,  you will notice that it has a  great 
  559. deal of "intelligence" built in.  For instance, it updates the display 
  560. only  when  it has nothing else to do,  i.e.  only when  you  are  not 
  561. entering commands or characters.   Furthermore, when  the editor is in 
  562. the  process of updating the display,  it still scans the keyboard for 
  563. your input.   If the editor cannot keep up  with your input,  i.e.  if 
  564. you  type  characters faster than the editor  can  process  them,  the 
  565. characters  are stored in a "type-ahead" buffer,  and once you  relax, 
  566. the  buffer is emptied one character at a time.   Up to 64  characters 
  567. can be waiting in the "type-ahead" buffer.
  568.  
  569. To enter characters into the text you simply type them.  Depending  on 
  570. the current mode of operation,  new characters will either be inserted 
  571. (pushing  the remainder of the line to the right),  or  they will rep 
  572. lace old charac#ers.
  573.  
  574.  
  575. .pa
  576. Section 3                                                   The editor
  577.  
  578.  
  579. 3.1 Cursor movement commands
  580.  
  581. ^S        Move cursor left one character.
  582.  
  583. ^D        Move cursor right one character.
  584.  
  585. ^A        Move cursor left one word.
  586.  
  587. ^F        Move cursor right one word.
  588.  
  589. ^QS       Move cursor to beginning of line.
  590.  
  591. ^QD       Move cursor to end of line.
  592.  
  593. ^E        Move cursor up one line.
  594.  
  595. ^X        Move cursor down one line.
  596.  
  597. ^QE       Move cursor to top of screen.
  598.  
  599. ^QX       Move cursor to bottom of screen.
  600.  
  601. ^R        Move cursor up one page.
  602.  
  603. ^C        Move cursor down one page.
  604.  
  605. ^QR       Move cursor to start of text.
  606.  
  607. ^QC       Move cursor to end of text.
  608.  
  609.  
  610. 3.2  Mode selection commands
  611.  
  612. ^V        INSERT on/off. When INSERT is on and a character is typed at 
  613.           the  keyboard,  the  remainder of the line is pushed to  the 
  614.           right  to make room for the character.  When  INSERT is  off 
  615.           and  a character is typed at the keyboard the new  character 
  616.           simply replaces the character under  the cursor.
  617.  
  618. ^Z        AUTO (automatic tabulator) on/off.  When the automatic tabu 
  619.           lator is on,  every new line will automatically start at the 
  620.           same indentation as the line above.
  621.  
  622. ^B        TABS  on/off.  When TABS is on,  the TAB (^I)  command  will 
  623.           insert ASCII TAB characters into the text. Otherwise the TAB 
  624.           command will insert an appropriate number of  blanks to move 
  625.           the cursor to the next TAB stop. Usin:  ASCII TAB characters 
  626.           often saves memory,  but it prevents  use of the ADJUST mode 
  627.           to adjust the indentation of  blocks of lines.
  628.  
  629. ^W        ADJUST  mode on/off.  The ADJUST mode is used to adjust  the 
  630.           indentation  of  blocks of lines.  For further  details  see 
  631.           section 3.6.
  632.  
  633. .pa
  634. Section 3                                                  The editor
  635.  
  636. RETURN    Newline (same as ^M). This command depends on whether insert 
  637.           is  on,  a  CR/LF (carriage-return  line-feed)  sequence  is 
  638.           inserted into the text, which causes a blank line to appear, 
  639.           or  which breaks the current line into two if the cursor  is 
  640.           not at the end of the line. If AUTO is also on, the new line 
  641.           will automatically start at the same indentation as the line 
  642.           above.  If INSERT is off,  the cursor is simply moved to the 
  643.           beginning of the next line.
  644.  
  645. ^N        Insert  carriage  return.  Inserts a CR/LF  (carriage-return 
  646.           line-feed) sequence at the cursor, which causes a blank line 
  647.           to appear,  or which breaks the current line into two if the 
  648.           cursor  is not at the end of the line.  The cursor does  not 
  649.           move.
  650.  
  651. ^TAB      Tabulate (same as ^I). If TABS is on, an ASCII TAB character 
  652.           is inserted into the text,  which causes the cursor to  move 
  653.           to  the  next  multiple of eight columns.  If TABS  is  off, 
  654.           enough  blanks are inserted to move the cursor to  the  next 
  655.           multiple  of eight columns.  Note that TABS should be off if 
  656.           you  intend using the ADJUST mode to adjust the  indentation 
  657.           of your program lines later on.
  658.  
  659.  DEL      Delete  character  left.  Deletes the character  before  the 
  660.           cursor, and moves the cursor left one column.
  661.  
  662.  ^G       Delete  character  right.  Deletes one character  under  the 
  663.           cursor. The cursor does not move.
  664.  
  665.  ^T       Delete  word.  Deletes  the word that starts at the  current 
  666.           character position (a word is any group of non-blank charac
  667.           ters). The cursor does not move.
  668.  
  669. ^Y        Delete a line.  Deletes the entire line holding the  cursor, 
  670.           and  scrolls  the  remainder of the text up  one  line.  The 
  671.           cursor moves to column one of the next line.
  672.  
  673. ^Q DEL    Delete to beginning of line.  Deletes all characters  before 
  674.           the cursor on the current line.
  675.  
  676. ^QY       Delete  to  end of line.  Deletes all characters  after  the 
  677.           cusor on the current line.
  678.  
  679.  
  680. 3.4 Block commands
  681.  
  682. The block commands operate on blocks of text.  A block is delimited by 
  683. a start block marker and an end block marker,  and these are shown  on 
  684. the  screen  as '>' and '<' in reverse.  Before a  block  manipulation 
  685. command,  you  must  first set a start block marker and an  end  block 
  686. marker,  and  furthermore  you must make sure that the cursor  is  not 
  687. within the block.
  688.  
  689. ^KB       Set start block marker.  Inserts a start block marker at the 
  690.           current  cursor  position,  and moves the cursor  right  one 
  691.           column.   If  a start block marker is already set  somewhere 
  692.           else, it is removed.
  693.  
  694. .pa
  695. Section 3                                                  The editor
  696.  
  697.  
  698. ^KK       Set  end block marker.  Inserts an end block marker  at  the 
  699.           current  cursor  position,  and moves the cursor  right  one 
  700.           column.  If  an  end block marker is already  set  somewhere  
  701.           else, it is removed.
  702.  
  703. ^KV       Move  block.  Moves  the marked block to the current  cursor 
  704.           position,  i.e. copies it to the current cursor position and 
  705.           removes it at its original position.   The block markers are 
  706.           removed.   This  command will not operate if the  cursor  is 
  707.           within the marked block.
  708.  
  709. ^KC       Copy  block.   Copies the marked block to the current cursor 
  710.           position.  The block markers are not removed.  This  command 
  711.           will not operate if the cursor is within the marked block.
  712.  
  713. ^KY       Delete  block.  Delete the marked block as well as the block 
  714.           markers.  This  command  will not operate if the  cursor  is 
  715.           within the block.
  716.  
  717. ^KP       Print block.  Outputs the marked block to the printer.  This 
  718.           command will not operate if the cursor is within  the block.
  719.  
  720. ^KH       Remove block markers.   Note that when you leave the editor,  
  721.           using the ^KD command,   the block markers are automatically 
  722.           removed.
  723.  
  724.  
  725. 3.5  Search/replace commands
  726.  
  727. The search/replace commands are used to quickly locate and  optionally 
  728. replace  occurrances  of a string in the text.  Note that  search  and 
  729. replace  strings cannot contain CR/LF (carriage-return line-feed)  se
  730. quences, and that the maximum length of such strings is 32 characters.
  731.  
  732. ^QF       Find string.   On entering this command,  the status line is 
  733.           cleared,  and  a 'Find?' prompt appears in its  place.   Now 
  734.           type the string to be found, and end by pressing RETURN. You 
  735.           may use the DEL key to correct errors. Note that TAB charac
  736.           ters are displayed as '^I'.   Once the string is input,  the 
  737.           scanning of the text starts.  If a matching string is found, 
  738.           the cursor is moved to the character position just after the 
  739.           string.  Otherwise the cursor does not move.  The scan  only 
  740.           includes  the text after the cursor.  To include all of  it, 
  741.           type ^QR before ^QF.
  742.  
  743.  
  744.  
  745. .pa
  746. Section 3                                                  The editor
  747.  
  748.  
  749. ^QA       Find  and replace string.  This command is an extended  ver
  750.           sion  of ^QF,  which furthermore allows you to replace   the 
  751.           string(s)  found  with another  string.  The  command   will 
  752.           prompt  you for a find string (the 'Find?' prompt),   a rep
  753.           lace string (the 'Replace with?' prompt), and an option list 
  754.           (the  'Options (G,N)?' prompt).  The 'G' option indicates  a 
  755.           global   search,   and the  'N'  option indicates  that  the 
  756.           string(s) found should be replaced without asking.  On ente
  757.           ring  options,  type the letters with no delimiters in  bet
  758.           ween.  If the 'N' option is not selected, a 'Replace (Y/N)?' 
  759.           prompt will appear each time a matching string is found, and 
  760.           the  cursor  will  move between the text and the  prompt  in 
  761.           short intervals.  Typing 'Y' will replace the string,   whe
  762.           reas  'N'  will  leave it unchanged.  If the 'G'  option  is 
  763.           selected,  the search will not stop at the first occurrance, 
  764.           but  continue  until  the entire text   (after  the  initial 
  765.           cursor positon)  has been scanned,   or RETURN is entered in  
  766.           response to the 'Replace (Y/N)?' prompt.
  767.  
  768. ^L        Continue search.   Repeats the last ^QF or ^QA command  with 
  769.           the same parameters.
  770.  
  771.  
  772. 3.6 The ADJUST mode
  773.  
  774. The  ADJUST mode is designed to make it easy to adjust the indentation 
  775. of  a  line or a whole group of lines.  You enter the ADJUST  mode  by 
  776. pressing ^W.
  777.  
  778. Once you are in the ADJUST mode, each time ^S is typed, the whole line 
  779. moves one position to the left,  and each time ^D is typed,  the whole 
  780. line  moves one position to the right.  Moving the cursor up or  down, 
  781. using  ^E or ^X,  makes the same adjustment to lines above  or  below. 
  782. Note  that once a direction has been chosen (either up or  down),  you 
  783. cannot move backwards in the opposite direction.
  784.  
  785. When  the line (or group of lines) is adjusted to the desired indenta
  786. tion, press ^W to leave the ADJUST mode.
  787.  
  788. Note  that the ADJUST mode will not correctly adjust lines  containing 
  789. ASCII TAB characters.   Therefore,  set TABS off before entering lines 
  790. that may require adjustments later on.
  791.  
  792.  
  793. 3.7 Other editor commands
  794.  
  795. ^J        Help.  Displays  a  summary  of all editor commands  on  the 
  796.           screen.   This command only works if the SURPAS.HLP file  is 
  797.           present on the disk from which SURPAS was started.u
  798.  
  799. ^KD       Terminate  editor.  On entering this command,  the screen is 
  800.           cleared  and you are returned to the command mode (the  '>>' 
  801.           prompt).  If you have been correcting an error in an include 
  802.           file,  it  will  be saved,  and the original file  will   be 
  803.           reloaded. For further details on this, see section  4.7.
  804.  
  805.  
  806. .pa
  807. Section 3                                                   The editor
  808.  
  809.  
  810. ^KX         Exit editor.  Under normal circumstances this command does 
  811.             exactly the same as ^KD. However, if you have been correc
  812.             ting an error in an include file, ^KX will not restore the 
  813.             original file upon exit.
  814.  
  815.  
  816. 3.8 Editor error messages
  817.  
  818. Editor  error messages are displayed on the top line (where the status 
  819. line is normally located). An example:
  820.  
  821.                ERROR: No room to insert. Press <RETURN>
  822.  
  823. To  reset from an error condition and restore the status  line,  press 
  824. RETURN. There are four different error messages:
  825.  
  826. No room to insert
  827.  
  828. This  message is displayed if you try to insert characters when  there 
  829. is no memory left.
  830.  
  831. Block not found
  832.  
  833. This message appears if you invoke a block command when no or only one 
  834. block  marker is set.  It will also be reported if you are within  the 
  835. marked block on invoking the block command. In the latter case, simply 
  836. move the cursor outside the block, and re-enter the command.
  837.  
  838. No SURPAS.HLP file on disk
  839.  
  840. This message is displayed if the ^J (help) command is unable to locate 
  841. the SURPAS.HLP text file.
  842.  
  843. No such help text
  844.  
  845. This  message is displayed if the SURPAS.HLP file does not contain  an 
  846. editor command summary.  Under normal circumstances you will never see 
  847. this message.
  848.  
  849.  
  850.  
  851. .pa
  852. Section 4                                                The compiler
  853.  
  854.  
  855.                               Section 4
  856.  
  857.                              The compiler
  858.  
  859.  
  860.  
  861. The compiler is the heart of the SURPAS Pascal language system.  It is 
  862. capable of translating SURPAS Pascal, as defined in the "SURPAS Pascal 
  863. Programming Manual", into native machine code instructions.
  864.  
  865. When  the  compiler is invoked from a COMPILE or a  RUN  command,  the 
  866. object code is stored directly into memory in succession of the source 
  867. text.  This mode is extremely fast (up to 5000 lines are processed per 
  868. minute),  and once the program is compiled it can be executed immedia
  869. tely.Users  should however note that since the system requires  memory 
  870. for  both  source text and the object .code at the same  time,  it  is 
  871. likely that very large programs cannot be compiled in this mode.
  872.  
  873. The  PROGRAM  and OBJECT commands instruct the compiler to  write  the 
  874. object  code to a disk file.  This mode is of course  somewhat  slower 
  875. than  the above,  but it requires less memory,  and makes possible the 
  876. generation  of  '.COM' files which may be executed directly  from  the 
  877. operating system.
  878.  
  879. When activated from a FIND command, the compiler may be used to locate 
  880. a statement in the source text which corresponds to a specific address 
  881. in the object code,  typically the address of a run-time  error.  This 
  882. mode is invaluable help for the debugging of a program.
  883.  
  884.  
  885. 4.1 The COMPILE command
  886.  
  887. When  the  compiler is invoked from a COMPILE command,  the object  is 
  888. stored  directly into memory in succession of the source  text.   Note 
  889. that whenever you invoke the editor,  the code produced by the COMPILE 
  890. command  is  erased.   The actions performed by  the  COMPILE  command 
  891. depends on the version of SURPAS in use.
  892.  
  893.  
  894. On entry the compiler displays:
  895.  
  896.                               Compiling
  897.  
  898. Following  a successful compilation,  you are informed of the size  of 
  899. the code segment,  the size of the data segment,  and the size of free 
  900. memory (used for the stack segment):
  901.  
  902.                  Code: rrrrrr bytes (aaaa paragraphs) 
  903.                  Data: ssssss bytes (bbbb paragraphs)
  904.                  Free: tttttt bytes (cccc paragraphs)
  905.  
  906. where the numbers in parentheses are the paragraphs sizes (in hex)  of 
  907. each segment. The code segment size includes both the run-time package 
  908. and the actual program code.
  909.  
  910.  
  911. .pa
  912. Section 4                                                The compiler
  913.  
  914.  
  915. 4.2 The RUN command
  916.  
  917. The  RUN  command is used to execute a program.  If no object code  is 
  918. present,  the compiler is invoked to compile the program.   Assuming a 
  919. successful compilation, or if the object code was already present, the 
  920. message:
  921.  
  922.                                Running
  923.  
  924. is  output,  and  control is transferred to  the  program.   When  the 
  925. program ends, it automatically enters the command mode of SURPAS.
  926.  
  927. If  a  run-time  error  occurs,  or if you interrupt  the  program  by 
  928. pressing ^C,  the program will terminate displaying a status  message, 
  929. for instance:
  930.  
  931.            EXECUTION ERROR 04 AT PC=254E Program terminated
  932.  
  933. You  may then use the FIND command to locate the statement that caused 
  934. the error or was interrupted.
  935.  
  936.  
  937. 4.3 The PROGRAM command
  938.  
  939. The PROGRAM command is used to compile the program into a machine code 
  940. program  file  on  a disk:
  941.  
  942.  
  943.       PROGRAM <filename>,<ssegmin>,<ssegmax>,<csegmin>,<dsegmin>
  944.  
  945. where  <filename>  is a disk  file  name,  and  <ssegmin>,  <ssegmax>, 
  946. <csegmin>,  and <dsegmin> are hex addresses (without the preceding '$' 
  947. character).  The default file type is '.COM'. If <filename> is omitted 
  948. entirely,  the current file name is used with the extension changed to 
  949. '.COM'. Any one of the four hex parameters may be omitted, for instance:
  950.  
  951.  
  952.      PROGRAM B:TEST,800         (only <ssegmin>)
  953.      PROGRAM  ,,,CD8,12E4     (only <csegmin> and <dsegmin>)
  954.  
  955. <ssegmin>  and  <ssegmax>  specify the minimum and maximum  sizes  (in 
  956. paragrahps) of the stack segment.   <ssegmin> defaults to 100 hex  (4K 
  957. bytes),  and <ssegmax> defaults to the value of <ssegmin>.   <csegmin> 
  958. and  <dsegmin>  specify the minimum sizes (in paragrahps) of the  code 
  959. and data segments.  They default to the lowest possible  values.  They 
  960. must not be larger than hex FFF (64K bytes), and usually they are only 
  961. specified  for programs that will chain to other programs with  larger 
  962. code and/or data segments.
  963.  
  964. Before compiling the program, SURPAS displays:
  965.  
  966.                      Compiling to d:filename.ext
  967.  
  968. On  compiling  the program,  SURPAS also writes a copy of the  runtime 
  969. package  into the command file.  The run-time package always  occupies 
  970. the first portion of the code segment.
  971.  
  972.  
  973. .pa
  974.  
  975. Section 4                                                 The compiler
  976.  
  977.  
  978. Following  a successful compilation,  you are informed of the size  of 
  979. the code segment,  the size of the data segment,  and the minimum size 
  980. of the stack segment:
  981.  
  982.                  Code: rrrrrr bytes (aaaa paragraphs) 
  983.                  Data: ssssss bytes (bbbb paragraphs) 
  984.                  Free: tttttt bytes (cccc paragraphs)
  985.  
  986. where  the numbers in parentheses are the paragraph sizes (in hex)  of 
  987. each segment.  One paragraph corresponds to 16 bytes. The code segment 
  988. size includes both the run-time package and the actual program code.
  989.  
  990. In  SURPAS the PROGRAM command actually works in two different  modes. 
  991. In  the "compile" mode,  it generates the object code and at the  same 
  992. time writes it to the program file.  This mode only requires room  for 
  993. the source text and the symbol table.  In the "dump" mode on the other 
  994. hand, the PROGRAM command simply dumps an already existing object code 
  995. into  the  program file,  without actually compiling the source  text. 
  996. This mode is extremely fast and only limited by the speed of your disk 
  997. system.
  998.  
  999. The   PROGRAM  command  automatically  selects  the  proper  mode   of 
  1000. operation.  If a COMPILE command is issued before the PROGRAM command, 
  1001. the  PROGRAM  command  realizes that the object  code  already  exists 
  1002. within memory, and thus selects the "dump" mode. On the other hand, if 
  1003. no object code is present within memory prior to the PROGRAM  command, 
  1004. the   "compile"   mode  is  selected.    Since  the  "dump"  mode   is 
  1005. signi#!cantly  faster than the "compile" mode,  especially  for  large 
  1006. programs,  it  is recommended that you always issue a COMPILE  command 
  1007. immediately before a PROGRAM command.
  1008.  
  1009.  
  1010. 4.4 The OBJECT command
  1011.  
  1012. The OBJECT command is used to create object (chain) files, i.e.  files 
  1013. that  do not contain the run-time package but only the actual  program 
  1014. code.   Object files may only be activated through the chain procedure 
  1015. of SURPAS Pascal - they cannot be executed directly from the operating 
  1016. system.  For further details on program chaining,  please refer to the 
  1017. "SURPAS  Pascal  Programming Manual".  The command line format of  the 
  1018. OBJECT command is:
  1019.  
  1020.                           OBJECT <filename>
  1021.  
  1022. where <filename> is a disk file name.  The default file type is '.CHN' 
  1023. (short  for chain).   If <filename> is omitted entirely,  the  current 
  1024. file name is used with its type changed to '.CHN'.
  1025.  
  1026. Since  the  memory allocation state is not changed by a  call  to  the 
  1027. chain  procedure,  you need not specify segment size information  when 
  1028. creating an object file.
  1029.  
  1030. It  is  up  to you,  however,  to specify sufficiently  large  minimum 
  1031. segment  sizes  on  compiling the "root" program  (using  the  PROGRAM 
  1032. command),  as the memory allocation state is established once and  for 
  1033. all  when  the "root" program is executed from the  operating  system. 
  1034. Therefore,  note  the code and data segment paragraph sizes output  at 
  1035. the  end  of  each object file compilation,  and specify  the  largest 
  1036. values when compiling the "root" program.
  1037.  
  1038. .pa
  1039. Section 4                                                 The compiler
  1040.  
  1041.  
  1042. 4.5 The FIND command
  1043.  
  1044. The FIND command is used to locate a statement in the source text that 
  1045. corresponds to an offset address in the object code.  In this mode the 
  1046. compiler generates no object code. The command line format is:
  1047.  
  1048.                             FIND <offset>
  1049.  
  1050. where  <offset> is the offset address of the statement to be  located. 
  1051. The  offset  address must be specified in hex with no   preceding  '$' 
  1052. character.   The  offset  address is always the true  program  counter 
  1053. offset within the code segment.
  1054.  
  1055. If <offset> is omitted, the offset address of the most recent run-time 
  1056. error  is  substituted instead.  Thus,  to locate the  statement  that 
  1057. caused a run time error, simply enter a FIND comman# when the error is 
  1058. reported. On entry the compiler displays:
  1059.  
  1060.                               Searching
  1061.  
  1062. If the offset address is passed during compilation, the compiler stops 
  1063. and displays:
  1064.  
  1065.                Target address found
  1066.                Press <RETURN> to edit or <ESC> to abort
  1067.  
  1068. When you press RETURN the editor is invoked,  and the cursor is placed 
  1069. at  or  just  after the relevant section.  If you press  ESC  you  are 
  1070. returned to the command mode.   If the offset address is out of range, 
  1071. the compiler outputs:
  1072.  
  1073.                        Target address not found
  1074.  
  1075. before returning you to the command mode.
  1076.  
  1077. If  a  run-time  error occurs within an  overlay  subroutine  (a  disk 
  1078. resident  procedure  or function),  the FIND command will  not  always 
  1079. correctly  locate  the  statement  that  caused  the  error.    For  a 
  1080. discussion  of this problem and a method to avoid it,  please refer to 
  1081. section 15.9 of the "SURPAS Pascal Programming Manual".
  1082. 4.6 The WHERE command
  1083.  
  1084. The  WHERE  command  invokes the editor,  and moves the  cursor  to  a 
  1085. specific position in the text. The command line format is:
  1086.  
  1087.                             WHERE <offset>
  1088.  
  1089. where  <offset>  is  a hex number (with no  preceding  '$'  character) 
  1090. specifying the offset address of the spot to be located.  Whenever you 
  1091. leave the editor,  the offset address of the cursor is recorded as the 
  1092. default <offset> value.  Thus,  if you use WHERE with no argument  in
  1093. stead  of EDIT to invoke the editor,  the cursor will be moved to  the 
  1094. spot  you left previously instead of to the beginning of the text.  In 
  1095. addition,  when  the compiler reports an error,  it also  records  the 
  1096. offset  address of the error as the default WHERE argument.   In  this 
  1097. case,  a  WHERE command will invoke the editor and move the cursor  to 
  1098. the spot in error.
  1099.  
  1100. .pa
  1101. Section 4                                                 The compiler
  1102.  
  1103.  
  1104. 4.7 Error handling
  1105.  
  1106. If  an  error is found during a compilation,  the compiler  stops  and 
  1107. displays  an  error number.  If the error message file was  loaded  on 
  1108. running SURPAS, an error message is displayed as well:
  1109.  
  1110.                Error 04: Duplicate identifier
  1111.                Press <RETURN> to edit or <ESC> to abort
  1112.  
  1113. On  pressing RETURN,  the editor is invoked and the cursor is moved to 
  1114. the spot in error.  You may then edit the source text in the same  way 
  1115. as usual.  If you press ESC you are returned to the command mode.
  1116.  
  1117. If  an error is spotted within an include file the situation is a  bit 
  1118. more  complicated.  In this case the compiler displays the name of the 
  1119. file  and the offset address o# the spot in error.  Assuming that  the 
  1120. current  file  name is A:MAIN.PAS and that the include  file  name  is 
  1121. A:FUNCLIB.PAS. The error message might then read:
  1122.  
  1123.       Include file A:FUNCLIB.PAS at CC=07B2
  1124.       Error 25: Unknown or invalid variable identifier 
  1125.       Press <RETURN> to edit or <ESC> to abort
  1126.  
  1127. The offset address (CC) is the number of characters (in hex) read from 
  1128. the  file  before the error occurred.   If you press  RETURN  at  this 
  1129. stage,  SURPAS  will proceed by saving the text currently held  within 
  1130. memory. On doing so, it would in this case display:
  1131.  
  1132.                           Saving A:MAIN.PAS
  1133.  
  1134. since A:MAIN.PAS is the current file name (set through LOAD or  NAME). 
  1135. The file is only saved if it has not been modified since it was loaded 
  1136. or saved the last time. Next thing the include file is loaded. In this 
  1137. case SURPAS would display:
  1138.  
  1139.                         Loading A:FUNCLIB.PAS
  1140.  
  1141. Finally  SURPAS  will  automatically invoke the editor  and  move  the 
  1142. cursor to the spot in error.  You may then correct the error.   If you 
  1143. exit  the  editor  through ^KD,  SURPAS will automatically  save  the 
  1144. include  file  and reload the original file before  returning  to  the 
  1145. command mode. In this case, the display would be:
  1146.  
  1147.                          Saving A:FUNCLIB.PAS
  1148.                          Loading A:MAIN.PAS
  1149. If  you  however exit the editor through ^KX,  the include file  will 
  1150. remain the current file.
  1151.  
  1152. .pa
  1153. Section 5                                             Further commands
  1154.  
  1155.  
  1156.                               Section 5
  1157.  
  1158.                            Further commands
  1159.  
  1160.  
  1161. 5.1 The DIR command
  1162.  
  1163. The  DIR  command  is used to display the directory  of  a  disk.  The 
  1164. command line format is:
  1165.  
  1166.                               DIR <afn>
  1167.  
  1168. where <afn> is an ambiguous file name as the one used in a  MS-DOS DIR 
  1169. command, i.e. question marks (?) and asterisks (*) may be interspersed 
  1170. throughout the fi)e name and type fields.
  1171.  
  1172. A  question  mark will match any character in that  position,  and  an 
  1173. asterisk  will match any combination of characters within the field in 
  1174. which it is used (actually,  an asterisk in the name field is  equiva
  1175. lent  to eigth question marks,  and an asterisk in the extension field 
  1176. is equivalent to three question marks).
  1177.  
  1178. If  both the name and the extension fields are left out,  leaving only 
  1179. the  drive identifier and a colon,  then all files on that  drive  are 
  1180. listed.  If <afn> is omitted entirely, then all files of the currently 
  1181. logged drive are listed.
  1182.  
  1183.  
  1184. 5.2 The USE command
  1185.  
  1186. The use command is used to display and set the currently logged  drive 
  1187. (the default drive).
  1188.  
  1189. The command line format is:
  1190.  
  1191.                              USE <drive>
  1192.  
  1193. Where <drive> is a drive identifier (A-O).   If <drive> is  specified, 
  1194. that drive becomes the default drive.  Before returning to the command 
  1195. level,  the  USE command displays the identifier of the default drive, 
  1196. for instance:
  1197.  
  1198.                           Current drive is A
  1199.  
  1200.  
  1201. 5.3 The MEMORY command
  1202.  
  1203. The  MEMORY command is used to display the current  memory  allocation 
  1204. state:
  1205.  
  1206.                  Code: rrrrrr bytes (aaaa paragraphs) 
  1207.                  Data: ssssss bytes (bbbb paragraphs) 
  1208.                  Free: tttttt bytes (cccc paragraphs)
  1209.  
  1210. The  'Code'  and  'Data' fields are displayed only if an  object  code 
  1211. version  of the current program is present in memory.  The numbers  in 
  1212. parentheses are the paragraph sizes (in hex) of each area.  One  para
  1213. graph corresponds to 16 bytes.
  1214.  
  1215. .pa
  1216. Section 5                                             Further commands
  1217.  
  1218.  
  1219. 5.4 The ZAP command
  1220.  
  1221. The  ZAP  command erases the text held within the memory  buffer,  and 
  1222. changes the current file name to 'WORK.PAS'.  As a safety  precaution, 
  1223. ZAP prompts:
  1224.  
  1225.                          Are you sure (Y/N)?
  1226.  
  1227. Any answer but 'Y' or 'y' will leave the text unchanged.
  1228.  
  1229.  
  1230. 5.5 The QUIT command
  1231.  
  1232. The  QUIT command transfers control to the operating system.   If  the 
  1233. source text has been edited but not saved, SURPAS prompts:
  1234.  
  1235.                      Text not saved. Quit (Y/N)?
  1236.  
  1237. and  any  answer but 'Y' or 'y' will return you to the command   mode. 
  1238. You may later warmstart SURPAS as described in section 1.1.
  1239.  
  1240.  
  1241.  
  1242. .pa
  1243.