home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / cpmhelp / algolm.hlp < prev    next >
Text File  |  1994-07-27  |  13KB  |  239 lines

  1. Invoking the ALGOL/M Compiler and Run-Time System
  2. ALGOL/M Reserved Words
  3. ALGOL-M LANGUAGE DESCRIPTION
  4. ALGOL-M LANGUAGE DESCRIPTION -- Type Declarations
  5. ALGOL-M LANGUAGE DESCRIPTION -- Arithmetic Processing
  6. ALGOL-M LANGUAGE DESCRIPTION -- Control Structures
  7. ALGOL-M LANGUAGE DESCRIPTION -- Input/Output
  8. ALGOL-M LANGUAGE DESCRIPTION -- Disk Access
  9. ALGOL-M Compiler Error Messages
  10. ALGOL-M Run-Time Error and Warning Messages
  11. :Invoking the ALGOL/M Compiler and Run-Time System
  12.  
  13.      ALGOL/M is invoked by typing --
  14.  
  15.           ALGOLM filename $option
  16.  
  17. where 'filename' is the name of the file 'filename.ALG' which contains 
  18. the  source  of  the ALGOL/M program.   Upon executing  this  command, 
  19. ALGOL/M  will  compile this source program into the pseudo  code  file 
  20. 'filename.AIN' which can then be executed by typing --
  21.  
  22.           RUNALG filename
  23.  
  24. where 'filename' is the name of the file 'filename.INT' which contains 
  25. the ALGOL/M pseudo code.
  26.  
  27.      The options recognized by the ALGOL/M Compiler are --
  28.  
  29.           $A        Generate a listing at the terminal
  30.           $E        Set Trace Mode for execution under RUNALG
  31.           $AE       Do Both of the above
  32. :ALGOL/M Reserved Words
  33.  
  34.     AND        ARRAY        BEGIN        CASE
  35.     CLOSE        DECIMAL        DO        ELSE
  36.     END        FILE        FUNCTION    GO
  37.     GOTO        IF        INTEGER        NOT
  38.     OF        ONENDFILE    OR        PROCEDURE
  39.     READ        STEP        STRING        TAB
  40.     THEN        TO        UNTIL        WHILE
  41.     WRITE        WRITEON
  42. :ALGOL-M LANGUAGE DESCRIPTION
  43.  
  44.                  Although ALGOL-M was modeled after ALGOL-60, no  attempt
  45.              was  made  to make it a formal subset of ALGOL-60.  This was
  46.              done intentionally in order  to  provide  a  language  which
  47.              would   be   best   suited  to  the  needs  of  applications
  48.              programmers using microcomputer systems.  However, the basic
  49.              structure  of ALGOL-M is similar enough to ALGOL-60 to allow
  50.              simple conversion of  programs  from  one  language  to  the
  51.              other.   This  was considered particularly important in view
  52.              of the  fact  that  the  standard  publication  language  is
  53.              ALGOL-60.    Therefore,  there  exists  a  large  source  of
  54.              applications programs and library procedures  which  can  be
  55.              simply converted to execute under ALGOL-M.
  56. :ALGOL-M LANGUAGE DESCRIPTION -- Type Declarations
  57.  
  58.                      ALGOL-M supports three types of variables: integers,
  59.              decimals,   and  strings.  Integers may be any value between
  60.              -16,383 and +16,383.  Decimals may be declared with up to 18
  61.              digits  of  precision and strings may be declared as long as
  62.              255 characters.  The default precision for decimals  is  ten
  63.              digits and the default length for strings is ten characters.
  64.              Decimal and string variable lengths may be integer variables
  65.              which can be assigned actual values at run-time.
  66.                      Another form of declaration in ALGOL-M is the  array
  67.              declaration.  Arrays may  have up  to  255  dimensions  with
  68.              each dimension ranging from       0 to +16,383.  The maximum
  69.              8080  microprocesor  address  space  of  63k  bytes   limits
  70.              practical   array   sizes  to  something  smaller  than  the
  71.              maximum.  Dimension bounds may be integer variables with the
  72.              actual  values  assigned at run-time.  Arrays may be of type
  73.              integer, decimal or string.
  74. :ALGOL-M LANGUAGE DESCRIPTION -- Arithmetic Processing
  75.  
  76.                      Integer and  binary  coded  decimal  arithmetic  are
  77.              supported  under  ALGOL-M.   Integers may be used in decimal
  78.              expressions and will be converted to decimals  at  run-time.
  79.              The  integer  and  decimal  comparisons  of  less-than  (<),
  80.              greater-than (>), equal-to  (=),  not-equal-to  (<>),  less-
  81.              than-or-equal-to (<=), and greater-than-or-equal-to (>=) are
  82.              provided.  Additionally, the logical operators AND,  OR  and
  83.              NOT are available.
  84. :ALGOL-M LANGUAGE DESCRIPTION -- Control Structures
  85.  
  86.                      ALGOL-M control structures consist  of  BEGIN,  END,
  87.              FOR, IF THEN, IF THEN ELSE, WHILE, CASE and GOTO constructs.
  88.              Function and  procedure  calls  are  also  used  as  control
  89.              structures.   ALGOL-M  is  a block stuctured language with a
  90.              block normally bracketed by a BEGIN and an END.  Blocks  may
  91.              be  nested  within  other  blocks to nine levels.  Variables
  92.              which are declared within a block  can  only  be  referenced
  93.              within that block or a block nested within that block.  Once
  94.              program control proceeds outside  of  a  block  in  which  a
  95.              variable   has  been  declared,  the  variable  may  not  be
  96.              referenced and, in fact, run-time  storage  space  for  that
  97.              variable no longer exists.
  98.  
  99.                      Functions, when called, return an  integer,  decimal
  100.              or  string  value  depending  on  the  type of the function.
  101.              Procedures  do  not  return  a  value  when  called.    Both
  102.              functions  and  procedures  may have zero or more parameters
  103.              which are call by value and both may be called recursively.
  104. :ALGOL-M LANGUAGE DESCRIPTION -- Input/Output
  105.  
  106.                      The ALGOL-M WRITE statement  causes  output  to  the
  107.              console on a new line.  The desired output is specified in a
  108.              write  list  which  is  enclosed  in  parentheses.    String
  109.              constants  may be used in a write list and are characterized
  110.              by being enclosed in quotation marks.   Any  combination  of
  111.              integer,  decimal  and  string  variables or expressions may
  112.              also be used in a write list.  A WRITEON statement  is  also
  113.              available  which  is  essentially  the  same  as  the  WRITE
  114.              statement except that output continues on the same  line  as
  115.              the output from a previous WRITE or WRITEON statement.  When
  116.              a total of 80 characters have been written to the console, a
  117.              new line is started automatically.  A TAB option may also be
  118.              used in the write list which causes the  following  item  in
  119.              the  write  list  to  be  spaced  to the right by a specifed
  120.              amount.
  121.  
  122.                     Console input is accomplished by the READ  statement
  123.              followed  by  a  read  list  of  any combination of integer,
  124.              decimal and string variables enclosed  in  parentheses.   If
  125.              embedded  blanks  are  desired  in  the  input  for a string
  126.              variable, the console input must be  enclosed  in  quotation
  127.              marks.   A  READ  statement will result in a halt in program
  128.              execution at run-time until the input values  are  typed  at
  129.              the  console  and  a carriage return is sent.  If the values
  130.              typed at the console match the read list in number and type,
  131.              program  execution  continues.   If an error as to number or
  132.              type of variables from the console occurs, program execution
  133.              is again halted until values are re-entered on the console.
  134. :ALGOL-M LANGUAGE DESCRIPTION -- Disk Access
  135.  
  136.                      ALGOL-M programs may read data from,  or write  data
  137.              to,   one  or more disk files which may be located on one or
  138.              more disk drives.  When file input  or  output  is  desired,
  139.              the  appropriate  READ  or  WRITE  statement  is modified by
  140.              placing a filename  identifier  immediately  after  READ  or
  141.              WRITE.   The  actual name of the file may be assigned to the
  142.              file name identifier when the program is written or  it  may
  143.              be assigned at run-time.  Various disk drives are referenced
  144.              by the letters  A  through  Z.   A  specific  drive  may  be
  145.              specified by prefixing the actual file name with the desired
  146.              drive letter followed by a colon.  Additionally,  if  random
  147.              file  access  is  desired,  the  file name identifier may be
  148.              followed by a comma and an integer constant or variable.
  149.              This integer value specifies the record within the file which 
  150.              is to be used for input/output.
  151.  
  152.  
  153.                      Prior to the use of a file name identifier in a READ
  154.              or  WRITE statement, the file name identifier must appear in
  155.              a file declaration statement.  The file name identifier  can
  156.              only be referenced within the same block (or a lower  block)
  157.              as  the  file  declaration.   Files  are normally treated as
  158.              unblocked sequential files.  However, if blocked  files  are
  159.              desired,  the  record  length may optionally be specified in
  160.              brackets after the  file  name  identifier  in  the  file
  161.              declaration statement.
  162. :ALGOL-M Compiler Error Messages
  163.  
  164. AS      Function/Procedure on left hand side of assignment
  165.         statement.
  166. BP      Incorrect bound pair subtype (must be integer).
  167. DE      Disk error; no corrective action can be taken  
  168.         in the program.
  169. DD      Doubly declared identifier, label, variable etc.
  170. FP      Incorrect file open statement.
  171. IC      Invalid special character.
  172. ID      Subtypes incompatible (decimal values can not be
  173.         assigned to integer variables).
  174. IO      Integer overflow.
  175. IT      Identifier is not declared as a simple variable or
  176.         function.
  177. NG      No ALG file found.
  178. NI      Subtype is not integer.
  179. NP      No applicable production exists.
  180. NS      Subtype is not string.
  181. NT      For clause,Step expression,Until clause expressions are not
  182.         of the same subtype.(must all be integer or decimal).
  183.  
  184. PC      Number of parameters in procedure call does not match the 
  185.         number in the procedure declaration.
  186. PD      Undeclared parameter.
  187. PM      Parameter type does not match the declared type.
  188. SO      Stack overflow.
  189. SI      Array subscript is not of subtype integer.
  190. TD      Subtype has to be integer or decimal.
  191. TM      Subtypes do not match or are incompatible.
  192. TO      Symbol table overflow.
  193. TS      Undeclared subscripted variable.
  194. UD      Undeclared identifier.
  195. UF      Undeclared file/function.
  196. UL      Undeclared label.
  197. UP      Undeclared procedure.
  198. US      Undeclared simple variable.
  199. VO      Varc table overflow.  Possibly caused by too many 
  200.         long identifiers.
  201. :ALGOL-M Run-Time Error and Warning Messages
  202.  
  203.           ERROR Messages
  204.  
  205. AB      Array subscript out of bounds.
  206. CE      Disk file close error.
  207. DB      Input field length is larger then the buffer size.
  208. DW      Disk file write error.
  209. ER      Variable block size write error.
  210. IO      Integer overflow(integer value greater than 16383).
  211. IR      Record number incorrect or random file is not initialized.
  212. ME      Disk file creation error.
  213. NA      No AIN file found on directory.
  214. OV      Decimal register overflow during arithmetic operation/
  215.         load.
  216. RE      Attempt to read past end of record on blocked file.
  217. RU      Attempt to random access a non-blocked file.
  218. SK      Stack overflow(no more memory available).
  219.  
  220.            WARNING Messages
  221.  
  222. AZ      Attempt to allocate null decimal or string,
  223.         system defaults to 10 digits/characters.
  224. DO      Decimal overflow during store operation. The value of
  225.         the variable is set to 1.0 and execution continues.
  226.         The variable's allocation size should be increased in
  227.         it's declaration statement.
  228. DI      Disk file variable format error.
  229. DZ      Decimal division by zero, result is set to 1.0.
  230. EF      End of file on read.
  231. IA      Integer addition/subtraction over/under flow 
  232.         result is set to 1.
  233. II      Invalid Console Input. Try input again.
  234. IR      Record number incorrect or random file is not initialized.
  235. IZ      Integer division by zero. Divisor set to 1 and 
  236.         division is completed.
  237. NX      Negative exponential. Exponentiation not done.
  238. SO      Characters lost during string store.
  239.