home *** CD-ROM | disk | FTP | other *** search
/ norge.freeshell.org (192.94.73.8) / 192.94.73.8.tar / 192.94.73.8 / pub / computers / cpm / alphatronic / BASCOM53.ZIP / BASCOM2.HLP < prev    next >
Text File  |  1998-06-07  |  29KB  |  691 lines

  1. Compiling a program
  2. Compilation switches
  3. Compile-time error messages
  4. The LINK-80 linking loader
  5. LINK-80 error messages
  6. Storing your program on disk
  7. Running your compiled program
  8. Runtime error messages
  9. Using M80
  10. :COMPILING A PROGRAM  
  11.  
  12. Is your BASIC program now saved in ASCII format on your diskette?  (To save 
  13. your program in ASCII format when using the interpreter,  add an "A" switch 
  14. to the "SAVE" command, as shown in SAMPLE SESSION, Step 3: 
  15.  
  16.           SAVE "<filename>[.<ext>]",A
  17.  
  18. Return to CP/M command level and enter:
  19.  
  20.           BASCOM
  21.  
  22. BASIC  will  return  the prompt:       "*",  informing you that  the  BASIC 
  23. Compiler is loaded and ready to accept a command.
  24.  
  25. Now enter the command of the form:
  26.  
  27.      objfile,lstfile=source file
  28.  
  29. where objfile is the relocatable object file,  lstfile is the listing file, 
  30. and source file is the BASIC source program file.
  31.  
  32. A command to BASIC conveys the name of the source file to be compiled,  and 
  33. the names of the file(s) to be created. With CP/M filenames are up to eight 
  34. characters long with a three-character extension.    The  default  filename
  35. extensions supplied to CP/M are:
  36.  
  37.           REL       Relocatable object file
  38.           LST       Listing file
  39.           BAS       BASIC source file
  40.           MAC       MACRO-80 source file
  41.           FOR       FORTRAN-80 source file
  42.           COB       COBOL-80 source file
  43.           COM       Executable command file
  44.  
  45. If you have a multi-drive system, you can tell the compiler where to obtain 
  46. or  put  the files you are working with by adding a drive  number  to  each 
  47. filename. For example:
  48.  
  49.      A:MYPROG.REL=B:TEST
  50.  
  51. finds the program TEST.BAS on the diskette that is in drive B, compiles it, 
  52. and puts the object in MYPROG.REL (on the diskette that is in drive A).
  53.  
  54. If a drive is NOT specified, the object and listing files are placed on the 
  55. diskette that is in the default drive.
  56.  
  57. Either  the  object  file or the listing file or both may  be  omitted.  An 
  58. object file is created only if the lstfile field is filled.  Therefore,  if 
  59. you wish to omit either, simply leave its filename out of the command.
  60.  
  61. Examples:
  62.  
  63. TESTOBJ=TEST.BAS    Compile  the  program  TEST.BAS 
  64.                     and  put object in  TESTOBJ.REL 
  65.                     without producing listing file.
  66. TEST,TEST=TEST      Compile TEST.BAS, put object in 
  67.                     TEST.REL    and   listing    in 
  68.                     TEST.LST.
  69. ,=TEST.BAS          Compile TEST.BAS but produce no 
  70.                     object or listing file.  Useful 
  71.                     for checking for errors.
  72. RABBIT=TEST         Compile  the  program  TEST.BAS 
  73.                     and  put object  in  RABBIT.REL 
  74.                     without producing listing file.
  75. :BASIC COMPILATION SWITCHES
  76.  
  77. You can specify special parameters to be used during compilation by  adding 
  78. a switch to the end of the command string.  Switches are always preceded by 
  79. a slash,  and  more  than one switch may be used in the  same  command.  An 
  80. example of the format would be:
  81.  
  82.      TEST,TEST=TEST/D/X
  83.  
  84. The default switch settings used if you don't specify any switches are:  
  85.  
  86.       /Z/4/T
  87.  
  88. The available switches and their actions are as follows:
  89.  
  90. SWITCH    ACTION
  91.  
  92. /E        The /E switch tells the compiler that the program contains the ON 
  93.           ERROR  GOTO statement.  If a RESUME statement other  than  RESUME 
  94.           <line  number> is used with the ON ERROR GOTO statement,  use  /X 
  95.           instead  (see  below).  To handle ON ERROR GOTO  properly,  in  a 
  96.           compiled environment, BASIC must generate some extra code for the 
  97.           GOSUB  and RETURN statements.  Therefore,  do not use this switch 
  98.           unless your program contains the ON ERROR GOTO statement.  The /E 
  99.           switch  also  causes line numbers to be included  in  the  binary 
  100.           file,  so  runtime error messages will include the number of  the 
  101.           line in error.
  102.  
  103. SWITCH    ACTION
  104. /X        The  /X switch tells the BASIC Compiler that the program contains 
  105.           one or more RESUME,  RESUME NEXT,  or RESUME 0 statements. The /E 
  106.           switch  is  assumed when the /X switch is  specified.  To  handle 
  107.           RESUME  statements  properly  in  a  compiled  environment,   the 
  108.           compiler must relinquish certain optimizations. Therefore, do not 
  109.           use  this switch unless your program contains  RESUME  statements 
  110.           other  than RESUME <line number>.  The /X switch also causes line 
  111.           numbers  to  be included in the binary  file,  so  runtime  error 
  112.           messages will include the number of the line in error.
  113.  
  114. /N        The  /N switch prevents listing of the generated code in symbolic 
  115.           notation.  If this switch is not set, the source listing produced 
  116.           by  the compiler will contain the object code generated  by  each 
  117.           statement.
  118.  
  119. SWITCH    ACTION
  120.  
  121. /D        The  /D  switch  causes debug/checking code to  be  generated  at 
  122.           runtime.  This  switch must be set if you want to use TRON/TROFF. 
  123.           The  BASIC Compiler generates somewhat larger and slower code  in 
  124.           order to perform the following checks:
  125.           1.   Arithmetic overflow.  All arithmetic operations, integer and 
  126.                floating point, are checked for overflow and underflow.
  127.           2.   Array bounds. All array references are checked to see if the 
  128.                subscripts are within the bounds specified in the DIM state-
  129.                ment.
  130.           3.   Line  numbers are included in the generated binary  so  that 
  131.                runtime errors can indicate the statement which contains the 
  132.                error.
  133.           4.   RETURN is checked for a prior GOSUB.
  134.  
  135. /Z        The /Z switch tells the compiler to use Z80  opcodes. 
  136.  
  137. SWITCH    ACTION
  138.  
  139. /S        The  /S  switch forces the compiler to write long quoted  strings 
  140.           (i.e.  more  than  4 characters) to the binary file as  they  are 
  141.           encountered.  This allows large programs with many quoted strings 
  142.           to compile in less memory. However, there are two disadvantages:
  143.           1.    Memory  space is wasted if identical,  long quoted  strings 
  144.                appear in the program.
  145.           2.   Code  generated while the -S switch is set cannot be  placed 
  146.                in ROM.
  147.  
  148. SWITCH    ACTION
  149.  
  150. /4        The  /4 switch allows the compiler to use the lexical conventions 
  151.           of  Microsoft 4.51 Disk BASIC interpreter.  That is,  spaces  are 
  152.           insignificant,   variables  with  imbedded  reserved  words   are 
  153.           illegal,   variable  names  are  restricted  to  two  significant 
  154.           characters,  etc. this feature is useful if you wish to compile a 
  155.           source program that was coded without spaces,  and contains lines 
  156.           such as
  157.  
  158.                FORI=ATOBSTEPC
  159.  
  160.           Without  the  /4 switch,  the compiler would assign the  variable 
  161.           "ATOBSTEPC" to the variable FORI.  With the /4 switch,  it  would 
  162.           recognize it as a FOR statement.
  163.  
  164. SWITCH    ACTION
  165. /C        The  /C  switch tells the compiler to relax line  numbering  con-
  166.           straints.  Whene  /C  is specified,  line numbers may be  in  any 
  167.           order,  or  they may be eliminated entirely.  Lines are  compiled 
  168.           normally,  but  of course cannot be targets for GOTO's,  GOSUB's, 
  169.           etc.  While  /C  is  set,  the  underline  character  causes  the 
  170.           remainder  of  the  physical line to be  ignored,  and  the  next 
  171.           physical  line is considered to be a continuation of the  current 
  172.           logical line.  NOTE:   /C  and  /4 may not be  used  together. 
  173.  
  174. /T        Use 4.51 execution conventions
  175.  
  176. /O        (Newer versions only).  Tells the compiler to  construct a stand-
  177.           alone program instead of one  requiring presence of the  BRUN.COM
  178.           runtime module.  This generates much bigger programs because  all
  179.           of the runtime routines must be included.
  180. :BASIC COMPILER ERROR MESSAGES
  181.  
  182. The  following  errors may occur while a program is  compiling.  The  BASIC 
  183. Compiler outputs the two-character code for the err,  along with an  arrow. 
  184. The  arrow indicates where in the line the error occurred.  In those  cases 
  185. where the compiler has read ahead before it discovered an error,  the arrow 
  186. points a few characters beyond the error, or at the end of the line.    The
  187. error codes are as follows:
  188.  
  189. FATAL ERRORS  
  190.  
  191. CODE      ERROR
  192. SN        Syntax Error. Caused by one of the following:
  193.                Illegal argument name
  194.                Illegal assignment target
  195.                Illegal constant format
  196.                Illegal debug request
  197.                Illegal DEFxxx character specification
  198.                Illegal expression syntax
  199.                Illegal function argument list
  200.                Illegal function name
  201.  
  202. CODE      ERROR
  203. SN        Syntax Error. Caused by one of the following:
  204.                Illegal function formal parameter
  205.                Illegal separator
  206.                Illegal format for statement number
  207.                Illegal subroutine syntax
  208.                Invalid character
  209.                Missing AS
  210.                Missing equal sign
  211.                Missing GOTO or GOSUB
  212.                Missing comma
  213.                Missing INPUT
  214.                Missing line number
  215.                Missing left parenthesis
  216.                Missing minus sign
  217.                Missing operand in expression
  218.                Missing right parenthesis
  219.                Missing semicolon
  220.                Name too long
  221.                Expected GOTO or GOSUB
  222.  
  223. CODE      ERROR
  224. SN        Syntax Error. Caused by one of the following:
  225.                String assignment required
  226.                String expression required
  227.                String variable required here
  228.                Illegal syntax
  229.                Variable required here
  230.                Wrong number of arguments
  231.                Formal parameters must be unique
  232.                Single variable only allowed
  233.                Missing TO
  234.                Illegal FOR loop index variable
  235.                Missin THEN
  236.                Missing BASE
  237.                Illegal subroutine name
  238. OM        Out of memory
  239.                Array too big
  240.                Data memory overflow
  241.                Too many statement numbers
  242.                Program memory overflow
  243.  
  244. CODE      ERROR
  245. SQ        Sequence Error
  246.                Duplicate statement number
  247.                Statement out of sequence
  248. TM        Type Mismatch
  249.                Data type conflict
  250.                Variables must be of same type
  251. BS        Bad Subscript
  252.                Illegal dimension value
  253.                Wrong number of subscripts
  254. LL        Line Too Long
  255. UC        Unrecognizable Command
  256.                Statement unrecognizable
  257.                Command not implemented
  258. OV        Math Overflow
  259. /0        Division by Zero
  260. DD        Array Already Dimensioned
  261. FN        FOR/NEXT Error
  262.                FOR loop index variable already in use
  263.                FOR without NEXT
  264.                NEXT without FOR
  265.  
  266. CODE      ERROR
  267. FD        Function Already Defined
  268. UF        Function Not Defined
  269. WE        WHILE/WEND Error
  270.                WHILE without WEND
  271.                WEND without WHILE
  272. /E        Missing "/E" Switch
  273. /X        Missing "/X" Switch
  274.  
  275. WARNING ERRORS 
  276. ND        Array Not Dimensioned
  277. SI        Statement Ignored
  278.                Statement ignored
  279.                Unimplemented command
  280.  
  281. If  the  BASIC Compiler informs you of any of these errors,  return to  the 
  282. source  program for debugging and try again.  
  283.  
  284. If no errors were encountered during compilation,  and if you so chose, you 
  285. now  have an object file containing machine readable code on your diskette. 
  286. Also  on your diskette is a listing file which contains the  BASIC  program 
  287. statements along with the machine language generated by each statement.
  288.  
  289. The next step in the process is loading and executing the program with 
  290. LINK-80.
  291.  
  292. :LINK-80 LINKING LOADER
  293.  
  294. As  demonstrated in SAMPLE SESSION,  compiled BASIC object files are loaded 
  295. into memory and executed using the LINK-80 linking loader.  The loader  has 
  296. many uses.  You may wish to simply load one compiled program and run it, or 
  297. you   may  load  several  programs,   subprograms,   or  assembly  language 
  298. subroutines  at  the same time.  Programs may be loaded  at  user-specified 
  299. locations,  and program areas and data areas may be separated in memory.  A 
  300. memory  image  of the executable file produced by LINK-80 can be  saved  on 
  301. disk and run at a later time.
  302.  
  303. RUNNING LINK-80
  304.  
  305. At CP/M command level, enter:
  306.  
  307.      L80
  308.  
  309. This loads LINK-80,  which will respond with:    *  . The loader exits back 
  310. to CP/M if a CONTROL-C is typed after the asterisk.  (The loader also exits 
  311. back  to CP/M after an /E switch or /G switch is executed.  More  on  these 
  312. switches later.)
  313.  
  314. LINK-80 COMMAND FORMAT
  315.  
  316. A  command  to LINK-80 is made up of the filename(s) of the file(s)  to  be 
  317. loaded. For example, to load the compiled program MYPROG.REL, enter:
  318.  
  319.      MYPROG
  320.  
  321. (It  is  not necessary to type the default extension .REL.) This loads  the 
  322. program  but  does  not run it.  Whenever LINK-80 loads  a  BASIC  Compiler 
  323. program,  it  automatically  searches the BASIC library for  the  necessary 
  324. routines  and loads these as well.  Therefore,  BASLIB.REL must be  on  the 
  325. default drive during the loading process. 
  326.  
  327. To run MYPROG, enter:
  328.  
  329.      /G
  330.  
  331. This is the "go" or execute switch.  LINK-80 prints two numbers and a BEGIN 
  332. EXECUTION  message.  LINK-80 always returns to TRSDOS after a /G switch has 
  333. been executed.
  334.  
  335. As  you  probably have guessed,  it  is  not  necessary  to  perform  these
  336. operations with separate commands.  It is possible to type one command line 
  337. that runs LINK-80, loads MYPROG.REL and executes it. To do this, enter:  
  338.  
  339. L80 MYPROG/G
  340.  
  341. MORE COMMANDS AND SWITCHES
  342.  
  343. LINK-80  provides  other capabilities besides  loading  and  executing 
  344. programs,  such  as  looking at output without saving the  program  or 
  345. resetting  the loader so that you can correct a mistake.  Switches are 
  346. used to inform LINK-80 that you wish to perform special tasks.
  347.  
  348. Here is an example that loads and saves a program called TEST.REL.
  349.  
  350.      >L80
  351.      *TEST,TEST/N/E
  352.  
  353. The first part of the command (TEST) loads the program called TEST.REL. The 
  354. next  part  (TEST/N) saves a copy of the loaded program on disk in  a  file 
  355. called TEST.COM. The last part (/E) causes LINK-80 to exit back to CP/M.
  356.  
  357. THE /N SWITCH
  358.  
  359. Take  note  of  the /N switch.  This switch saves a  memory  image  of  the 
  360. executable file on disk.  The default extension for the saved file is .COM, 
  361. and this file is called a "command file". Once saved on disk, you need only 
  362. type  the filename at CP/M command level to run the program.  The /N switch 
  363. must immediately follow the filename of each file you wish to save,  and it 
  364. does not take effect until a /E or /G switch is done.
  365.  
  366. The  following example links several object files,  saves the main  program 
  367. image and executes the program TAXES.REL.
  368.  
  369.      >L80
  370.      *SUB1,SUB2,TAXES/N,TAXES/G
  371.  
  372. Two subroutines (SUB1) and (SUB2) and an object file (TAXES) are linked and 
  373. loaded.  The program is executed and the command file TAXES.COM is saved on 
  374. disk.
  375.  
  376. THE /R SWITCH
  377.  
  378. Another  handy switch is /R.  It returns LINK-80 to it's initial  state  by 
  379. "unloading"  whatever you've loaded.  Use it to reset the loader if  you've 
  380. made  a  typing mistake or loaded the wrong program.  The /R  switch  takes 
  381. effect  as  soon as LINK-80 sees it,  so if you enter it at any time  while 
  382. LINK-80 is running, the loader will reset. For example:
  383.  
  384.      >L80
  385.      *INVEN1
  386.      */R            (oops-- meant to load INVEN2)
  387.      *INVEN2        (now only INVEN2 is loaded)
  388.  
  389. SPECIAL SWITCHES
  390.  
  391. For  typical  BASIC Compiler operation,  only the above  switches  will  be 
  392. needed.   Some   users  may  find  that  their  applications  require  more 
  393. specialized capabilities.  For this reason, the following switches are also 
  394. provided with LINK-80.
  395.  
  396. In these examples, all  programs  have  been  loaded at the default origins
  397. of CP/M.    In special cases,  the user may wish to specify the origins  of
  398. the programs and data that are loaded. LINK-80 provides special switches to 
  399. do this.
  400.  
  401. /E:Name   This is an optional form of the /E switch.  Name is a global 
  402.           symbol  previously defined in one of  the  modules.  LINK-80 
  403.           uses Name for the start address of the program.
  404.  
  405. /G:Name   This is an optional form of the /G switch.  Name is a global 
  406.           symbol  previously  defined in one of the  modules.  LINK-80 
  407.           uses Name for the start address of the program.
  408.  
  409. /P and /D /P and /D allow the origin(s) to be set for the next program 
  410.           loaded.  /P and /D take effect when seen (not deferred), and 
  411.           they have no effect on programs already loaded.  The form is 
  412.           /P:<address> or /D:<address>, where <address> is the desired 
  413.           origin  in  the current typeout  radix.  (Default  radix  is 
  414.           hexadecimal.  /O  sets radix to octal;  /H to hex.)  LINK-80 
  415.           does a default /P:<link origin> (i.e., 100h).
  416.  
  417.           If  no  /D is given,  data areas are loaded  before  program 
  418.           areas for each module. If a /D is given, All Data and Common 
  419.           areas are loaded starting at the data origin and the program 
  420.           area at the program origin. Example:
  421.  
  422.                */P:200,FOO
  423.                DATA      200       300
  424.                */R
  425.                */P:200-D:400,FOO
  426.                DATA      400       480
  427.                PROGRAM   200       280
  428.  
  429. /U        List the origin and end of the program and data area and all 
  430.           undefined  globals as soon as the current command  line  has 
  431.           been interpreted. The program information is only printed if 
  432.           a /D has been done.  Otherwise, the program is stored in the 
  433.           data area.
  434.  
  435. /M        List  the origin and end of the program and data  area,  all 
  436.           undefined  globals  and  their  values,  and  all  undefined 
  437.           globals followed by an asterisk.  The program information is 
  438.           only printed if a /D has been done.  Otherwise,  the program 
  439.           is stored in the data area.
  440.  
  441. /X        If a filename/N was specified, /X will cause the file to  be 
  442.           saved in INTEL ascii HEX format with an extension of .HEX.
  443.  
  444. /Y        If a filename/N was specified, /Y will create a filename.SYM
  445.           file when /E is entered.  This file contains the  names  and 
  446.           addresses of all Globals for use with Digital Research's SID
  447.           and ZSID debuggers. 
  448.  
  449. SYSTEM LIBRARY SEARCHES
  450.  
  451. Whenever a BASIC Compiler program is loaded, LINK-80 automatically searches 
  452. the BASIC Compiler library for the routines it needs and loads them. If you 
  453. gat an "Undefined" error,  it means the compiler couldn't find something it 
  454. needed  to  finish  compiling the program.  Usually this is the name  of  a 
  455. subroutine that you forgot to load.
  456.  
  457. If  you  are  using  the BASIC Compiler  in  conjunction  with  Microsoft's 
  458. FORTRAN-80, you may also be referencing some of FORTRAN's library routines. 
  459. For this reason,  the /S switch is included in LINK-80 to force a search of 
  460. particular library modules. For example:
  461.  
  462.      *FORLIB/S,TEST/G
  463.  
  464. Unless you are using FORLIB (supplied with FORTRAN-80), you should not need 
  465. the /S switch.
  466.  
  467.  
  468. :LINK-80 ERROR MESSAGES
  469.  
  470. LINK-80 has the following error messages:
  471.  
  472. ?No Start Address        A /G switch was issued, but no main 
  473.                          program had been loaded.
  474.  
  475. ?Loading Error           The  last file given for input  was 
  476.                          not  a  properly formatted  LINK-80 
  477.                          object file.
  478.  
  479. ?Out of Memory           Not enough memory to load program.
  480.  
  481. ?Command Error           Unrecognizable LINK-80 command.
  482.  
  483. ?<file> Not Found        <file>,  as given in the command string, 
  484.                          did not exist.
  485.  
  486. %2nd COMMON larger       The   first  definition  of  COMMON 
  487.                          block /XXXXXX/ was not the  largest 
  488.                          definition.  Reorder module loading 
  489.                          sequence  or  change  COMMON  block 
  490.                          definitions.
  491.  
  492. %Mult. Def. Global YYYYYY
  493.                          More  than  one definition for  the 
  494.                          global (internal) symbol YYYYYY was 
  495.                          encountered   during  the   loading 
  496.                          process.
  497.  
  498. %Overlaying Program Area     ,Start = xxxx
  499.             Data             ,Public = <symbol name>(xxxx)
  500.                              ,External = <symbol name>(xxxx)
  501.                          A  /D  or  /P  will  cause  already 
  502.                          loaded data to be destroyed.
  503.  
  504. ?Intersecting Program Area
  505.               Data       The program and data area intersect
  506.                          and an address  or  external  chain
  507.                          entry is in this intersection.  The
  508.                          final value cannot be  converted to
  509.                          a current value  since it is in the
  510.                          area intersection.
  511. ?Start Symbol - <name> - Undefined
  512.                          After a /E:  or /G:  is given,  the 
  513.                          symbol specified was not defined.
  514.  
  515. Origin Above (Below) Loader Memory, Move Anyway (Y or N)?
  516.                          After a /E or /G was given,  either 
  517.                          the  data  or program area  has  an 
  518.                          origin  or  top which lies  outside 
  519.                          loader memory (i.e.,  loader origin 
  520.                          to  top of memory).  If a Y  CR  is 
  521.                          given,  LINK-80  will move the area 
  522.                          and continue.  If anything else  is 
  523.                          given, LINK-80 will exit. In either 
  524.                          case,  if a /N was given, the image 
  525.                          will already have been saved.
  526.  
  527. ?Can't save Object File  A disk error occurred when the file was being 
  528. saved.
  529. :STORING YOUR PROGRAM ON DISKETTE
  530.  
  531. Once it has been loaded by LINK-80,  the object file is in a form that  can 
  532. be  executed  by any CP/M computer.  You can save this compiled program  on 
  533. your own diskette so that it can be executed at a later time without  using 
  534. the  BASIC  Compiler  at  all.  
  535.  
  536. The  /N switch (discussed in the LINK-80 section) is the switch that causes 
  537. your  object file to be saved.  The default extension for the saved file is 
  538. .COM and this file is called a "command file".
  539.  
  540. :RUNNING YOUR COMPILED PROGRAM  
  541.  
  542. Your  compiled program (previously saved on your own diskette) can  now  be 
  543. executed any time you wish. When you are at CP/M command level the diskette 
  544. on which you saved your program is inserted into a drive, simply enter:
  545.  
  546.      <filename>
  547.  
  548. At this point, your program should execute and your output should appear on 
  549. the screen.  However,  you may get a runtime error message. If you do, look 
  550. it up in the following list,  and debug your program as best you can before 
  551. trying to store it on diskette again.
  552.  
  553.  
  554. :RUNTIME ERROR MESSAGES
  555.  
  556. The following errors may occur while a compiled program is  executing.  The 
  557. error numbers match those issued by the BASIC-80 interpreter.  The compiler 
  558. runtime  system prints long error messages followed by an  address,  unless 
  559. /D, /E, or /X is specified. In those cases the error message is followed by 
  560. the number of the line in which the error occurred.
  561.  
  562. NUMBER              MESSAGE
  563. 2         Syntax error
  564.           A  line is encountered that contains an  incorrect 
  565.           sequence of characters in a DATA statement.
  566. 3         RETURN without GOSUB
  567.           A  RETURN statement is encountered for which there 
  568.           is no previous, unmatched GOSUB ststement.
  569. 4         Out of Data
  570.           A  READ  statement is executed when there  are  no 
  571.           DATA statements with unread data remaining in  the 
  572.           program.
  573.  
  574. NUMBER              MESSAGE
  575.  
  576. 5         Illegal function call
  577.           A  parameter  that is out of range is passed to  a 
  578.           math  or  string function.  An FC error  may  also 
  579.           occur as the result of:
  580.  
  581.           1.   a negative or unreasonably large subscript
  582.           2.   a negative or zero argument with LOG
  583.           3.   a negative argument to SQR
  584.           4.   a   negative  mantissa  with  a   non-integer 
  585.                exponent
  586.           5.   a  call  to  a USR  function  for  which  the 
  587.                starting address has not yet been given
  588.           6.   an  improper  argument to  ASC,  CHR$,  MID$, 
  589.                LEFT$,  RIGHT$,  INP,  OUT, WAIT, PEEK, POKE, 
  590.                TAB,   SPC,   STRING$,   SPACE$,   INSTR,  or 
  591.                ON...GOTO
  592.           7.   a  string concatenation that is  longer  than 
  593.                255 characters
  594.  
  595. NUMBER              MESSAGE
  596. 6         Floating overflow or integer overflow
  597.           The  result  of a calculation is too large  to  be 
  598.           represented   in  BASIC-80's  number  format.   If 
  599.           underflow occurs, the result is zero and execution 
  600.           continues without an error.
  601. 9         Subscript out of range
  602.           An  array element is referenced with  a  subscript 
  603.           that is outside the dimensions of the array.
  604. 11        Division by zero
  605.           A   division   by  zero  is  encountered   in   an 
  606.           expression, or the operation of involution results 
  607.           in zero being raised to a negative power.  Machine 
  608.           infinity   with  the  sign  of  the  numerator  is 
  609.           supplied  as  the  result  of  the  division,   or 
  610.           positive  machine  infinity  is  supplied  as  the 
  611.           result of the involution, and execution continues.
  612. 14        Out of string space
  613.           String  variables exceed the allocated  amount  of 
  614.           string space.
  615.  
  616. NUMBER              MESSAGE
  617. 20        RESUME without error
  618.           A  RESUME statement is encountered before an error 
  619.           trapping routine is entered.
  620. 21        Unprintable error
  621.           An  error message is not available for  the  error 
  622.           condition which exists.  This is usually caused by 
  623.           an ERROR with an undefined error code.
  624. 50        Field overflow
  625.           A  FIELD statement is attempting to allocate  more 
  626.           bytes than were specified for the record length of 
  627.           a random file.
  628. 51        Internal error
  629.           An  internal  malfunction  has  occurred  in  Disk 
  630.           BASIC-80. Report to Microsoft the conditions under 
  631.           which the message appeared.
  632. 52        Bad file number
  633.           A  statement  or command references a file with  a 
  634.           file  number  that is not OPEN or is  out  of  the 
  635.           range of file numbers specified at initialization.
  636.  
  637. NUMBER              MESSAGE
  638. 53        File not found
  639.           A RUN, CHAIN, KILL, or OPEN statement references a 
  640.           file that does not exist on the current disk.
  641. 54        Bad file mode
  642.           An attempt is made to use PUT,  GET, or LOF with a 
  643.           sequential  or to execute an OPEN with a file mode 
  644.           other than I, O, R, D.
  645. 55        File already open
  646.           A sequential output mode OPEN is issued for a file 
  647.           that  is already open;  or a KILL is given  for  a 
  648.           file that is open.
  649. 57        Disk I/O error
  650.           An I/O error occurred on a disk I/O operation.  It 
  651.           is a fatal error, i.e., theoperating system cannot 
  652.           recover from the error.
  653. 58        File already exists
  654.           The  filename specified is identical to a filename 
  655.           already in use on the disk.
  656. 61        Disk Full
  657.           All disk storage space is in use.
  658.  
  659. NUMBER              MESSAGE
  660. 62        Input past end
  661.           An INPUT statement is executed after all the  data 
  662.           in the file has been INPUT,  or for a null (empty) 
  663.           file. To avoid this error, use the EOF function to 
  664.           detect the end of file.
  665. 63        Bad record number
  666.           In  a PUT or GET statement,  the record number  is 
  667.           either greater than the maximum allowed (32767) or 
  668.           equal to zero.
  669. 64        Bad file name
  670.           An illegal form is used for the filename with RUN, 
  671.           CHAIN,  KILL,  or OPEN (e.g.,  a filename with too 
  672.           many characters).
  673. 67        Too  many  files
  674.           An  attempt  is made to create a new  file  (using 
  675.           OPEN) when the directory is full.
  676. ::M80.HQP
  677. 
  678.  
  679.  
  680.  
  681.  
  682.  
  683.  
  684.  
  685.  
  686.  
  687.  
  688.  
  689.  
  690. d file is .COM, 
  691. and this file is called a "command file". Once saved