home *** CD-ROM | disk | FTP | other *** search
/ Boston 2 / boston-2.iso / DOS / PROGRAM / BASIC / ASIC300 / ASIC.DOC next >
Text File  |  1993-12-01  |  246KB  |  8,317 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.        +--------------------------------------------------------------------+
  7.        |                                                                    |
  8.        |                           A S I C   3.00                           |
  9.        |                                                                    |
  10.        |                         "Its Almost Basic"                         |
  11.        |                                                                    |
  12.        |                                                                    |
  13.        |                          Copyright 1991                            |
  14.        |                                by                                  |
  15.        |                           David A. Visti                           |
  16.        |                                                                    |
  17.        |                         All Rights Reserved                        |
  18.        +--------------------------------------------------------------------+
  19.        |  ASIC 3.00 is provided as shareware.  Under the shareware concept, |
  20.        |  you can test a program before you buy it. If you find it suitable |
  21.        |  for your needs and make use of this program, you are expected to  |
  22.        |  send a $10 registration fee.                                      |
  23.        |                                                                    |
  24.        |  Feel free to distribute this software to others.  However, you    |
  25.        |  may not charge for the distribution of this software to others    |
  26.        |  nor may you alter the software or this documentation.             |
  27.        |                                                                    |
  28.        |  Registered users of any version of ASIC will receive a diskette   |
  29.        |  containing the current version of ASIC, plus may purchase future  |
  30.        |  updates at half of the normal registration price.  A printed      |
  31.        |  manual is available to registered users for an additional $10.00. |
  32.        |                                                                    |
  33.        |  For further ordering information, please see the file ORDER.FRM,  |
  34.        |  included with ASIC.                                               |
  35.        +--------------------------------------------------------------------+
  36.        |                                                                    |
  37.        |     Please send registration fees and suggestions to:              |
  38.        |                                                                    |
  39.        |                        David Visti                                 |
  40.        |                        P.O. Box 2952                               |
  41.        |                        Raleigh, NC  27602-2952                     |
  42.        |                                                                    |
  43.        |     Please mention the version of ASIC in any correspondence       |
  44.        |                     (This is ASIC Version 3.00)                    |
  45.        +--------------------------------------------------------------------+
  46.        |    I can also be reached for questions/comments on GEnie and       |
  47.        |    Compuserve via EMAIL:                                           |
  48.        |                                                                    |
  49.        |         Compuserve      73065,1302                                 |
  50.        |         GEnie           D.VISTI                                    |
  51.        |                                                                    |
  52.        +--------------------------------------------------------------------+
  53.        |                                                                    |
  54.        |  DISCLAIMER:  This software is provided "as is" without warranty   |
  55.        |  of any kind.  In no event shall I be held liable for any damages  |
  56.        |  whatsoever arising from the use of or inability to use this       |
  57.        |  product.                                                          |
  58.        |                                                                    |
  59.        |  Your registration fee entitles you to use this software on a      |
  60.        |  single computer.  Site licenses are available, write for details. |
  61.        +--------------------------------------------------------------------+
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.                                        A S I C
  74.                                   Table of Contents
  75.  
  76.          Chapter  Title
  77.  
  78.             1.    Getting Started                               Page   3
  79.             2.    Tutorial                                      Page   5
  80.             3.    Integrated Editor/Compiler Environment        Page  11
  81.             4     Using the Debugger                            Page  22
  82.             5.    Stand-alone Compiler Options                  Page  30
  83.             6.    Language Elements                             Page  33
  84.             7.    Keyword Reference                             Page  39
  85.                       ABS                      Page  39
  86.                       ASC                      Page  39
  87.                       BEEP                     Page  40
  88.                       BLOAD                    Page  41
  89.                       BSAVE                    Page  42
  90.                       CALL                     Page  43
  91.                       CHDIR                    Page  44
  92.                       CHR$                     Page  45
  93.                       CLOSE                    Page  45
  94.                       CLS                      Page  46
  95.                       CODE                     Page  46
  96.                       COLOR                    Page  47
  97.                       COMMAND$                 Page  48
  98.                       COMSTAT                  Page  49
  99.                       CSRLIN                   Page  50
  100.                       DATA                     Page  51
  101.                       DATE$                    Page  52
  102.                       DEFSEG                   Page  52
  103.                       DIM                      Page  53
  104.                       END                      Page  53
  105.                       ENVIRON$                 Page  54
  106.                       FILEPOS                  Page  55
  107.                       FIND                     Page  57
  108.                       FOR/NEXT                 Page  59
  109.                       GETDIR                   Page  60
  110.                       GOSUB                    Page  61
  111.                       GOTO                     Page  61
  112.                       IF/THEN/ELSE/ENDIF       Page  62
  113.                       INKEY$                   Page  64
  114.                       INP                      Page  64
  115.                       INPUT                    Page  65
  116.                       INPUT#                   Page  66
  117.                       INSTR                    Page  68
  118.                       INT86                    Page  69
  119.                       KILL                     Page  71
  120.                       LCASE$                   Page  71
  121.                       LEFT$                    Page  72
  122.                       LEN                      Page  72
  123.                       LOCATE                   Page  73
  124.                       LPRINT                   Page  73
  125.                       LTRIM$                   Page  74
  126.                       MID$                     Page  74
  127.                       MKDIR                    Page  75
  128.  
  129.  
  130.  
  131.                                        Page - 1
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.                             Table of Contents (Continued)
  139.  
  140.          Chapter  Title
  141.  
  142.             7.    Keyword Reference (Continued)
  143.  
  144.                       MOD                      Page  75
  145.                       NAME                     Page  76
  146.                       OPEN                     Page  76
  147.                       OPENCOM                  Page  77
  148.                       OUT                      Page  78
  149.                       PEEK                     Page  78
  150.                       POINT                    Page  79
  151.                       POKE                     Page  80
  152.                       POS                      Page  80
  153.                       PRESET                   Page  81
  154.                       PRINT                    Page  81
  155.                       PRINT#                   Page  82
  156.                       PSET                     Page  84
  157.                       RANDOMIZE                Page  84
  158.                       READ                     Page  85
  159.                       RECEIVE                  Page  86
  160.                       REM                      Page  87
  161.                       RESTORE                  Page  87
  162.                       RETURN                   Page  88
  163.                       RIGHT$                   Page  88
  164.                       RMDIR                    Page  89
  165.                       RND                      Page  90
  166.                       RTRIM$                   Page  91
  167.                       RUN                      Page  92
  168.                       SCREEN                   Page  93
  169.                       SEND                     Page  94
  170.                       SOUND                    Page  94
  171.                       SPACE$                   Page  95
  172.                       STR$                     Page  95
  173.                       STRING$                  Page  96
  174.                       TIME$                    Page  97
  175.                       TIMER                    Page  98
  176.                       UCASE$                   Page  99
  177.                       VAL                      Page  99
  178.                       VARPTR                   Page 100
  179.                       WHILE/WEND               Page 100
  180.                       WIDTH                    Page 101
  181.                       ZBIT                     Page 101
  182.                       ZMODE                    Page 102
  183.             8.    Compatibility with BASICA/GWBASIC             Page 103
  184.             9.    Technical Details/Tips                        Page 106
  185.             10.   Error Messages                                Page 111
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196.  
  197.                                        Page - 2
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205.  
  206.  
  207.                                        A S I C
  208.  
  209.                                       Chapter 1
  210.  
  211.                                    Getting Started
  212.  
  213.  
  214.  
  215.                                      INTRODUCTION
  216.  
  217.             Welcome to ASIC!
  218.  
  219.             ASIC is a "BASIC" programming language compiler for IBM PCs and
  220.        compatibles.  It includes an integrated full screen editor, from which
  221.        you can edit, compile, and debug your programs.  Or at your option, you
  222.        can use your own text editor, and compile your programs from the MS DOS
  223.        command line.
  224.  
  225.             ASIC is a subset of BASICA and GWBASIC which supports over 80 BASIC
  226.        statements, integer and string variables, and integer arrays.  It will
  227.        compile your programs at high speed, and the code it generates is fast
  228.        and compact.  The syntax of each ASIC statement is generally a valid
  229.        subset of the syntax used by BASICA and GWBASIC (exceptions are noted in
  230.        Chapter 8.)
  231.  
  232.  
  233.             All you need to get started is:
  234.  
  235.                  1)  ASIC
  236.                  2)  IBM PC or 100% Compatible
  237.                  3)  305-405k Available Memory*
  238.                  4)  Two floppy disk drives
  239.                           <or>
  240.                      One hard disk drive and one floppy disk drive
  241.  
  242.             The first step is to install ASIC as described below.  Then,
  243.        proceed to Chapter 2 for a brief ASIC tutorial.  Following that you can
  244.        read the remainder of the documentation straight through, or refer to it
  245.        as you need it.  Have Fun!
  246.  
  247.  
  248.             *  The ASIC Compiler will run in 305k of memory. The ASIC Editor
  249.                will run in less than 200k of memory, however, to compile and
  250.                debug within the editor, 405k of available memory is required.
  251.                If ASIC does not find sufficient memory to call the compiler
  252.                from within the editor, it will ignore the compile
  253.                request and return to the editor.
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.  
  262.  
  263.                                        Page - 3
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.                                      INSTALLATION
  271.  
  272.  
  273.          To install ASIC execute the following commands as appropriate for your
  274.        machine.  The procedure to do so is provided below for both floppy
  275.        systems and hard disk based systems.  Also refer to the README file on
  276.        your ASIC Diskette for additional information.
  277.  
  278.  
  279.        TWO-FLOPPY DISK SYSTEM INSTALLATION
  280.  
  281.        1)  Make sure that the following files are all on the same diskette (the
  282.        diskette that contains these files will be referred to in this manual as
  283.        the "Compiler" diskette):
  284.  
  285.                  ASIC.EXE
  286.                  ASICC.EXE
  287.                  ASIC.IDX       (Optional)
  288.                  ASICM.IDX      (Optional)
  289.                  ASIC.DOC       (Optional)
  290.  
  291.  
  292.             (Note:  The optional files are required if you wish to use the
  293.              extended online help feature).
  294.  
  295.  
  296.        2)  Format one or more blank diskettes to hold your programs (these
  297.        diskettes will be referred to in this manual as your "Program"
  298.        diskettes):
  299.  
  300.                  Note:  Whenever you see the symbol     <enter>    in this
  301.                         document, this refers to the <enter> or <return> key
  302.                         on your keyboard.
  303.  
  304.  
  305.        HARD DISK SYSTEM INSTALLATION
  306.  
  307.        1)  Type:   C: <enter>
  308.        2)  Type:   MD C:\ASIC <enter>
  309.        3)  The next step is to copy the ASIC software to the ASIC directory.
  310.  
  311.            If your ASIC software is on a floppy, insert the floppy in Drive
  312.            A: then type the command:
  313.  
  314.                   COPY A:*.* C:\ASIC <enter>
  315.  
  316.            If your ASIC software is already on a hard disk directory, copy
  317.            it to the ASIC directory with the command:
  318.  
  319.                   COPY C:\directoryname\*.* C:\ASIC <enter>
  320.  
  321.             Note that ASIC will run from any subdirectory, however, the
  322.             tutorial assumes ASIC is under C:\ASIC
  323.  
  324.                  Note:  Whenever you see the symbol     <enter>    in this
  325.                         document, this refers to the <enter> or <return> key
  326.                         on your keyboard.
  327.  
  328.  
  329.                                        Page - 4
  330.  
  331.  
  332.  
  333.  
  334.  
  335.  
  336.  
  337.  
  338.  
  339.                                        A S I C
  340.  
  341.                                       Chapter 2
  342.  
  343.                                        Tutorial
  344.  
  345.  
  346.        ASIC programs look very much like regular "BASIC" programs which you are
  347.        probably already familiar with.  The one very noticeable difference is
  348.        that ASIC programs have no line numbers.  Let's take a look at a very
  349.        simple program written both in GWBASIC/BASICA and in ASIC:
  350.  
  351.             GWBASIC/BASICA                          ASIC
  352.             --------------------------+----------------------------------
  353.                                       |
  354.             10  I=I+1                 |   ADDONE: I=I+1
  355.             20  PRINT I               |           PRINT I
  356.             30  IF I<100 THEN 10      |           IF I<100 THEN ADDONE:
  357.             --------------------------+----------------------------------
  358.  
  359.             Both of these programs do the same thing.  They display the numbers
  360.        from 1 to 100.  However, notice that ASIC allows you to use descriptive
  361.        labels (ADDONE) instead of a line number (10).  These labels can be up
  362.        to 80 characters long!  Also note that the ASIC  "PRINT" and "IF"
  363.        statements were indented only for increased program readability.  The
  364.        ASIC program could just as well have been written as:
  365.  
  366.                                          ASIC
  367.                             ------------------------------
  368.                             ADDONE:I=I+1
  369.                             PRINT I
  370.                             IF I<100 THEN ADDONE:
  371.                             ------------------------------
  372.  
  373.             We could have made our variable names longer.  Instead of "I" we
  374.        could have chosen "SECONDS" or "VELOCITY", or some other name up to 80
  375.        characters in total.  In ASIC, variable names, labels, and string
  376.        constants can all be up to 80 characters in length.
  377.  
  378.             Well, now that we've seen a basic ASIC program, let's try to enter
  379.        and run a slightly larger program.  The program we will be working with
  380.        will print the message "HELLO yourname" in 256 color combinations.  If
  381.        you have a monochrome display card, don't worry, the program will work,
  382.        but instead of seeing different colors you'll see characters with
  383.        different attributes, such as blinking, underlined, etc.
  384.  
  385.             Let's get started.  If you haven't done so already, install ASIC as
  386.        described in Chapter 1.  Now then, writing an ASIC program involves
  387.        these three steps.
  388.  
  389.             1.  Write your program.
  390.             2.  Compile your program.
  391.             3.  Run/Test your Program.
  392.  
  393.  
  394.  
  395.                                        Page - 5
  396.  
  397.  
  398.  
  399.  
  400.  
  401.  
  402.             These three steps can all be performed from within the ASIC
  403.        Integrated Environment.  Before we proceed with our "Hello yourname"
  404.        Program, let's go over some conventions.
  405.  
  406.  
  407.             In the following section:
  408.  
  409.             FLOPPY TYPE-->       Means that only 2-floppy disk system users
  410.                                  should type this line.
  411.  
  412.             HARD TYPE-->         Means that only hard disk system users
  413.                                  should type this line.
  414.  
  415.             TYPE-->              Means that both floppy and hard disk users
  416.                                  should type this line.
  417.  
  418.             X>                   This is a representation of the prompt from
  419.                                  PC-DOS or MS-DOS.  Floppy Disk Users will
  420.                                  actually see "A>" for a prompt.  Hard Disk
  421.                                  Users will see "C>" for a prompt.
  422.  
  423.             <enter>              Means that you should press the <enter>
  424.                                  or <return> key on your keyboard.
  425.  
  426.             <?>                  Text enclosed between the "<" and the ">"
  427.                                  symbols indicate a key to type.  Don't type
  428.                                  the "<" or ">" symbols.  For example, if the
  429.                                  tutorial lists "<F1>", your should press the
  430.                                  "F1" key on your keyboard.
  431.  
  432.        NOTE:  Floppy Disk users need to insert their ASIC Compiler diskette in
  433.        Drive A: at this point, and a Program diskette in Drive B:  (See the
  434.        Installation section for more information)
  435.  
  436.  
  437.        Let's begin:
  438.  
  439.  
  440.             FLOPPY TYPE-->      A: <enter>
  441.             HARD TYPE-->        CD C:\ASIC <enter>
  442.  
  443.        The computer should respond:
  444.  
  445.                                 X>
  446.  
  447.        Now enter the command to invoke ASIC:
  448.  
  449.             TYPE-->             ASIC <enter>
  450.  
  451.        You are now in ASIC.  The top line is the Menu Bar.  The bottom line is
  452.        the Status Line.  Chapter 3 describes this in more detail.  For now,
  453.        we'll just describe a couple of features on these lines.
  454.  
  455.        The status line indicates that the current mode is "INSERT".  This means
  456.        that any characters you type on a line will be inserted between the
  457.        existing characters.  If you press the <INS> key on the keypad, ASIC
  458.        will toggle to its other mode, OVERSTRIKE.  In this mode, when you type
  459.  
  460.  
  461.                                        Page - 6
  462.  
  463.  
  464.  
  465.  
  466.  
  467.  
  468.        a character, it overlays the character that was there before.  Each time
  469.        you press the <INS> key, ASIC will toggle between the INSERT and
  470.        OVERSTRIKE modes.
  471.  
  472.        You can open the menus listed on the "Menu Bar" by holding down the ALT
  473.        key while typing the Capitalized letter of the menu you wish to open.
  474.        For example, to open the File menu, press <ALT><F>.  Try it now:
  475.  
  476.             TYPE-->    <Alt><F>
  477.  
  478.        The "File" menu will pop open.  You can select a menu option from that
  479.        menu by typing the capitalized letter of the option, or by using the
  480.        arrow keys on your keypad to highlight the option you want and then
  481.        pressing <enter>.
  482.  
  483.        If you are not sure what the menu option will do, you can press <F1> and
  484.        ASIC will display some help information for the highlighted menu option.
  485.        When you opened the File menu, the first option on that menu, "Open" was
  486.        highlighted.  Let's get some help on "Open":
  487.  
  488.             TYPE-->    <F1>
  489.  
  490.        ASIC will display some help information on "Open".  Let's close the help
  491.        window now:
  492.  
  493.             TYPE-->    <ESC>
  494.  
  495.        The help window will close.  The <ESC> key will always let you escape
  496.        from any menu or help screen in ASIC, without taking any action. Let's
  497.        also close the file menu for now:
  498.  
  499.             TYPE-->    <ESC>
  500.  
  501.        The "File" menu should have closed.  By the way, in addition to the menu
  502.        help, ASIC provides additional online help.  If you need general ASIC
  503.        help, press the <F1> key for a quick summary of some of ASIC's features:
  504.  
  505.             TYPE-->    <F1>
  506.  
  507.        ASIC will display some general help.  From this screen, we can also
  508.        retrieve additional information about BASIC statements such as PRINT or
  509.        GOSUB.  Let's bring up an index of these statements.
  510.  
  511.             TYPE-->    <F1>
  512.  
  513.        ASIC has opened a help index screen.  From this screen we can use the
  514.        arrow keys to highlight any ASIC keyword and obtain more information for
  515.        that keyword by then pressing enter.  We won't do that now, but don't
  516.        forget that this screen is available. Chapter 3 of the ASIC Reference
  517.        Manual describes all of the online "HELP" features available in ASIC and
  518.        provides a full description of the ASIC Editor Commands which are
  519.        available.  Exit the help menu:
  520.  
  521.             TYPE-->    <ESC>
  522.  
  523.  
  524.  
  525.  
  526.  
  527.                                        Page - 7
  528.  
  529.  
  530.  
  531.  
  532.  
  533.  
  534.        Entering a program in ASIC is simplicity itself.  We'll simply type in
  535.        each line, pressing <enter> at the end of each line.  If you make a
  536.        typing mistake, just use the arrow keys to move to the error, and type
  537.        in the correction.  Use the <DEL> or <Backspace> keys to delete any
  538.        unwanted characters from the screen.
  539.  
  540.        Make sure the status line says "Mode: Insert".  This is the default mode
  541.        in ASIC.  If it doesn't, press the <INS> key until it does.  Now let's
  542.        enter our program (the program below intentionally contains an invalid
  543.        ASIC statement.  We'll correct the line later in the tutorial, for now,
  544.        type in the program exactly as it's listed below):
  545.  
  546.             TYPE-->        CLS  <enter>
  547.             TYPE-->        PRINT "Please enter your name"; <enter>
  548.             TYPE-->        INPUT YOURNAME$  <enter>
  549.             TYPE-->        FOR I=1 TO 16  <enter>
  550.             TYPE-->            FOR J=1 TO 16  <enter>
  551.             TYPE-->                COLOR I,J <enter>
  552.             TYPE-->                PRINT "HELLO "; <enter>
  553.             TYPE-->                PRINT YOURNAME$; <enter>
  554.             TYPE-->            NEXT J <enter>
  555.             TYPE-->        NEXT I <enter>
  556.             TYPE-->        CLS <enter>
  557.             TYPE-->        THE END <enter>
  558.  
  559.        There, that was easy.  Now, let's compile our program.  To do it, we'll
  560.        open the "Compile" menu, and select the "Compile program" option:
  561.  
  562.             TYPE-->       <ALT><C>
  563.  
  564.        The "Compile" menu will pop open.  The first option, "Compile program"
  565.        can be selected by typing the option letter which is capitalized "C", or
  566.        by moving the highlight bar to this option and pressing the <enter> key.
  567.        Since the highlight bar is already on this option, let's just press
  568.        <enter>:
  569.  
  570.             TYPE-->       <enter>
  571.  
  572.        Since we didn't specify a file name when we invoked ASIC, ASIC will now
  573.        ask for a file name (so it can save your program before calling the
  574.        compiler):
  575.  
  576.             FLOPPY TYPE-->      B:TUTOR.ASI  <enter>
  577.             HARD TYPE-->        TUTOR.ASI <enter>
  578.  
  579.        Note that ASIC requires that your programs be stored in files ending
  580.        with the extension ".ASI".  Had we entered "TUTOR" for our program name,
  581.        ASIC would have appended the letters ".ASI" for us.  If we tried to
  582.        provide a different extension, such as "TUTOR.SRC", ASIC would display
  583.        an error message.  Also, whenever you are presented a dialog box where
  584.        you are asked to enter text (such as file name, or Yes/No responses to
  585.        questions), you must press the <enter> key before ASIC will accept the
  586.        input.
  587.  
  588.        Once you select the "Compile program" option, you'll see the ASIC
  589.        compiler screen appear.  It will display a count of the lines compiled,
  590.        and when it is done, it will return to the ASIC editor.
  591.  
  592.  
  593.                                        Page - 8
  594.  
  595.  
  596.  
  597.  
  598.  
  599.  
  600.  
  601.        If it detected any errors, it will display the first error message at
  602.        the bottom of the editor screen.  It will also highlight the line in
  603.        your program which is in error.  In this case the line "THE END" was
  604.        flagged with the error message "Syntax Error".  Of course, that line
  605.        should have been entered simply as "END".
  606.  
  607.        That should be easy enough to fix.  Let's exit the error menu by
  608.        pressing the <ESC> key:
  609.  
  610.             TYPE-->      <ESC>
  611.  
  612.        The error menu has disappeared, and our cursor is now on the erroneous
  613.        line.  To fix the line:
  614.  
  615.             TYPE-->      <DEL><DEL><DEL><DEL>
  616.  
  617.        That should do it.  The last line of our program should now read "END".
  618.        Before we continue, let's assume we new the name of the END command, but
  619.        could not remember the proper syntax for it.  ASIC provides an online
  620.        lookup for each ASIC statement.  With the cursor positioned somewhere on
  621.        the word "END":
  622.  
  623.             TYPE-->      <Ctl><F1>
  624.  
  625.        ASIC should have opened a help window describing the "END" statement.
  626.        To return to your program press the <ESC> key.
  627.  
  628.             TYPE-->      <ESC>
  629.  
  630.        The help window should have disappeared and you should see your program
  631.        displayed again.  Let's recompile the program:
  632.  
  633.             TYPE-->      <ALT><C>
  634.             TYPE-->      <enter>
  635.  
  636.        This time you should see the message "No Compiler Errors". If you
  637.        didn't, check your spelling and recompile the program until you receive
  638.        this message.  Press <ESC> to remove the "No Compiler Errors" Window.
  639.  
  640.        Now let's run the program.  To do so, we'll open the "Run" menu, and
  641.        select the "Run your program" option.
  642.  
  643.             TYPE-->      <ALT><R>
  644.             TYPE-->      <r>
  645.  
  646.        This time, we just entered the capitalized letter from the menu option
  647.        "Run your program".  Your computer screen should now prompt you to
  648.        "Please enter your name?".  Go ahead and enter your name now:
  649.  
  650.             TYPE-->      yourname  <enter>
  651.  
  652.        You should see "HELLO yourname" printed in various color combinations,
  653.        and then the ASIC editor screen will reappear.  Well, that's all there
  654.        is to writing, compiling, and running an ASIC program.  Now, to exit
  655.        ASIC, open the "File" menu and select the "eXit" option.
  656.  
  657.  
  658.  
  659.                                        Page - 9
  660.  
  661.  
  662.  
  663.  
  664.  
  665.  
  666.             TYPE-->      <ALT><F>
  667.             TYPE-->      <X>
  668.  
  669.        You should see your MS DOS prompt once again.  By the way, now that
  670.        you've successfully compiled the program, you can execute it directly
  671.        from MS DOS.  Let's try it:
  672.  
  673.             HARD TYPE-->     TUTOR <enter>
  674.             FLOPPY TYPE-->   B:TUTOR <enter>
  675.  
  676.        Well, that's a brief introduction to ASIC!  Next, you might want to read
  677.        Chapter 3, "Integrated Editor/Compiler Environment" to learn about the
  678.        many other features available in the ASIC editor.  Following this you
  679.        should read Chapter 4 which explains how to use the ASIC Debugger.
  680.        Chapter 4 includes another short tutorial in which you debug a program.
  681.  
  682.             The remaining chapters provide reference material which you can
  683.        either read, or just refer to as needed.  Chapter 5 explains how to
  684.        compile programs directly from the command line of DOS.  Chapters 6-8
  685.        describe the BASIC statements which are supported by ASIC.  Chapter 10
  686.        provides more descriptive information for ASIC error messages.
  687.  
  688.        Hope you enjoy programming in ASIC!
  689.  
  690.  
  691.  
  692.  
  693.  
  694.  
  695.  
  696.  
  697.  
  698.  
  699.  
  700.  
  701.  
  702.  
  703.  
  704.  
  705.  
  706.  
  707.  
  708.  
  709.  
  710.  
  711.  
  712.  
  713.  
  714.  
  715.  
  716.  
  717.  
  718.  
  719.  
  720.  
  721.  
  722.  
  723.  
  724.  
  725.                                       Page - 10
  726.  
  727.  
  728.  
  729.  
  730.  
  731.  
  732.  
  733.  
  734.  
  735.                                        A S I C
  736.  
  737.                                       Chapter 3
  738.  
  739.                               Integrated Editor/Compiler
  740.                                      Environment
  741.  
  742.  
  743.                                      INTRODUCTION
  744.  
  745.             The ASIC integrated environment lets you edit, save, compile, and
  746.        debug your ASIC programs without ever leaving ASIC!  This chapter will
  747.        explain the usage of the integrated environment.
  748.  
  749.  
  750.                                  ASIC SCREEN CONTENTS
  751.  
  752.             ASIC divides the screen into three parts.  The top line is called
  753.        the "Menu Bar".  All of the menus available to you are listed on this
  754.        line.  The bottom line is called the "Status Line".  It continuously
  755.        displays some important program information.  The middle 23 lines are
  756.        the "Edit Window".  This is the section of the screen where you can make
  757.        changes or additions to your program.
  758.  
  759.                                  MENU BAR PROCESSING
  760.  
  761.        Currently, there are four menus available.  The "File" menu allows you
  762.        to load/save your existing program files to/from disk.  It is also used
  763.        to exit ASIC.  The "Edit" menu contains various editing commands which
  764.        are available.  The "Compile" menu is used to compile your program, set
  765.        compiler options, and to view compiler errors.  The "Run" menu allows
  766.        you to run your programs, and test them using the ASIC debugger.
  767.  
  768.             To open a menu, hold down the <ALT> key and type the first letter
  769.        of the menu.  The menu will pop down and display the options available
  770.        on that menu.  If you want to close the menu without taking any action,
  771.        press the <ESC> key.  If you wish to open a different menu without first
  772.        closing the current menu, press the left or right arrow keys.
  773.  
  774.             Otherwise, to select an option, type the capitalized letter of the
  775.        menu option.  For example, on the "File" menu, to select the "eXit"
  776.        option, type an "X" or an "x".  Another way to select an option is to
  777.        move the "Highlighted Bar" down to the option you wish to select, and
  778.        press the <enter> key.
  779.  
  780.             Some functions may be accessed outside of the menus with function
  781.        keys.  These are listed on the menus (eg. "search Again <F3>" on the
  782.        Edit Menu), however, these function keys do not operate when a menu is
  783.        open.  (A list of these Function keys is presented later in this chapter
  784.        in the Keyboard Usage Section).
  785.  
  786.  
  787.  
  788.  
  789.  
  790.  
  791.                                       Page - 11
  792.  
  793.  
  794.  
  795.  
  796.  
  797.  
  798.                                      GETTING HELP
  799.  
  800.  
  801.        ASIC provides "online" help within the integregated environment to
  802.        assist you with keyboard usage, menu options, and ASIC keywords.  This
  803.        section tells you how to access this online help.
  804.  
  805.        General Help
  806.  
  807.        General describes the usage of the keyboard in ASIC.  Keyboard keys
  808.        which perform ASIC functions are described in this section.  Access
  809.        general help by pressing Function key <F1>.  Pressing <F1> a second time
  810.        will display an ASIC keyword index.  You can get additional help on
  811.        individual ASIC keywords from this screen.  This information includes a
  812.        description of what the keyword does, and the keyword syntax.
  813.  
  814.        Menu Help
  815.  
  816.        If you open a menu, but you are not sure what a certain menu option
  817.        does, you may display a description of the highlighted menu option by
  818.        pressing the <F1> key.  Doing so will open a help window which describes
  819.        the menu option.  Press <ESC> to exit the help screen and return to the
  820.        menu.
  821.  
  822.        Keyword Help
  823.  
  824.        Can't remember the syntax for a particular ASIC keyword?  Well, help is
  825.        just a keystroke away.  Position the cursor on the keyword in the edit
  826.        buffer.  Then, hold down the <Ctl> key and press the <F1> key.
  827.        ASIC will display a description of the keyword, and describe proper
  828.        syntax for that keyword.  For example, if you tried to compile a
  829.        program, but received a syntax error on the keyword "PRINT" in your
  830.        program, you could obtain help on the "PRINT" statement by using the
  831.        arrow keys to position the cursor anywhere on the word "PRINT" and then
  832.        pressing <Ctl-F1>.  If ASIC cannot find the keyword (eg, say the cursor
  833.        was positioned on a variable called "APPLES", which is not an ASIC
  834.        keyword), then ASIC will display a list of valid keywords.  Use the
  835.        cursor keys to highlight one of these keywords and press <enter> to
  836.        retrieve help for the highlighted keyword.  You may also access this
  837.        keyword help list by pressing the <F1> key twice from within the editor.
  838.  
  839.             Now let's describe the options available on each menu.
  840.  
  841.  
  842.                                       FILE MENU
  843.  
  844.        "Open" Option
  845.  
  846.             This option allows you to open an existing ASIC file and load it
  847.        into the ASIC edit buffer where you can modify it.  If you select this
  848.        option another window will open to ask you the file name.  If you don't
  849.        wish to open a file, you can press <ESC> to close the menu without
  850.        taking any action.  Otherwise, enter an ASIC file name, and press the
  851.        <enter> key.
  852.  
  853.  
  854.  
  855.  
  856.  
  857.                                       Page - 12
  858.  
  859.  
  860.  
  861.  
  862.  
  863.  
  864.                                 FILE MENU (Continued)
  865.  
  866.        "Save" Option
  867.  
  868.             This option allows you to write the changes you've made to your
  869.        program back to the file.  Changes you enter in the ASIC editor are made
  870.        to memory only.  You must select this option before your changes will
  871.        become permanent.  Note:  Your file is saved to disk automatically
  872.        whenever you compile it or run it, if the file modified indicator is
  873.        set.
  874.  
  875.        "save As" Option
  876.  
  877.             This option will allow you to write the changes you've made to the
  878.        program in the edit buffer to a new file.  You will be prompted to
  879.        provide ASIC with a new file name.
  880.  
  881.        "eXit" Option
  882.  
  883.             This option will allow you to exit from ASIC back to MS DOS.  ASIC
  884.        will ask you if you wish to save your file before you exit.
  885.  
  886.  
  887.                                       EDIT MENU
  888.  
  889.        "Begin block" Option
  890.  
  891.             This option will allow you to mark the beginning of a block of text
  892.        for use with the block delete, copy, and move commands.  To mark a block
  893.        of text, move the cursor to the first line of the block, and then select
  894.        this option.  The beginning line of the block will be highlighted on the
  895.        screen.  Next, move the cursor to the ending line of the block, and
  896.        select the "End block" option from this menu.  All of the lines in the
  897.        block will be highlighted.  This block of lines can now be "moved",
  898.        "copied", or "deleted" using the block commands.
  899.  
  900.        "End block" Option
  901.  
  902.             This option will allow you to mark the end of a block of text.
  903.        Refer to the "Begin block" Option for more information.
  904.  
  905.        "Search" Option
  906.  
  907.             This option allows you to locate a string of characters in the edit
  908.        buffer.  When you select this option, ASIC will ask you for a search
  909.        string which can be up to 30 characters in length.  ASIC will then
  910.        search forward from the current line until it finds the string or
  911.        reaches the end of the edit buffer.  If it finds the string, the cursor
  912.        will be placed on the line containing the string.
  913.  
  914.  
  915.  
  916.  
  917.  
  918.  
  919.  
  920.  
  921.  
  922.  
  923.                                       Page - 13
  924.  
  925.  
  926.  
  927.  
  928.  
  929.  
  930.                                 EDIT MENU (Continued)
  931.  
  932.        "Replace" Option
  933.  
  934.             This option will allow you to replace one or more occurrences of a
  935.        string of characters with another set of characters.  When you select
  936.        this option, ASIC will ask you for a search string which can be up to 30
  937.        characters in length.  ASIC will then ask you for the string of
  938.        characters which is to replace the search string.  Finally, ASIC will
  939.        ask you to specify how many occurrences of this search string are to be
  940.        replaced (from 1-9999).  ASIC will search forward from the current line,
  941.        and briefly display each line as it modifies it.  If it reaches the end
  942.        of the edit buffer before it has replaced the number of occurrences
  943.        you've specified, ASIC will display an "End of Buffer" message, and
  944.        stop.
  945.  
  946.        "Delete block" Option
  947.  
  948.             This option will delete a block of lines.  Refer to the "Begin
  949.        block" option for information on marking a block of lines.  If you
  950.        haven't marked a block of lines, selecting this option will have no
  951.        effect.
  952.  
  953.        "Move block" Option
  954.  
  955.             This option will move a block of lines to a new location in the
  956.        edit buffer.  Refer to the "Begin block" option for information on
  957.        marking a block of lines.  If you don't mark a block of lines, selecting
  958.        this option will have no effect.  Once you have marked a block of lines,
  959.        move the cursor to the location in the edit buffer where you want the
  960.        lines moved. Selecting the "Move block" option will result in the block
  961.        of lines being deleted from their current location, and moved to the
  962.        buffer at the line following the cursor.  ASIC will not overlay lines,
  963.        it will insert enough blank space to hold the relocated text.
  964.  
  965.        "Copy block" Option
  966.  
  967.             This option is the same as the "Move block" option, with one
  968.        exception.  After moving the block, ASIC does NOT delete the original
  969.        block of lines.  Use this option to clone a block of text.  Refer to the
  970.        "Begin block" option for information on marking a block of text.
  971.  
  972.        "search Again <F3>" Option
  973.  
  974.             This option will allow you to search for the next occurence of the
  975.        last string you searched for with the "Search" Option, without retyping
  976.        the previous search string.  This option may also be selected outside of
  977.        the Edit Menu by pressing function key <F3>.
  978.  
  979.  
  980.  
  981.  
  982.  
  983.  
  984.  
  985.  
  986.  
  987.  
  988.  
  989.                                       Page - 14
  990.  
  991.  
  992.  
  993.  
  994.  
  995.  
  996.                                      COMPILE MENU
  997.  
  998.        "Compile program <F10>" Option
  999.  
  1000.             Use this option to have ASIC compile the program which is currently
  1001.        loaded in the edit buffer.  If the compile is successful, ASIC will
  1002.        display the message "No Compiler Errors".  Otherwise, it will display
  1003.        the first error message (see "View compile errors" option).  ASIC will
  1004.        automatically save your program before calling the compiler.  This
  1005.        option may also be selected outside of the menu by pressing function key
  1006.        <F10>.
  1007.  
  1008.        "Full program listing" Option
  1009.  
  1010.             This menu option, and the next four options are used to toggle
  1011.        various compiler options on or off.  When the option is on, you will see
  1012.        a "check mark" symbol next to the option.  This compiler option will
  1013.        cause ASIC to display each source line as it compiles it.  This option
  1014.        will slow down the compile, but since ASIC also writes these lines to a
  1015.        listing file, this option can be used to create a compile listing.  The
  1016.        compile listing will be contained in a file called "progname.LST", where
  1017.        "progname" is the name of your program.
  1018.  
  1019.        "Printer output" Option
  1020.  
  1021.             This menu option will toggle the "Printer output" compiler option
  1022.        on or off.  When the option is on, you will see a "check mark" symbol
  1023.        next to the option name.  This compiler option will cause compiler
  1024.        messages to be printed on your printer.
  1025.  
  1026.        "Symbol table" Option
  1027.  
  1028.             This menu option will toggle the "Symbol table" compiler option on
  1029.        or off.  When the option is on, you will see a "check mark" symbol next
  1030.        to the option name.  This compiler option will cause ASIC to create a
  1031.        symbol table file called "progname.SYM", where "progname" is the name of
  1032.        your program.  The symbol table is a list of all variables, labels, and
  1033.        internally created compiler addresses.
  1034.  
  1035.        "Extended math" Option
  1036.  
  1037.             By default, ASIC will permit regular integer variables. These
  1038.        variables are very efficient and only require two bytes (or characters)
  1039.        of memory storage.  However, these integers can only hold numbers in the
  1040.        range of -32767 to +32767.  For many programs this is sufficient.
  1041.        However, there may be cases when you want to represent larger integer
  1042.        values.  Because of this, ASIC provides a "long" integer data type.  The
  1043.        long integer requires four bytes of memory storage.  However, it can
  1044.        hold a much larger range of numbers.  A long integer can store numbers
  1045.        in the range of -2,147,483,647 to +2,147,483,647.  When you need to use
  1046.        long integers in your program, you need to turn on this option, so that
  1047.        ASIC can generate the proper code.  If this option is not turned on and
  1048.        your program contains long integers, ASIC will generate a compiler
  1049.        error.  If this happens, just turn this option on, and re-compile your
  1050.        program.  To "create" a long integer variable or constant, simply append
  1051.        the "&" character to the variable name or constant value(eg, SAMPLEVAR&
  1052.        or 123456&).  For further information on using long integers, refer to
  1053.        Chapter 6, "Language Elements", of the ASIC Manual.
  1054.  
  1055.                                       Page - 15
  1056.  
  1057.  
  1058.  
  1059.  
  1060.  
  1061.  
  1062.                                COMPILE MENU (Continued)
  1063.  
  1064.        "Debugging code" Option
  1065.  
  1066.             This menu option will toggle the "Debugging code" compiler option
  1067.        on or off.  When the option is on, you will see a "check mark" symbol
  1068.        next to the option name.  This compiler option will cause ASIC to
  1069.        generate code required by the ASIC debugger to allow you to set
  1070.        breakpoints, single step through your program, and view/modify program
  1071.        variables.  This option is "on" by default in the integrated
  1072.        environment.  You should leave this option on while you are debugging
  1073.        your program.  When you have everything working properly, you should
  1074.        turn it "off" and recompile your program.  This will reduce the size of
  1075.        your program slightly, and will make it run faster (of course, you can't
  1076.        use the debugger with it, since there is no debugging information
  1077.        available to ASIC any more.  If you need to debug your program again,
  1078.        just recompile with the this option turned "on" again).
  1079.  
  1080.        "View compile errors" Option
  1081.  
  1082.             When you wish to examine the errors from a previous compile of your
  1083.        program, select this option.  If no errors exist, ASIC will so inform
  1084.        you.  Otherwise, ASIC will display the first error message at the bottom
  1085.        of the screen, and it will highlight the line of your program which
  1086.        corresponds to that error.  If you wish to correct the program line,
  1087.        press the <ESC> key.  The cursor will be positioned at the beginning of
  1088.        that program line.  You may also view subsequent compiler errors by
  1089.        pressing the <F10> key instead of the <ESC> key.
  1090.  
  1091.        "Write options to disk" Option
  1092.  
  1093.             Normally, when you set compiler options in the integrated
  1094.        environment, they "exist" only for your editing session (ie, when you
  1095.        leave the editor, ASIC resets the options to the defaults).  If you
  1096.        prefer, you may use this option to cause ASIC to write the current
  1097.        session's options to a configuration file (ASIC.CFG).  Then, when you
  1098.        invoke the ASIC integrated environment, it will first check for this
  1099.        configuration file.  If found, it will use your saved configuration.
  1100.        Otherwise, it will use the ASIC defaults.  This configuration file is
  1101.        not accessed by the command-line version of the compiler, so they only
  1102.        take affect when you are inside the integrated environment.
  1103.  
  1104.  
  1105.  
  1106.  
  1107.  
  1108.  
  1109.  
  1110.  
  1111.  
  1112.  
  1113.  
  1114.  
  1115.  
  1116.  
  1117.  
  1118.  
  1119.  
  1120.  
  1121.                                       Page - 16
  1122.  
  1123.  
  1124.  
  1125.  
  1126.  
  1127.  
  1128.                                        RUN MENU
  1129.  
  1130.             The "Using the ASIC Debugger" Chapter has additional information on
  1131.        the debugger and it's options.  You may wish to refer to it, should you
  1132.        need more information than is provided below.
  1133.  
  1134.  
  1135.        "Run your program <F5>" Option
  1136.  
  1137.             After you have successfully compiled your program, you can select
  1138.        this option to cause ASIC to load and execute your program.  After your
  1139.        program ENDs, ASIC will return you to the editor.  ASIC will save the
  1140.        edit buffer before loading and executing your program.  If you are
  1141.        running a program containing debugging code, this option will cause ASIC
  1142.        to run your program up to the first breakpoint it encounters, or through
  1143.        the end of your program if you haven't set any breakpoints.  If you are
  1144.        already "paused" at a breakpoint, selecting this option will cause your
  1145.        program to resume execution at the statement following the breakpoint,
  1146.        and run up to the next breakpoint or to the end of your program, if no
  1147.        further breakpoints are encountered.  This option may also be selected
  1148.        outside of the "Run menu" by pressing function key <F5>.
  1149.  
  1150.        "Breakpoint toggle <F9>" Option
  1151.  
  1152.             If you have compiled your program with the "Debugging code" option
  1153.        turned on, you may use this option to set breakpoints.  You can have up
  1154.        to 20 breakpoints active at a time.  When you run your program with
  1155.        breakpoints set, ASIC will pause your program when it tries to execute a
  1156.        line on which you have set a breakpoint.  At this time, you can view or
  1157.        modify variables, or view the screen output produced by your program.
  1158.        You can then resume program execution by selecting the "Run your
  1159.        program" option from the run menu.  If you select this option and the
  1160.        current statement in the edit buffer already has a breakpoint set, then
  1161.        the breakpoint for that source statement will be removed (toggled off).
  1162.        Lines at which you have set a breakpoint will be displayed in reverse
  1163.        video.  Also, when you run your program and ASIC stops at a breakpoint,
  1164.        ASIC will display the next line to execute in reverse video on the
  1165.        second line of the screen with a red background (underlined if you have
  1166.        a monochrome system).  This option may also be selected outside of the
  1167.        "Run" Menu by pressing function key <F9>.
  1168.  
  1169.        "Trace <F8>" Option
  1170.  
  1171.             If you have compiled your program with the "Debugging code" option
  1172.        turned on, you may use this option to execute your program one statement
  1173.        at a time.  After you select this option, ASIC will execute the next
  1174.        program statement in your program, and pause, displaying the next line
  1175.        which will be executed in reverse video with a red background
  1176.        (underlined if you have a monochrome system).  At this time, you can
  1177.        view or modify variables, or view the screen output produced by your
  1178.        program.  You can then resume program execution by selecting the "Run
  1179.        your program" option from the run menu, or by selecting the "Trace"
  1180.        option again.  This option may also be selected outside of the "Run"
  1181.        Menu by pressing function key <F8>.
  1182.  
  1183.  
  1184.  
  1185.  
  1186.  
  1187.                                       Page - 17
  1188.  
  1189.  
  1190.  
  1191.  
  1192.  
  1193.  
  1194.                                  RUN MENU (Continued)
  1195.  
  1196.        "Modify variable" Option
  1197.  
  1198.             If you have compiled your program with the "Debugging code" option
  1199.        turned on, you may use this option to modify the contents of variables
  1200.        in your program while your program is paused at a breakpoint or
  1201.        following a "Trace" command.  When you select this option, ASIC will ask
  1202.        you for the variable name.  After you enter the variable name, ASIC will
  1203.        ask you for the new value to be stored in the variable.  If the variable
  1204.        is an array, ASIC will ask you which element of the array to modify.
  1205.  
  1206.        "Watch variable <F6>" Option
  1207.  
  1208.             If you have compiled your program with the "Debugging code" option
  1209.        turned on, you may use this option to view the contents of variables in
  1210.        your program, while your program is paused at a breakpoint or following
  1211.        a "Trace" command.  After you enter the variable name, ASIC will open a
  1212.        "Watch" window at the bottom of the screen showing you the variable name
  1213.        and the current value.  As you continue execution of your program and
  1214.        reach a new breakpoint, the values of variables will be updated to
  1215.        reflect their new values.  In this way you can watch the changing values
  1216.        of variables in your program without inserting "PRINT variablename"
  1217.        statements in your program.  Up to 10 variables may be watched at a
  1218.        time.  If you enter a variable name which is an array, ASIC will ask you
  1219.        which element of the array you wish to watch.  This option may also be
  1220.        selected outside of the "Run" Menu by pressing function key <F6>.
  1221.  
  1222.        "Unwatch variable <F7>" Option
  1223.  
  1224.             If you have compiled your program with the "Debugging code" option
  1225.        turned on, you may use this option to remove variables from the "Watch"
  1226.        window (see previous option).  When you select this option, you will be
  1227.        asked for a variable name to remove from the window.  If the variable is
  1228.        an array, you will also be asked which element of the array.  ASIC will
  1229.        then remove the variable from the watch window, and resize the window
  1230.        accordingly.  Since only 10 variables may be watched concurrently, you
  1231.        may need to remove variables which are no longer needed from the "Watch"
  1232.        Window using this command.  This option may also be selected outside of
  1233.        the "Run" Menu by pressing function key <F7>.
  1234.  
  1235.        "Abort execution" Option
  1236.  
  1237.             If you are running your program, and it is paused at a breakpoint,
  1238.        you may select this option to abort the execution of your program.  Your
  1239.        program will be terminated immediately.
  1240.  
  1241.        "Clear all break/watch" Option
  1242.  
  1243.             If you have set breakpoints or watch variable options, you may use
  1244.        this option to remove all of them at once, instead of removing them one
  1245.        at a time using the "Toggle breakpoint" or "Unwatch variable" options.
  1246.  
  1247.  
  1248.  
  1249.  
  1250.  
  1251.  
  1252.  
  1253.                                       Page - 18
  1254.  
  1255.  
  1256.  
  1257.  
  1258.  
  1259.  
  1260.                                  RUN MENU (Continued)
  1261.  
  1262.        "Program arguments" Option
  1263.  
  1264.             This option allows you to pass command line arguments to your
  1265.        programs, which may be retrieved by your program using the COMMAND$
  1266.        statement.  If you are testing outside the integrated environment, you
  1267.        would normally specify the command line arguments by typing
  1268.        "progname arguments".  However, in the integrated environment, since
  1269.        ASIC is executing your program for you, this option is a means to pass
  1270.        the "arguments" to your program as if they had been typed on the command
  1271.        line following your program name.
  1272.  
  1273.        "Swap to user screen <F4>" Option
  1274.  
  1275.             Whenever ASIC pauses your program at a breakpoint, it saves the
  1276.        screen created by your program in a memory buffer.  You may select this
  1277.        option to view your program screen output.  When you are done viewing
  1278.        your program's output, press a key to return to viewing the ASIC editor.
  1279.        This function may also be selected outside the "Run" Menu by pressing
  1280.        the <F4> function key.
  1281.  
  1282.  
  1283.                                      STATUS LINE
  1284.  
  1285.             The bottom line of the ASIC screen is called the "Status Line".  As
  1286.        it's name implies, it is used to display various types of status
  1287.        information.  At the left of the status line "FILE: xxxxxxxx.xxx" will
  1288.        display the name of the file which is currently loaded in the edit
  1289.        buffer.  If you haven't opened a file yet, the file name will be blank.
  1290.  
  1291.  
  1292.             After the file name is the "File Modified Indicator".  If you have
  1293.        entered any changes in the edit buffer, and have not saved them to disk,
  1294.        an "*" will appear to indicate this.  If the edit buffer has not been
  1295.        modified since the last save to disk, no "*" will be present.
  1296.  
  1297.             The next piece of information is "Mode:".  Mode will always display
  1298.        one of two values:  "Insert" or "Ovrstr".  In "Insert" mode, any
  1299.        characters you type in the edit buffer will be inserted at the cursor
  1300.        position, and the characters to the right of the cursor will be shifted
  1301.        to the right by one.  In "Ovrstr" mode, any characters you type in the
  1302.        edit buffer will overlay (and thus destroy) the character at the cursor
  1303.        position.  You can change back and forth between these two modes by
  1304.        pressing the <INS> key on your keypad.
  1305.  
  1306.             To the right of "Mode:" ASIC displays the number of bytes which it
  1307.        allocated to the edit buffer.  Divide this number by 81 to get a rough
  1308.        idea of how many lines will fit in the edit buffer.
  1309.  
  1310.             The "Line: nnnn" status indicator, will identify which line of the
  1311.        file is being displayed.  For example, if the display reads "Line: 100",
  1312.        the line containing the cursor is the 100th line in the file. When ASIC
  1313.        is reading or writing your program to/from disk, it will display a
  1314.        running total of the number of records read/written in this field.
  1315.  
  1316.  
  1317.  
  1318.  
  1319.                                       Page - 19
  1320.  
  1321.  
  1322.  
  1323.  
  1324.  
  1325.  
  1326.                                STATUS LINE (Continued)
  1327.  
  1328.  
  1329.             The "Row:" and "Col:" numbers identify the relative position of the
  1330.        cursor within the "Edit Window".
  1331.  
  1332.  
  1333.                                      EDIT WINDOW
  1334.  
  1335.             The edit window is the area of the screen where your program is
  1336.        displayed.  It displays up to 23 lines of your program at a time.  You
  1337.        can use the keys described below to manipulate the text in this window.
  1338.  
  1339.  
  1340.                                     KEYBOARD USAGE
  1341.  
  1342.             Most keys on the keyboard behave in ASIC just as you'd expect.  The
  1343.        key usages which might not be obvious are described here.
  1344.  
  1345.        <ESC>          Exit from any menu without taking any action.
  1346.  
  1347.        <TAB>          Move the cursor to the next "tab stop".  Tab stops in
  1348.                       ASIC are fixed at every fourth column (4,8,12,etc).
  1349.  
  1350.        <HOME>         Move the cursor to the beginning of the current line.
  1351.  
  1352.        <END>          Move the cursor to the first blank character following
  1353.                       the last non-blank character on the current line.
  1354.  
  1355.        <DEL>          Delete the character at the cursor position.
  1356.  
  1357.        <INS>          Toggle between Insert and Overstrike Modes.
  1358.  
  1359.        <PGUP>         Display the previous "page" of the edit buffer.
  1360.  
  1361.        <PGDN>         Display the next "page" of the edit buffer.
  1362.  
  1363.        <Ctl-PGUP>     Display the first "page" of the edit buffer.
  1364.  
  1365.        <Ctl-PGDN>     Display the last "page" in the edit buffer.
  1366.  
  1367.        <Backspace>    Delete the character to the left of the cursor
  1368.                       position, and move the cursor one column to the left.
  1369.  
  1370.  
  1371.  
  1372.  
  1373.  
  1374.  
  1375.  
  1376.  
  1377.  
  1378.  
  1379.  
  1380.  
  1381.  
  1382.  
  1383.  
  1384.  
  1385.                                       Page - 20
  1386.  
  1387.  
  1388.  
  1389.  
  1390.  
  1391.  
  1392.                               KEYBOARD USAGE (Continued)
  1393.  
  1394.        <Up Arrow>     Moves cursor up one line.
  1395.  
  1396.        <Down Arrow>   Moves cursor down one line.
  1397.  
  1398.        <Left Arrow>   Moves cursor left one column.
  1399.  
  1400.        <Right Arrow>  Moves cursor right one column.
  1401.  
  1402.        <Alt-D>        Delete the line containing the cursor.
  1403.  
  1404.        <Alt-A>        Add a line following the line containing the cursor.
  1405.  
  1406.        <F1>           Displays a help screen.
  1407.  
  1408.        <CTL-F1>       Displays help information for the keyword located at
  1409.                       the cursor postion.
  1410.  
  1411.        <F3>           Repeats the last "Search" command.  See Edit Menu
  1412.                       Section of this chapter for more information.
  1413.  
  1414.        <F4>           Swaps the display to the output from your program
  1415.                       temporarily.  See Run Menu Section of this chapter for
  1416.                       more information.
  1417.  
  1418.        <F5>           Runs your program.  See Run Menu Section of this
  1419.                       chapter for more information.
  1420.  
  1421.        <F6>           Add a variable to the "Watch" Window.  See Run Menu
  1422.                       Section of this chapter for more information.
  1423.  
  1424.        <F7>           Remove a variable from the "Watch" Window.  See Run
  1425.                       Menu Section of this chapter for more information.
  1426.  
  1427.        <F8>           Execute a single statement of your program.  See Run
  1428.                       Menu Section of this chapter for more information.
  1429.  
  1430.        <F9>           Toggle breakpoint on/off at the current edit buffer
  1431.                       line.  See Run Menu Section of this chapter for more
  1432.                       information.
  1433.  
  1434.        <F10>          Compile your program.  See Compile Menu Section of
  1435.                       this chapter for more information.
  1436.  
  1437.        <enter>        In Insert mode, pressing <enter> is identical to
  1438.                       pressing <Alt-A>.  In OvrStr mode, pressing <enter>
  1439.                       is identical to pressing the <Down Arrow> key.
  1440.  
  1441.  
  1442.  
  1443.  
  1444.  
  1445.  
  1446.  
  1447.  
  1448.  
  1449.  
  1450.  
  1451.                                       Page - 21
  1452.  
  1453.  
  1454.  
  1455.  
  1456.  
  1457.  
  1458.  
  1459.  
  1460.  
  1461.                                        A S I C
  1462.  
  1463.                                       Chapter 4
  1464.  
  1465.                                   Using the Debugger
  1466.  
  1467.  
  1468.  
  1469.                                      INTRODUCTION
  1470.  
  1471.             The source level debugger in ASIC's integrated programming
  1472.        environment helps you debug your programs by allowing you to "peek"
  1473.        inside them as they're running.  You can single step through your
  1474.        programs, or select places in the program where you wish execution to
  1475.        pause by setting breakpoints.  Then, while the program is paused, you
  1476.        can view or modify any of your program's variables, and also examine the
  1477.        screen output created by your program.
  1478.  
  1479.             All of the debugger's commands can be selected from the run menu,
  1480.        and they are described in the "RUN MENU" Section of Chapter 3,
  1481.        "Integrated Editor/Compiler Environment".  Many of the debugger commands
  1482.        may be selected outside the "Run" menu, by pressing a function key (eg,
  1483.        <F5>,<F6>,etc).  A complete list of the function keys available is
  1484.        contained in Chapter 3, in the "KEYBOARD USAGE" Section.
  1485.  
  1486.             This chapter explains how to use the debugger with a short tutorial
  1487.        which guides you through a sample debugging session.  The tutorial is
  1488.        followed by a reference section which you should read after completing
  1489.        the tutorial.
  1490.  
  1491.                                   DEBUGGER TUTORIAL
  1492.  
  1493.             The debugger tutorial follows the same format as the general
  1494.        tutorial in chapter 2.  You should complete (or at least review) the
  1495.        general tutorial before taking the debugger tutorial.
  1496.  
  1497.             This tutorial will use a program file provided with your ASIC
  1498.        compiler package called "DBGTUTOR.ASI".  If you are running from a hard
  1499.        disk, make sure it is in the ASIC directory.  If you are running from a
  1500.        two-floppy system, make sure it is on the diskette in drive b:, with the
  1501.        compiler in drive a:.
  1502.  
  1503.        NOTE:  Floppy disk users should verify that the ASIC compiler diskette
  1504.        is in drive A: and the "DBGTUTOR.ASI" disk is in drive b: before
  1505.        proceeding.
  1506.  
  1507.        Let's get started:
  1508.  
  1509.             FLOPPY TYPE-->      A: <enter>
  1510.                                 ASIC B:DBGTUTOR <enter>
  1511.  
  1512.             HARD TYPE-->        C: <enter>
  1513.                                 CD C:\ASIC <enter>
  1514.                                 ASIC DBGTUTOR <enter>
  1515.  
  1516.  
  1517.                                       Page - 22
  1518.  
  1519.  
  1520.  
  1521.  
  1522.  
  1523.  
  1524.  
  1525.        You should be in ASIC now, and you should see a source program.  The
  1526.        first few lines should contain:
  1527.  
  1528.                            dim scores(10)
  1529.                            data 55,33,877,99,44,101,21,88,105,1
  1530.                            rem DBGTUTOR.ASI
  1531.                                 .
  1532.                                 . (etc)
  1533.                                 .
  1534.  
  1535.        This sample program will sort an array of 10 scores into ascending
  1536.        sequence.  It uses a simple "bubble" sort algorithm.  The "bubble" sort
  1537.        algorithm simply steps through each element of the array and compares it
  1538.        to its next higher neighbor.  If its neighbor's value is less than its
  1539.        own, the two values are swapped.  It is necessary to execute this
  1540.        process N-1 times where N= number of items to sort.  Here's why.  Let's
  1541.        say the lowest value to be sorted was "1" and it is in array element
  1542.        "10" (assume 10 numbers will be sorted).  The first swapping pass will
  1543.        result in the "1" being swapped from element 10 to element 9 of the
  1544.        array.  An additional 8 passes through the array are necessary to move
  1545.        the "1" to array element number 1.  This algorithm gets its name,
  1546.        because the process of moving the elements has been compared to that of
  1547.        bubbles slowly rising to the surface.
  1548.  
  1549.        This program has a list of ten scores to be sorted.  Line 5 of the
  1550.        program will read the ten scores to an array called "Scores", and also
  1551.        print the original values (before the sort) to the screen.  Then two
  1552.        loops will execute at statements 8 and 9 in the program to perform the
  1553.        bubble sort as described above.  Finally, after the sort is complete,
  1554.        the sorted values will be displayed.
  1555.  
  1556.        First, let's compile the program.  When we plan to use the debugger, we
  1557.        must set the "Debugging code" option on.  This is done on the Compile
  1558.        Menu.  However, the default in the integrated environment is "Debugging
  1559.        code" on.  Let's take a look to be sure:
  1560.  
  1561.  
  1562.             TYPE-->        <Alt><c>
  1563.  
  1564.        The compile menu should pop open, and you should see a check mark next
  1565.        to the "Debugging code" option.  If you don't, press the letter "D", and
  1566.        a check mark should appear.  Once you've verified that the option is on,
  1567.        we can compile the program.  Notice that there is an <F10> next to the
  1568.        option.  Instead of opening this menu and selecting the "Compile"
  1569.        option, we could have pressed <F10>.  Let's try it.  First, let's close
  1570.        the menu (Function keys don't work inside a menu):
  1571.  
  1572.             TYPE-->        <ESC>
  1573.  
  1574.        The menu should have closed.  Now let's compile using the function key:
  1575.  
  1576.             TYPE-->        <F10>
  1577.  
  1578.        You should see the compiler screen pop up, and compile the program.  No
  1579.        errors should be detected.  Now we're ready to test the program.  First,
  1580.        let's set a breakpoint so we can easily view the screen output, Use the
  1581.  
  1582.  
  1583.                                       Page - 23
  1584.  
  1585.  
  1586.  
  1587.  
  1588.  
  1589.  
  1590.        down arrow key to position the cursor on line 20 (the line number is
  1591.        displayed on the ASIC status line).  Line 20 should contain an "END"
  1592.        statement.  Let's open the run menu and set a breakpoint:
  1593.  
  1594.  
  1595.             TYPE-->        <Alt><r>
  1596.                            <b>
  1597.  
  1598.        The "END" statement should now be displayed in reverse video.  That
  1599.        tells us that a breakpoint has been set there.  Did you notice that the
  1600.        breakpoint option on the menu also had a function key listed.  We could
  1601.        set a breakpoint without opening a menu, by pressing <F9> instead.  Now
  1602.        that we've set a breakpoint, let's run the program and see how it works:
  1603.  
  1604.             TYPE-->        <Alt><r>
  1605.                            <r>
  1606.  
  1607.        Note that we could have pressed the short cut key of <F5> to run the
  1608.        program instead of selecting the option from the menu.  At this point
  1609.        our program is running, but is paused at the breakpoint we set on line
  1610.        20.  When you reach a breakpoint, ASIC will position the breakpointed
  1611.        line on the second line of the edit window, highlighted in red (or
  1612.        underlined, if you have a monochrome system). ASIC has interrupted the
  1613.        program before it executed the line with the breakpoint, in this case
  1614.        "END".  Let's take a look at the screen output of the program to see if
  1615.        it worked:
  1616.  
  1617.             TYPE-->        <Alt><r>
  1618.                            <s>
  1619.  
  1620.        Note we could also select the "Swap" function by pressing <F4> without
  1621.        opening a menu.  You should now see the output from the program on the
  1622.        screen.  It should look something like:
  1623.  
  1624.        Original Scores:
  1625.            55    33   877    99    44   101    21    88   105     1
  1626.        Sorting...
  1627.        Here are the sorted scores:
  1628.            33    55    99    44   101    21    88   105     1   877
  1629.  
  1630.        Well, that doesn't look quite right.  Maybe we can use the debugger to
  1631.        figure out what went wrong.  First, let's allow the program to run to
  1632.        completion (remember, we're paused at a breakpoint on the "END"
  1633.        statement).  Swap back to the ASIC screen from the user screen by
  1634.        pressing any key:
  1635.  
  1636.             TYPE-->        <enter>
  1637.  
  1638.        You should see the editor screen again.  Now let's tell ASIC to resume
  1639.        program execution:
  1640.  
  1641.             TYPE-->        <Alt><r>
  1642.                            <r>
  1643.  
  1644.        ASIC has executed the END statement, and our program has terminated.
  1645.        You should see the message "Program Terminated Normally (0)".  (The "0"
  1646.        is the return code set by the program.  You can set return codes in your
  1647.  
  1648.  
  1649.                                       Page - 24
  1650.  
  1651.  
  1652.  
  1653.  
  1654.  
  1655.  
  1656.        programs using the END statement.  Refer to Chapter 7 for details.).
  1657.        Now we'll set another breakpoint in the program.  Move the cursor to
  1658.        line 7 (the status line should now say LINE: 7) using the arrow keys.
  1659.        The cursor should now be positioned on the statement which says:  PRINT
  1660.        "Sorting...".  Set a breakpoint here:
  1661.  
  1662.             TYPE-->        <F9>
  1663.  
  1664.        The source statement should now appear in reverse video.  We used the
  1665.        shortcut key <F9> to set the breakpoint this time, but you could have
  1666.        opened the Run Menu, and selected the Breakpoint option and done the
  1667.        same thing.  Let's remove the breakpoint:
  1668.  
  1669.             TYPE-->        <F9>
  1670.  
  1671.        Line 7 should no longer be highlighted.  The same command is used to
  1672.        turn breakpoints on or off for a source line.  ASIC just checks to see
  1673.        if a breakpoint is already set at that source line when you select the
  1674.        breakpoint command.  If one is set, it "toggles" it off (ie removes it),
  1675.        otherwise, it "toggles" it on (ie sets a breakpoint).  This exercise was
  1676.        just to show you how to remove a breakpoint, let's go ahead and set it
  1677.        again:
  1678.  
  1679.             TYPE-->        <F9>
  1680.  
  1681.        Line 7 should be highlighted again (the breakpoint is set).
  1682.        It might be nice to see what's in some of our program's variables, so
  1683.        let's "watch" some variables.  Open the Run Menu, select the Watch
  1684.        command, and tell ASIC you want to watch variable "I".
  1685.  
  1686.             TYPE-->        <Alt><r>
  1687.                            <w>
  1688.                            i<enter>
  1689.  
  1690.        ASIC should have opened a "Watch" window at the bottom of the screen.
  1691.        You should see the variable name "I" at the left, followed by a ":".
  1692.        Following the ":" is the current value of that variable.  The number
  1693.        there now doesn't really mean anything, since our program is not
  1694.        running.  But once the we start the program, this number should
  1695.        represent the actual value of the variable "I".
  1696.  
  1697.        Let's watch a few more variables: j, j1, and scores(1).  This time,
  1698.        we'll use the shortcut key for the watch command:
  1699.  
  1700.             TYPE-->        <F6>
  1701.                            j<enter>
  1702.  
  1703.        Variable "J" should now be in the watch window.
  1704.  
  1705.             TYPE-->        <F6>
  1706.                            j1<enter>
  1707.  
  1708.        Variable "J1" should now be in the watch window.  When we watch
  1709.        "scores", we'll also have to tell ASIC which element we want to watch by
  1710.        entering a subscript, since "scores" is an array.  First ASIC will
  1711.        prompt you for the variable name.  Type it, without the subscript.  ASIC
  1712.        will prompt you for the numeric subscript.
  1713.  
  1714.  
  1715.                                       Page - 25
  1716.  
  1717.  
  1718.  
  1719.  
  1720.  
  1721.  
  1722.  
  1723.  
  1724.             TYPE-->        <F6>
  1725.                            scores<enter>
  1726.                            <1><enter>
  1727.  
  1728.        Scores(1) should now be in the watch window.  Now we're ready to run the
  1729.        program again:
  1730.  
  1731.             TYPE-->        <F5>
  1732.  
  1733.        Again we selected the short cut key, you could have selected the "Run
  1734.        your program" option from the "Run" Menu.  The second line of the edit
  1735.        screen should show the PRINT "Sorting..." statement (highlighted in red,
  1736.        or underlined if you have a monochrome monitor).  The variables in the
  1737.        watch window should have the following values:
  1738.  
  1739.             I:    11
  1740.             J:     0
  1741.             J1:     0
  1742.             SCORES(1):    55
  1743.  
  1744.        Let's execute the next statement by using the Trace command:
  1745.  
  1746.             TYPE-->        <Alt><r>
  1747.                            <t>
  1748.  
  1749.        ASIC has executed the PRINT "Sorting..." statement and has paused
  1750.        execution on the "FOR I" statement on line 8 of the program.  Since the
  1751.        PRINT statement did not modify any variables, the numbers in the watch
  1752.        window should remain unchanged.  Let's Trace one more statement, this
  1753.        time, we'll use the short cut key:
  1754.  
  1755.             TYPE-->        <F8>
  1756.  
  1757.        ASIC has executed the "FOR I" statement on line 8, and is now paused on
  1758.        statement "FOR J" on line 9 of the program.  Something looks wrong
  1759.        though.  Even though we executed the first "FOR I" statement, the
  1760.        variable "I" still contains "11".  It should contain "1".  If you look
  1761.        at line 8, you'll see that the FOR statement was mistyped, it reads:
  1762.        "FOR I = I to 9", instead of "FOR I=1 to 9".  Since the program also
  1763.        used variable "I" to READ the data into the array, "I" still contains
  1764.        the value "11".  Since "11" is greater than the "TO" value of the "FOR"
  1765.        loop, the FOR loop on line 8 is executed only 1 time instead of 9 times.
  1766.        That's why the data is not being fully sorted.  With the ASIC debugger,
  1767.        we can continue testing without recompiling, by modifying the value of
  1768.        "I" to "1", so we can see if the rest of our logic is correct.  If
  1769.        changing "I" to "1" works, then we can go back and modify the "FOR"
  1770.        statement and recompile the program to correct the program permanently.
  1771.        Modify the value of "I" to "1":
  1772.  
  1773.             TYPE-->        <Alt><r>
  1774.                            <m>
  1775.                            i<enter>
  1776.                            <1><enter>
  1777.  
  1778.  
  1779.  
  1780.  
  1781.                                       Page - 26
  1782.  
  1783.  
  1784.  
  1785.  
  1786.  
  1787.  
  1788.        The watch window should now show the value of "I" as 1.  We can resume
  1789.        program execution at this point by selecting the "Run your program"
  1790.        option.  We'll use the short cut key again:
  1791.  
  1792.             TYPE-->        <F5>
  1793.  
  1794.        ASIC should pause the program at the next breakpoint, which is on line
  1795.        20.  This statement contains the "END" command.  Now let's see if the
  1796.        program worked, by swapping to the user screen:
  1797.  
  1798.             TYPE-->        <F4>
  1799.  
  1800.        Again, we used the short cut key.  You should see the following on your
  1801.        screen:
  1802.  
  1803.        Original Scores:
  1804.            55    33   877    99    44   101    21    88   105     1
  1805.        Sorting...
  1806.        Here are the sorted scores:
  1807.             1    21    33    44    55    88    99   101   105   877
  1808.  
  1809.        It looks like the program worked.  Let's return to the editor screen.
  1810.  
  1811.             TYPE-->        <enter>
  1812.  
  1813.        Now we could press <F5> to resume execution and in this case terminate,
  1814.        since the END statement is the next one to execute.  But let's look at
  1815.        another way to terminate a program.  While at a breakpoint, you can
  1816.        select the "Abort your program" option, which instructs ASIC to
  1817.        terminate your program immediately, without executing any more of your
  1818.        program.  Let's try it:
  1819.  
  1820.             TYPE-->        <Alt><r>
  1821.                            <a>
  1822.  
  1823.        ASIC should display the message "Program Terminated Normally (0)".  At
  1824.        this point, we'll just exit from ASIC, but normally, you would fix the
  1825.        FOR statement using the editor, save the file, recompile the program,
  1826.        and retest it to make sure the "bug" is really fixed.
  1827.  
  1828.             TYPE-->        <Alt><f>
  1829.                            <x>
  1830.  
  1831.        You should be back at the DOS prompt now.  That concludes the brief
  1832.        introduction to the ASIC debugger.  The rest of this chapter provides
  1833.        some additional reference material for the debugger.  Chapter 3 provides
  1834.        additional information about each of the debugging commands.
  1835.  
  1836.  
  1837.  
  1838.  
  1839.  
  1840.  
  1841.  
  1842.  
  1843.  
  1844.  
  1845.  
  1846.  
  1847.                                       Page - 27
  1848.  
  1849.  
  1850.  
  1851.  
  1852.  
  1853.  
  1854.  
  1855.                                     DEBUGGER TIPS
  1856.  
  1857.        1)  WHEN YOU ARE DONE DEBUGGING YOUR PROGRAM, YOU SHOULD RECOMPILE
  1858.            WITH THE "DEBUGGING CODE" OPTION TURNED OFF. Although your program
  1859.            can run from the DOS command line with debugging code present, it
  1860.            will increase the program size and execution times.  Recompiling
  1861.            with the "Debugging code" option off will insure your programs
  1862.            will be smaller and faster.
  1863.  
  1864.        2)  Remember that the default option on the command line compiler is
  1865.            "Debugging code" off.  The default option in the integrated
  1866.            environment is "Debugging code" on.
  1867.  
  1868.        3)  Breakpoints/Watches are automatically cleared when you
  1869.            OPEN or COMPILE a file.
  1870.  
  1871.        4)  If you change source lines in a program while a program
  1872.            is running, without recompiling, source statements will
  1873.            not match executable code.  Abort the running program
  1874.            and recompile after making code changes.
  1875.  
  1876.        5)  Breakpoints are set in the edit buffer relative to the
  1877.            beginning of the buffer.  If you insert/delete lines in
  1878.            the buffer, the breakpoints will still be set at the
  1879.            same relative line number from the beginning of the
  1880.            buffer.
  1881.  
  1882.        6)  ASIC takes over the INT 3 Interrupt vector for debugging
  1883.            purposes. It re-installs the default vector when you
  1884.            exit ASIC.
  1885.  
  1886.        7)  You must compile with the "Debugging code" option to use
  1887.            source level debugging.
  1888.  
  1889.        8)  If you wish to run a program from the beginning again
  1890.            while its already running,  select the "Abort your
  1891.            program" option from the Run menu.  Then, select the
  1892.            "Run your program" option.
  1893.  
  1894.        9)  If you select the Abort option from the Run menu, your
  1895.            program's files will NOT be closed gracefully.  That
  1896.            is, data in the buffers will not be flushed to disk.
  1897.  
  1898.        10) You may still run a program in the integrated environment that
  1899.            has been compiled without the Debugging code option.  You just
  1900.            won't be able to use the debugging commands (eg,
  1901.            Breakpoints/Watches).
  1902.  
  1903.        11) Toggling a breakpoint on/off will clear any block of
  1904.            text you had previously marked for editing (eg, MOVE,
  1905.            COPY).
  1906.  
  1907.  
  1908.  
  1909.  
  1910.  
  1911.  
  1912.  
  1913.                                       Page - 28
  1914.  
  1915.  
  1916.  
  1917.  
  1918.  
  1919.  
  1920.                               DEBUGGER TIPS (Continued)
  1921.  
  1922.        12) When modifying array variables, make sure that the
  1923.            subscript you specify is valid.  For example, if you
  1924.            "DIM A(10)", make sure the subscript you specify is in
  1925.            the range of 0 to 10.  ASIC does not check the range of
  1926.            a subscript.  If you specify a subscript that exceeds
  1927.            the valid range for that variable, your program may
  1928.            crash.
  1929.  
  1930.        13) You can pass arguments to programs using the "Arguments"
  1931.            option on the Run Menu.  You may retrieve these options
  1932.            in your program with the COMMAND$ statement.  Using the
  1933.            "Arguments" option is equivalent to specifying arguments
  1934.            following the program name, when you run your program
  1935.            from the DOS command line.
  1936.  
  1937.        14) The compiler allows variable names up to 80 characters in
  1938.            length.  The debugger only uses the first 30 characters of a
  1939.            variable name.  When the debugger finds two variables whose names
  1940.            are not unique within 30 characters, it will always select the
  1941.            first one it finds (this applies to the Watch/Unwatch/Modify
  1942.            Variables commands).
  1943.  
  1944.        15) ASIC will allow you to set a breakpoint on a "FOR" statement.
  1945.            However, you should be aware that the source statement containing
  1946.            the "FOR" is executed only once (to initialize the loop).  When
  1947.            the "NEXT" statement executes, control transfers back to the line
  1948.            following the "FOR", instead of the "FOR".  For example, in the
  1949.            following code fragment:
  1950.  
  1951.             FOR I = 1 TO 3           <---Executes 1 time to initialize loop
  1952.                  PRINT I             <---Executes 3 times
  1953.                  A=A+1               <---Executes 3 times
  1954.             NEXT I                   <---Executes 3 times, loops back to
  1955.                                          "PRINT I", not to "FOR I= 1 TO 3"
  1956.  
  1957.        16)  Because a single machine language instruction could span multiple
  1958.             CODE statements, ASIC does not allow breakpoints on CODE
  1959.             statements.
  1960.  
  1961.  
  1962.  
  1963.  
  1964.  
  1965.  
  1966.  
  1967.  
  1968.  
  1969.  
  1970.  
  1971.  
  1972.  
  1973.  
  1974.  
  1975.  
  1976.  
  1977.  
  1978.  
  1979.                                       Page - 29
  1980.  
  1981.  
  1982.  
  1983.  
  1984.  
  1985.  
  1986.  
  1987.  
  1988.  
  1989.                                        A S I C
  1990.  
  1991.                                       Chapter 5
  1992.  
  1993.                                    Compiler Options
  1994.  
  1995.  
  1996.                                  COMMAND LINE SYNTAX
  1997.  
  1998.  
  1999.        Invoke the command line version of the compiler as follows:
  2000.  
  2001.  
  2002.             ASICC filename option1 option2 option3[...option7]
  2003.  
  2004.  
  2005.             Where:         filename  is the name of the source program to be
  2006.                                      compiled.  This file must have the file
  2007.                                      extension ".ASI", although the extension
  2008.                                      may be omitted from the command line.
  2009.  
  2010.                            optionN   specifies any options desired.  No
  2011.                                      options are required, but as many as
  2012.                                      seven may be specified.
  2013.  
  2014.  
  2015.                                    COMPILER OPTIONS
  2016.  
  2017.  
  2018.  
  2019.        A total of six compiler switches are currently available for ASIC.  Each
  2020.        is described in detail below:
  2021.  
  2022.  
  2023.        Switch         Description
  2024.  
  2025.          C            CONTINUE--ASIC will not pause after messages are
  2026.                                 issued, but will continue compiling.
  2027.  
  2028.                       Default:  ASIC will pause after each error message.
  2029.                                 Compilation will resume after you press
  2030.                                 a key.
  2031.  
  2032.  
  2033.  
  2034.  
  2035.  
  2036.  
  2037.  
  2038.  
  2039.  
  2040.  
  2041.  
  2042.  
  2043.  
  2044.  
  2045.                                       Page - 30
  2046.  
  2047.  
  2048.  
  2049.  
  2050.  
  2051.  
  2052.                              COMPILER OPTIONS (Continued)
  2053.  
  2054.  
  2055.        Switch         Description
  2056.  
  2057.          L            LIST ALL--ASIC will list each source line as it
  2058.                                 compiles it.
  2059.  
  2060.                       Default:  ASIC will list only source lines with
  2061.                                 compile errors.
  2062.  
  2063.                       Comment:  Use of this switch will slow compile
  2064.                                 speeds slightly due to the additional
  2065.                                 screen I/O.
  2066.                                 
  2067.  
  2068.          P            PRINTLIST--ASIC will echo all messages which
  2069.                                 appear on the screen to the printer.
  2070.                                 Output to the printer will be paged
  2071.                                 with header lines identifying the
  2072.                                 program name, and the date/time
  2073.                                 compiled.
  2074.  
  2075.                       Default:  ASIC will not send any messages to
  2076.                                 the printer.
  2077.  
  2078.                       Comments: Even though output to the printer is
  2079.                                 buffered, this option will slow compile
  2080.                                 speeds considerably.  The compiler typically
  2081.                                 compiles only as fast as your printer
  2082.                                 can print the messages.  An alternative
  2083.                                 to this switch is the DISKLIST option
  2084.                                 described below.
  2085.  
  2086.  
  2087.          D            DISKLIST--ASIC will echo all screen messages to a disk
  2088.                                 file named "progname.LST".  The format is
  2089.                                 the same produced by PRINTLIST.  This allows
  2090.                                 you to compile at higher speed, and print
  2091.                                 the source listing later from the disk file
  2092.                                 via the DOS print spooler.
  2093.  
  2094.                       Default:  ASIC does not produce a ".LST" file.
  2095.  
  2096.  
  2097.          S            SYMTAB----ASIC will produce a formatted Symbol Table
  2098.                                 in a file named "progname.SYM".  The symbol
  2099.                                 table contains a list of all variables,
  2100.                                 labels, and internally created compiler
  2101.                                 addresses.
  2102.  
  2103.                       Default:  ASIC does not produce a ".SYM" file.
  2104.  
  2105.  
  2106.  
  2107.  
  2108.  
  2109.  
  2110.  
  2111.                                       Page - 31
  2112.  
  2113.  
  2114.  
  2115.  
  2116.  
  2117.  
  2118.                              COMPILER OPTIONS (Continued)
  2119.  
  2120.          E            EMATH-----ASIC will enable the Extended Math Option.
  2121.                                 When this option is selected, you may specify
  2122.                                 long integers (eg, VELOCITY&, 123456789&,
  2123.                                 etc) which can hold a larger range of values
  2124.                                 (+2,147,483,647 to -2,147,483,647).  This
  2125.                                 option does increase the size of your ".COM"
  2126.                                 file by a couple of hundred bytes.
  2127.                            
  2128.  
  2129.                       Default:  ASIC does not enable the Extended Math
  2130.                                 Option.
  2131.  
  2132.  
  2133.          X            DEBUG-----ASIC will generate debugging code in the
  2134.                                 ".COM" file and a ".DBG" file for use by the
  2135.                                 integrated environment debugger.
  2136.  
  2137.                       Default:  ASIC does not generate debugging information.
  2138.                                 
  2139.                       Comment:  If you are running from the integrated
  2140.                                 environment, ASIC sets this option on by
  2141.                                 default.  You may turn it off in the Compile
  2142.                                 menu, should you so desire.
  2143.  
  2144.  
  2145.                                    COMPILE EXAMPLES
  2146.  
  2147.  
  2148.        Example 1:  Compile "MYFILE.ASI" with default compiler options:
  2149.  
  2150.  
  2151.                       ASICC MYFILE
  2152.  
  2153.  
  2154.        Example 2:  Compile "MYPROG.ASI", Listing all source lines, writing
  2155.                    a compile listing to a disk file for printing later.  The
  2156.                    listing file will be called "MYPROG.LST":
  2157.  
  2158.                       ASICC MYPROG L D
  2159.  
  2160.  
  2161.        Example 3:  Compile "FILEX.ASI", don't pause for any errors, and
  2162.                    print the errors on the printer:
  2163.  
  2164.                       ASICC FILEX C P
  2165.  
  2166.  
  2167.        Example 4:  Compile "CRUNCH.ASI" and allow long (32 bit) integer
  2168.                    numbers:
  2169.  
  2170.                       ASICC CRUNCH E
  2171.  
  2172.  
  2173.  
  2174.  
  2175.  
  2176.  
  2177.                                       Page - 32
  2178.  
  2179.  
  2180.  
  2181.  
  2182.  
  2183.  
  2184.  
  2185.  
  2186.  
  2187.                                        A S I C
  2188.  
  2189.                                       Chapter 6
  2190.  
  2191.                                   Language Elements
  2192.  
  2193.  
  2194.  
  2195.                                     CHARACTER SET
  2196.  
  2197.  
  2198.        Symbol         Description
  2199.  
  2200.          *            Multiplication
  2201.                       Example: A=B*C  (multiply B by C, store result in A)
  2202.  
  2203.          /            Division
  2204.                       Example: A=B/C  (divide B by C, store result in A)
  2205.  
  2206.          +            Addition
  2207.                       Example: A=B+C  (add C to B, store result in A)
  2208.  
  2209.          +            String Concatenation
  2210.                       Example: A$="AB"+"C"   (A$ will contain "ABC")
  2211.  
  2212.          =            Assignment
  2213.                       Example: A=1    (A will be assigned the value 1)
  2214.  
  2215.          =            Equality testing
  2216.                       Example: IF A=1 THEN QUIT:  (If the value stored in
  2217.                            (A equals 1 goto label QUIT)
  2218.  
  2219.          -            Subtraction
  2220.                       Example: A=B-C   (Subtract C from B, store result in A)
  2221.  
  2222.          "            String Delimiter
  2223.                       Example: A$="the string is inside quote marks"
  2224.  
  2225.          ()           Parenthesis -- Ignored by ASIC
  2226.  
  2227.        Symbol         Description
  2228.  
  2229.          ;            Suppress Carriage Return/Line Feed with PRINT/LPRINT
  2230.  
  2231.          #            Used to identify file usage with PRINT#/INPUT#
  2232.  
  2233.          ,            Comma,  Ignored by ASIC
  2234.  
  2235.          $            Distinguishes a String Variable from an Integer.
  2236.                       Example:    ABC$   <---- String Variable
  2237.                       Example:    ABC    <---- Integer Variable
  2238.  
  2239.  
  2240.  
  2241.  
  2242.  
  2243.                                       Page - 33
  2244.  
  2245.  
  2246.  
  2247.  
  2248.  
  2249.  
  2250.                               CHARACTER SET (Continued)
  2251.  
  2252.        Symbol         Description
  2253.  
  2254.          :            Distinguishes a Label from a variable name.
  2255.                       Example:    START:    <---Label name
  2256.  
  2257.          &            Distinguishes a "long" (32 bit) integer from a normal
  2258.                       integer (16 bit) variable or constant.  Normal integers
  2259.                       can hold numbers in the range +32,767 to -32,767.  Long
  2260.                       integers can hold numbers in the range +2,147,483,647
  2261.                       to -2,147,483,647.  Note:  You must compile with the
  2262.                       "Extended Math" Option enabled to use long integers.
  2263.                       Example:    APPLES&   <--Long Integer Variable
  2264.                       Example:    ORANGES   <--Normal Integer Variable
  2265.                       Example:    123457&   <--Long Integer Constant
  2266.                       Example:    1234      <--Short Integer Constant
  2267.  
  2268.  
  2269.  
  2270.  
  2271.  
  2272.  
  2273.  
  2274.  
  2275.  
  2276.  
  2277.  
  2278.  
  2279.  
  2280.  
  2281.  
  2282.  
  2283.  
  2284.  
  2285.  
  2286.  
  2287.  
  2288.  
  2289.  
  2290.  
  2291.  
  2292.  
  2293.  
  2294.  
  2295.  
  2296.  
  2297.  
  2298.  
  2299.  
  2300.  
  2301.  
  2302.  
  2303.  
  2304.  
  2305.  
  2306.  
  2307.  
  2308.  
  2309.                                       Page - 34
  2310.  
  2311.  
  2312.  
  2313.  
  2314.  
  2315.  
  2316.                            CONSTANTS, VARIABLES, AND LABELS
  2317.  
  2318.  
  2319.        ASIC supports the following data types:  Integer Constants, Integer
  2320.        Variables, Long Integer Variables, Long Integer Constants,  single
  2321.        dimension Integer Arrays, single dimension Long Integer Arrays, String
  2322.        Constants, and String Variables.  Constants may be specified in decimal
  2323.        (base 10), hexidecimal (base 16), or binary (base 2).  The following
  2324.        describes the restrictions for each data type.
  2325.  
  2326.  
  2327.        INTEGER CONSTANTS   Range  +32767 to -32767
  2328.  
  2329.                            Example:       -26
  2330.  
  2331.        INTEGER VARIABLE    Described by a variable name beginning with a
  2332.                            letter, followed by up to 79 additional letters
  2333.                            or numbers.  It may contain a number in the range
  2334.                            +32767 to -32767.
  2335.  
  2336.                            Example:       VELOCITY1
  2337.  
  2338.        INTEGER ARRAY       Described by a variable name beginning with a
  2339.                            letter, followed by up to 79 additional letters
  2340.                            or numbers.  This name is followed by an
  2341.                            integer variable or constant for the dimension
  2342.                            of the array.  Arrays must be dimensioned at the
  2343.                            beginning of the program.  See the DIM statement.
  2344.                            
  2345.                            Example:       GROWTH (YEAR)
  2346.  
  2347.        LONG INTEGER        Range  +2,147,483,647 to -2,147,483,647
  2348.        CONSTANTS           
  2349.                            Example:       3234457&
  2350.  
  2351.        LONG INTEGER        Described by a variable name beginning with a
  2352.        VARIABLE            letter, followed by up to 78 additional letters or
  2353.                            numbers terminated with a "&".  Can contain
  2354.                            numbers in the range +2,147,483,647 to
  2355.                            -2,147,483,647.
  2356.  
  2357.                            Example:       VELOCITY1&
  2358.  
  2359.        LONG INTEGER        Described by a variable name beginning with a
  2360.        ARRAY               letter, followed by up to 78 additional letters or
  2361.                            numbers, terminated with a "&".  This name is
  2362.                            followed by an integer variable or constant for
  2363.                            the dimension of the array.  Arrays must be
  2364.                            dimensioned at the beginning of the program.
  2365.                            See the DIM statement.
  2366.  
  2367.                            Example:       GALAXY& (BILLIONSOF)
  2368.  
  2369.  
  2370.  
  2371.  
  2372.  
  2373.  
  2374.  
  2375.                                       Page - 35
  2376.  
  2377.  
  2378.  
  2379.  
  2380.  
  2381.  
  2382.                      CONSTANTS, VARIABLES, AND LABELS (Continued)
  2383.  
  2384.        HEXIDECIMAL         Hexidecimal constants are constants which are
  2385.        CONSTANT            stated in base 16 instead of base 10 like normal
  2386.                            constants.  These may be specified wherever you
  2387.                            can specify a decimal constant.  Hexidecimal
  2388.                            constants in ASIC must be prefixed by "&hex". This
  2389.                            prefix should be immediately followed by a valid
  2390.                            normal or long integer constant.  Hex constants
  2391.                            may contain up to 8 hexidecimal digits for long
  2392.                            constants, and 4 hexidecimal digits for normal
  2393.                            constants.
  2394.  
  2395.                            Example:  &hexB000   <--equivalent to -20400
  2396.  
  2397.                            Example:  &hexB&     <--equivalent to 11&
  2398.  
  2399.                            Example:  &hexFFFFFFFF&  <--equivalent to -1&
  2400.  
  2401.                            Example:  &hexB000&  <--equivalent to 45056&
  2402.  
  2403.        BINARY CONSTANT     Binary constants are constants which are stated in
  2404.                            base 2 instead of base 10 like normal constants.
  2405.                            These may be specified wherever you can specify a
  2406.                            decimal constant.  Binary constants in ASIC must
  2407.                            be prefixed by "&bin".  This prefix should be
  2408.                            immediately followed by a valid normal or long
  2409.                            integer constant.  Binary constants may contain
  2410.                            up to 32 binary digits for long constants or 16
  2411.                            binary digits for normal constants.
  2412.  
  2413.                            Example:  &bin10         <--equivalent to 2
  2414.  
  2415.                            Example:  &bin10101011&  <--equivalent to 171&
  2416.  
  2417.        STRING CONSTANT     A group of 0-80 characters enclosed by quotation
  2418.                            marks.
  2419.  
  2420.                            Example:       "This is a String Constant"
  2421.  
  2422.        STRING VARIABLE     Described by a variable name which begins with a
  2423.                            letter, followed by up to 78 additional
  2424.                            letters or numbers, terminated with a "$".
  2425.                            Can contain 0-80 characters.
  2426.  
  2427.                            Example:       ADDRESS$
  2428.  
  2429.        LABEL               A Label is a location in your program you wish
  2430.                            to transfer to.  It must begin with a letter,
  2431.                            and it may contain up to 78 additional letters
  2432.                            or numbers.  It must be terminated with a ":".
  2433.                  
  2434.                            Example:       START:
  2435.  
  2436.  
  2437.  
  2438.  
  2439.  
  2440.  
  2441.                                       Page - 36
  2442.  
  2443.  
  2444.  
  2445.  
  2446.  
  2447.  
  2448.                                VARIABLES VS. CONSTANTS
  2449.  
  2450.  
  2451.        In general, ASIC will allow the use of either variables, arrays, or
  2452.        constants as operands to any program statement.  For example:
  2453.  
  2454.  
  2455.                       PRINT CASH
  2456.                       PRINT 20
  2457.                       PRINT A(10)
  2458.  
  2459.        All three of the above examples are valid.  The only case where a
  2460.        constant cannot be used, is where the value is being modified.  For
  2461.        example:
  2462.  
  2463.                  A = A + B           <----VALID
  2464.                  17 = A + C          <----INVALID
  2465.  
  2466.        Of course you must specify the correct data type for the ASIC keyword.
  2467.        For example:
  2468.  
  2469.                  A = ABS("HELLO")    <----INVALID
  2470.  
  2471.  
  2472.        This statement is invalid because you cannot take the absolute value of
  2473.        a string!
  2474.  
  2475.        There are a few ASIC statements which will accept only integer constants
  2476.        for some operands (DIM, OPEN, PRINT#, INPUT#).  Refer to the individual
  2477.        statement for more information.
  2478.  
  2479.        Finally, there is a restriction on the use of subscripts for Arrays.  A
  2480.        subscript for an array cannot be another array.  For example:
  2481.  
  2482.  
  2483.                  A(I(1))             <----INVALID
  2484.                  A(I)                <----VALID
  2485.  
  2486.  
  2487.  
  2488.  
  2489.  
  2490.  
  2491.  
  2492.  
  2493.  
  2494.  
  2495.  
  2496.  
  2497.  
  2498.  
  2499.  
  2500.  
  2501.  
  2502.  
  2503.  
  2504.  
  2505.  
  2506.  
  2507.                                       Page - 37
  2508.  
  2509.  
  2510.  
  2511.  
  2512.  
  2513.  
  2514.  
  2515.  
  2516.  
  2517.                        CONVERSION BETWEEN LONG/NORMAL INTEGERS
  2518.  
  2519.  
  2520.        Long or normal integers may be used on any ASIC statement in any
  2521.        combination.  Consequently, in the "Keyword Reference" Chapter of this
  2522.        is manual, operands are identified only as "integer".  "Integer" in this
  2523.        context should be interpreted as meaning that the operand for that
  2524.        statement can be any of the following: integer constant, integer
  2525.        variable, integer array, long integer constant, long integer variable,
  2526.        or long integer array.  Exceptions, if any, are noted in the
  2527.        documentation for the statement.
  2528.  
  2529.        If you do mix long and normal integers in a statement, you should be
  2530.        aware of how ASIC converts between the two formats.  The following two
  2531.        rules are applied:
  2532.  
  2533.             1)  If a long integer variable or constant is being stored in a
  2534.                 normal integer variable, the long integer (32 bit) number    
  2535.                 will ALWAYS convert correctly to a normal integer (16 bit)   
  2536.                 value, provided the long integer variable contains a number
  2537.                 which will fit in a normal integer (ie, within the range of
  2538.                 +32767 to -32767).  If, however, the number is outside of
  2539.                 this range, ASIC will truncate it to make it fit in a normal
  2540.                 integer.  This truncation will cause some surprising (but
  2541.                 predictable) answers.  For example if "A&" contained the
  2542.                 value "50000&", and the following ASIC statement was executed
  2543.                 "A=A&", then the value of "A" would be "-15536".  The reason
  2544.                 that the overflow results in such a strange number is due to
  2545.                 the way the IBM PC stores numbers in binary format and is too
  2546.                 complicated to describe here.  The important thing
  2547.                 to remember is, for ASIC to convert from long integers to
  2548.                 normal integers correctly, the value in the long integer
  2549.                 should be in the range of +32767 to -32767.
  2550.  
  2551.             2)  If a normal integer variable or constant is being stored in
  2552.                 a long integer variable, ASIC will always convert the number
  2553.                 correctly.
  2554.  
  2555.  
  2556.  
  2557.  
  2558.  
  2559.  
  2560.  
  2561.  
  2562.  
  2563.  
  2564.  
  2565.  
  2566.  
  2567.  
  2568.  
  2569.  
  2570.  
  2571.  
  2572.  
  2573.                                       Page - 38
  2574.  
  2575.  
  2576.  
  2577.  
  2578.  
  2579.  
  2580.  
  2581.  
  2582.  
  2583.                                        A S I C
  2584.  
  2585.                                       Chapter 7
  2586.  
  2587.                                   Keyword Reference
  2588.  
  2589.  
  2590.  
  2591.  
  2592.                                          ABS
  2593.  
  2594.        Format:        integer1 = ABS (integer2)
  2595.  
  2596.        Description:
  2597.  
  2598.             This function returns the absolute value of integer2 which is then
  2599.        stored in integer1.
  2600.  
  2601.        Example:
  2602.  
  2603.                  A = ABS (-7)
  2604.  
  2605.        After execution of this statement, "A" will contain 7.
  2606.  
  2607.  
  2608.  
  2609.                                          ASC
  2610.  
  2611.        Format:        integer1 = ASC (string1)
  2612.  
  2613.        Description:
  2614.  
  2615.             This function returns the ASCII value of the first character of
  2616.        string1, storing the result in integer1.
  2617.  
  2618.        Example:
  2619.  
  2620.                  A = ASC("123")
  2621.  
  2622.        After execution of this statement "A" would contain 49, which the is
  2623.        ASCII value of "1".
  2624.  
  2625.  
  2626.  
  2627.  
  2628.  
  2629.  
  2630.  
  2631.  
  2632.  
  2633.  
  2634.  
  2635.  
  2636.  
  2637.  
  2638.  
  2639.                                       Page - 39
  2640.  
  2641.  
  2642.  
  2643.  
  2644.  
  2645.  
  2646.                                          BEEP
  2647.  
  2648.        Format:        BEEP
  2649.  
  2650.        Description:
  2651.  
  2652.             This statement will cause a short "beep" to be produced on the PC
  2653.        speaker.
  2654.  
  2655.        Example:
  2656.  
  2657.                  IF A>99 THEN
  2658.                       BEEP
  2659.                       PRINT "Number is too big!"
  2660.                       A=99
  2661.                  ENDIF
  2662.  
  2663.        The preceding program fragment will check to see if variable "A"
  2664.        contains a value less than 100.  If it does not, it will produce a short
  2665.        "beep", display a message, and set the value of "A" to 99.
  2666.  
  2667.  
  2668.  
  2669.  
  2670.  
  2671.  
  2672.  
  2673.  
  2674.  
  2675.  
  2676.  
  2677.  
  2678.  
  2679.  
  2680.  
  2681.  
  2682.  
  2683.  
  2684.  
  2685.  
  2686.  
  2687.  
  2688.  
  2689.  
  2690.  
  2691.  
  2692.  
  2693.  
  2694.  
  2695.  
  2696.  
  2697.  
  2698.  
  2699.  
  2700.  
  2701.  
  2702.  
  2703.  
  2704.  
  2705.                                       Page - 40
  2706.  
  2707.  
  2708.  
  2709.  
  2710.  
  2711.  
  2712.                                         BLOAD
  2713.  
  2714.        Format:        BLOAD string1, integer1, integer2
  2715.  
  2716.        Description:
  2717.  
  2718.             This function loads data previously saved by BSAVE from a file to
  2719.        memory.  String1 should be the name of the file previously created by
  2720.        BSAVE.  Integer1 should be the memory offset to load the data to.
  2721.        Integer2 should be the number of bytes to read from the file (in the
  2722.        range of 1 to 32767).  If DEFSEG has been set, it will be used as the
  2723.        data segment, otherwise, the default ASIC data segment will be used.
  2724.  
  2725.        Example:
  2726.  
  2727.                  DEFSEG = &hexB800
  2728.                  BLOAD "SAVED.DAT" 0 100
  2729.  
  2730.        After execution of these statements 100 bytes will be read from the file
  2731.        "SAVED.DAT" and stored in memory start at 0 bytes from the start of the
  2732.        override data segment (which in this case happens to point to the
  2733.        beginning of video memory for a CGA card).  Assuming a CGA card was
  2734.        present, the first 50 characters on the screen would contain data read
  2735.        from the file (don't forget that each screen character is represented by
  2736.        two bytes data and attribute, that's why only 50 characters will be
  2737.        displayed, assuming you are not in graphics mode).
  2738.  
  2739.        Comments:
  2740.  
  2741.             THIS FUNCTION IS RECOMMENDED ONLY FOR ADVANCED PROGRAMMERS.  THIS
  2742.        STATEMENT WILL ALLOW YOU TO OVERLAY ANY AREA OF MEMORY, AND IT IS VERY
  2743.        EASY TO ACCIDENTALLY OVERLAY YOUR PROGRAM OR THE MEMORY USED BY DOS.
  2744.  
  2745.             If ASIC detects an error executing this command, it will set the
  2746.        system ERROR variable.  These error codes are listed in the Error
  2747.        Messages Chapter of the ASIC Manual
  2748.  
  2749.             This statement is slightly different from GWBASIC/BASICA in that
  2750.        you must specify how many bytes to read from the file.  Also, the memory
  2751.        offset is not stored in the file by BSAVE, so you must specify the
  2752.        offset as integer1 in ASIC.  Offset is optional in GWBASIC/BASICA.
  2753.  
  2754.             ASIC uses a slightly different file format than GWBASIC/BASICA,
  2755.        however, it is relatively easy to convert the GWBASIC/BASICA to ASIC
  2756.        format.  GWBASIC/BASICA files have a seven byte header that ASIC does
  2757.        not have.  If you strip off these 7 bytes and rewrite the file, ASIC
  2758.        should be able to process the file.
  2759.  
  2760.        See also:
  2761.  
  2762.             DEFSEG,BSAVE
  2763.  
  2764.  
  2765.  
  2766.  
  2767.  
  2768.  
  2769.  
  2770.  
  2771.                                       Page - 41
  2772.  
  2773.  
  2774.  
  2775.  
  2776.  
  2777.  
  2778.                                         BSAVE
  2779.  
  2780.        Format:        BSAVE string1, integer1, integer2
  2781.  
  2782.        Description:   
  2783.             
  2784.             This statement writes the block of memory beginning at offset
  2785.        integer1 from the start of the data segment for a length of integer2
  2786.        bytes to the file specified by string1.  This data may be later loaded
  2787.        by BLOAD.  If DEFSEG has been set, it will be used as the data segment,
  2788.        otherwise, the default ASIC data segment will be used.
  2789.        Integer2 should be in the range of 1 to 32767.
  2790.  
  2791.        Example:
  2792.  
  2793.                  DEFSEG = &hexB800
  2794.                  BSAVE "SAVED.DAT" 0 4000
  2795.  
  2796.        After execution of these statements 4000 bytes at offset 0 bytes from
  2797.        the start of the override data segment (which in this case happens to
  2798.        point to the beginning of video memory for a CGA card) will be written
  2799.        to the file "SAVED.DAT".  Assuming a CGA card was present, the current
  2800.        screen would be saved to disk, assuming you are not in graphics mode.
  2801.  
  2802.        Comments:
  2803.  
  2804.             If ASIC detects an error executing this command, it will set the
  2805.        system ERROR variable.  These error codes are listed in the Error
  2806.        Messages Chapter of the ASIC Manual.
  2807.  
  2808.        See also:
  2809.  
  2810.             DEFSEG,BLOAD
  2811.  
  2812.  
  2813.  
  2814.  
  2815.  
  2816.  
  2817.  
  2818.  
  2819.  
  2820.  
  2821.  
  2822.  
  2823.  
  2824.  
  2825.  
  2826.  
  2827.  
  2828.  
  2829.  
  2830.  
  2831.  
  2832.  
  2833.  
  2834.  
  2835.  
  2836.  
  2837.                                       Page - 42
  2838.  
  2839.  
  2840.  
  2841.  
  2842.  
  2843.  
  2844.                                          CALL
  2845.  
  2846.        Format:        CALL (string1,string2)
  2847.  
  2848.        Description:
  2849.  
  2850.             This function can be used to load and execute other programs
  2851.        compiled with ASIC or another compiler.  String1 represents the name of
  2852.        the program to execute.  String2 contains any arguments to be passed to
  2853.        the program (it may be NULL, ie "").  If an error occurs when ASIC
  2854.        attempts to call the program, it will set the system ERROR variable to
  2855.        255.  Otherwise, the ERROR variable will be set to the value of the
  2856.        return code of the called program (which is 0 unless the called program
  2857.        specifies otherwise).
  2858.  
  2859.        Example:
  2860.                  CALL ("MYPROG.COM","")
  2861.                  REM other code follows
  2862.  
  2863.        This statement would cause ASIC to load and execute the program
  2864.        "MYPROG.COM".  No arguments will be passed to the program.  When MYPROG
  2865.        terminates, the calling program will regain control on the line
  2866.        following the call, in this case the "REM" statement.
  2867.  
  2868.        Example 2:
  2869.  
  2870.                  CALL ("COMMAND.COM"," /C WP.BAT")
  2871.  
  2872.        In this example, a ".BAT" type file is executed called "WP.BAT".  To run
  2873.        ".BAT" files, it is necessary to load a copy of COMMAND.COM as shown
  2874.        above (COMMAND.COM contains the DOS code required to load and execute
  2875.        ".BAT" files).  Using this format, you can also run some "built in" DOS
  2876.        commands such as DIR or SORT.  Using CALL with this format, is similar
  2877.        to using the GWBASIC/BASICA SHELL command.
  2878.  
  2879.        Comments:
  2880.  
  2881.             String1 must contain the FULL pathname of the program
  2882.        (ie,"\directory\progname.COM") only if the program is NOT in the current
  2883.        directory.  You must include the file extension on the file name (for
  2884.        example, use "MYPROG.COM" instead of just "MYPROG", or use "MYPROG.EXE"
  2885.        instead of "MYPROG").
  2886.  
  2887.             If you wish to pass arguments to the program build it as follows:
  2888.  
  2889.                  YOURPARM$ = "arguments"
  2890.                  N = LEN(YOURPARM$)
  2891.                  A$ = CHR$(N)
  2892.                  A$ = A$ + YOURPARM$
  2893.                  B$ = CHR$(13)
  2894.                  A$ = A$ + B$
  2895.                  CALL "progname" a$
  2896.  
  2897.  
  2898.  
  2899.  
  2900.  
  2901.  
  2902.  
  2903.                                       Page - 43
  2904.  
  2905.  
  2906.  
  2907.  
  2908.  
  2909.  
  2910.                                    CALL (Continued)
  2911.  
  2912.             The above creates an argument list according to the strict DOS
  2913.        calling rules, however, you can just create the arguments in a string,
  2914.        and precede them with a leading space.  This will work for arguments up
  2915.        to 32 characters in length (space character is ASCII 32).  You might
  2916.        want to try this short cut first, and only resort to the full formal
  2917.        approach if you have problems with it, or need to specify longer
  2918.        arguments:
  2919.  
  2920.                  CALL "progname" " arguments"
  2921.  
  2922.        CAUTION:
  2923.  
  2924.             You may use the debugger with programs which contain "CALL"
  2925.        statements.  However, the programs you call should not themselves
  2926.        contain debugging code.  For example, if A.ASI calls B.ASI, then make
  2927.        sure you compile B.ASI with the "Debugging Code" option OFF before you
  2928.        try to debug program A.ASI.  Failure to do so will cause the debugger to
  2929.        behave erratically.  This also applies to programs you write using other
  2930.        compilers, since they also use the same interrupt as ASIC (INT 3).
  2931.  
  2932.        See also:
  2933.  
  2934.             RUN,COMMAND$
  2935.  
  2936.  
  2937.  
  2938.                                         CHDIR
  2939.  
  2940.        Format:        CHDIR string1
  2941.  
  2942.        Description:
  2943.  
  2944.             This statement will change the current directory to that specified
  2945.        in string1.  If an error occurs when ASIC executes this command, it will
  2946.        set the System ERROR variable.  A list of possible error codes is listed
  2947.        in the Error Messages Chapter of the ASIC Manual.
  2948.  
  2949.        Example:
  2950.  
  2951.             CHDIR "\DOS"
  2952.             IF ERROR = 0 THEN NOERROR:
  2953.  
  2954.        If Drive "C" was the current drive, then this statement would change the
  2955.        current directory to "C:\DOS".
  2956.  
  2957.             CHDIR "C:\DOS"
  2958.  
  2959.        This statement would change the current directory on drive C to "C:\DOS"
  2960.        whether or not drive C is the current drive. It would NOT change the
  2961.        default drive to "C".  Note that DOS retains a current directory for
  2962.        each disk drive on your computer.
  2963.  
  2964.        See also:
  2965.  
  2966.             MKDIR, RMDIR
  2967.  
  2968.  
  2969.                                       Page - 44
  2970.  
  2971.  
  2972.  
  2973.  
  2974.  
  2975.  
  2976.                                          CHR$
  2977.  
  2978.        Format:        string1 = CHR$(integer1)
  2979.  
  2980.        Description:
  2981.  
  2982.             This function converts an integer in the range of 0-255 to an
  2983.        ASCII character, and stores in string1.
  2984.  
  2985.        Example:
  2986.  
  2987.                  A$ = CHR$(49)
  2988.  
  2989.        After execution of this statement, "A$" will contain "1", since "1" is
  2990.        represented by ASCII 49.
  2991.  
  2992.        Comments:
  2993.  
  2994.                  If integer1 is outside the range 0-255, then the least
  2995.        significant byte of integer 1 is converted to string1.
  2996.  
  2997.  
  2998.  
  2999.                                         CLOSE
  3000.  
  3001.        Format:        CLOSE integer1
  3002.  
  3003.        Description:
  3004.  
  3005.             This function closes the file number identified by integer1.  If an
  3006.        error is returned by DOS, the system variable "ERROR" will be > 0.
  3007.  
  3008.        Example:
  3009.  
  3010.                  CLOSE 1
  3011.                  IF ERROR > 0 THEN CHECKERROR:
  3012.  
  3013.        After successful execution of the CLOSE statement, the file previously
  3014.        opened as file 1 will be closed.  If an error is returned by DOS, the
  3015.        ERROR variable will be set by ASIC to a non-zero value.
  3016.  
  3017.        Comments:
  3018.  
  3019.             IF YOU FAIL TO CLOSE AN OPEN FILE (WHICH WAS OPENED FOR WRITING),
  3020.        YOU MAY LOSE DATA, SINCE FILE I/O IS BUFFERED, AND THE LAST BUFFER MAY
  3021.        NOT HAVE BEEN FLUSHED.
  3022.  
  3023.             Also, integer1 may only be a constant with the value of 1-3.
  3024.  
  3025.        See Also:
  3026.  
  3027.             OPEN,PRINT#,INPUT#
  3028.  
  3029.  
  3030.  
  3031.  
  3032.  
  3033.  
  3034.  
  3035.                                       Page - 45
  3036.  
  3037.  
  3038.  
  3039.  
  3040.  
  3041.  
  3042.                                          CLS
  3043.  
  3044.        Format:        CLS
  3045.  
  3046.        Description:
  3047.  
  3048.             This function clears the screen.
  3049.  
  3050.        Example:
  3051.  
  3052.             CLS
  3053.  
  3054.        After execution of the above statement, the screen will be cleared.
  3055.  
  3056.  
  3057.  
  3058.                                          CODE
  3059.  
  3060.        Format:        CODE integer1[,integer2...integerN]
  3061.  
  3062.        Description:
  3063.  
  3064.             This function may be used to insert machine language code directly
  3065.        into your program.  Integer1 through integerN should be constants in the
  3066.        range of 0-255.  At least one integer must be specified, however, ASIC
  3067.        will allow up to 30.
  3068.  
  3069.        Example:
  3070.                  CODE 205,5
  3071.  
  3072.        This statement represent the machine code generated from the assembly
  3073.        language statement "INT 5".  INT 5 is the BIOS routine which will print
  3074.        the screen to the printer.  After execution of these statements in your
  3075.        program, the current screen contents would be printed on your printer.
  3076.  
  3077.        Comments:
  3078.  
  3079.             THIS STATEMENT IS INTENDED FOR ADVANCED PROGRAMMERS.  THIS
  3080.        STATEMENT IS VERY POWERFUL, AND IF YOU DON'T UNDERSTAND MACHINE LANGUAGE
  3081.        YOU COULD EASILY CRASH YOUR PROGRAM.
  3082.  
  3083.             When you use this statement, be sure to save the contents of the
  3084.        following 8088 registers if you plan to modify them, and restore them
  3085.        before returning to ASIC.  Otherwise the results may be unpredictable.
  3086.        Registers:  DS/CS/ES/SS.  Also, make sure you clean up the stack before
  3087.        you return (ie, if you push a value to the stack, make sure you pop it
  3088.        before you return to ASIC)  Failure to do so, will almost certainly
  3089.        cause your program to crash.
  3090.  
  3091.  
  3092.  
  3093.  
  3094.  
  3095.  
  3096.  
  3097.  
  3098.  
  3099.  
  3100.  
  3101.                                       Page - 46
  3102.  
  3103.  
  3104.  
  3105.  
  3106.  
  3107.  
  3108.                                         COLOR
  3109.  
  3110.        Format:        COLOR integer1,integer2
  3111.  
  3112.        Description:
  3113.  
  3114.             This function is used to set the foreground and background screen
  3115.        colors.  The foreground color is specified in integer1, the background
  3116.        color in integer2.
  3117.  
  3118.                       Valid Colors:       Foreground       Background
  3119.                                           ----------       ----------
  3120.                       Black                    0              0
  3121.                       Blue                     1              1
  3122.                       Green                    2              2
  3123.                       Cyan                     3              3
  3124.                       Red                      4              4
  3125.                       Magenta                  5              5
  3126.                       Brown                    6              6
  3127.                       White                    7              7
  3128.                       Dark Gray                8              
  3129.                       Light Blue               9    
  3130.                       Light Green              10
  3131.                       Light Cyan               11
  3132.                       Light Red                12
  3133.                       Light Magenta            13
  3134.                       Yellow                   14
  3135.                       Bright White             15
  3136.  
  3137.                  Note:   Colors 8-15 when specified for background color
  3138.                            result in blinking text.
  3139.  
  3140.        Example:
  3141.  
  3142.                  COLOR 4,8
  3143.  
  3144.        After execution of this statement, future characters written to the
  3145.        screen will be Blinking Red on a Black Background.
  3146.  
  3147.  
  3148.  
  3149.  
  3150.  
  3151.  
  3152.  
  3153.  
  3154.  
  3155.  
  3156.  
  3157.  
  3158.  
  3159.  
  3160.  
  3161.  
  3162.  
  3163.  
  3164.  
  3165.  
  3166.  
  3167.                                       Page - 47
  3168.  
  3169.  
  3170.  
  3171.  
  3172.  
  3173.  
  3174.                                        COMMAND$
  3175.  
  3176.        Format:        string1 = COMMAND$
  3177.  
  3178.        Description:
  3179.  
  3180.             This statements retrieves any command line arguments that were
  3181.        entered and stores them in string1.
  3182.  
  3183.        Example:
  3184.                  If your program was invoked with:       MYPROG XXX
  3185.  
  3186.                  And if your program MYPROG.ASI contained the following:
  3187.  
  3188.                       A$=COMMAND$
  3189.                       PRINT A$
  3190.  
  3191.  
  3192.        After execution of these statements, the screen would display " XXX".
  3193.  
  3194.        Comments:
  3195.  
  3196.             In the integrated environment, you can specify command line
  3197.        arguments on the "Run" Menu.
  3198.  
  3199.             This statement is an extension over BASICA/GWBASIC.
  3200.  
  3201.  
  3202.  
  3203.  
  3204.  
  3205.  
  3206.  
  3207.  
  3208.  
  3209.  
  3210.  
  3211.  
  3212.  
  3213.  
  3214.  
  3215.  
  3216.  
  3217.  
  3218.  
  3219.  
  3220.  
  3221.  
  3222.  
  3223.  
  3224.  
  3225.  
  3226.  
  3227.  
  3228.  
  3229.  
  3230.  
  3231.  
  3232.  
  3233.                                       Page - 48
  3234.  
  3235.  
  3236.  
  3237.  
  3238.  
  3239.  
  3240.                                        COMSTAT
  3241.  
  3242.        Format:        integer1 = COMSTAT (integer2)
  3243.  
  3244.        Description:
  3245.  
  3246.             This statement returns the status of a com port.  Integer2 should
  3247.        contain "0" for COM1, or "1" for COM2.  The status of that COM port is
  3248.        returned in integer1.  Each bit in integer1 represents a different piece
  3249.        of information.  These are described in the table below.  Note that you
  3250.        may test if a bit is on/off using the ZBIT command.
  3251.  
  3252.        Example:
  3253.  
  3254.             PORTSTAT = COMSTAT (0)
  3255.             DATAREADY = ZBIT(8,PORTSTAT)
  3256.             IF DATAREADY = 1 THEN GORECEIVE:
  3257.  
  3258.        These statements do the following.  The first retrieves the status of
  3259.        COM1 to the variable PORTSTAT.  The second checks to see if bit 8 is on,
  3260.        DATAREADY will contain 1 if so, otherwise it will contain 0.  Since Bit
  3261.        8 is used to determine if data is waiting to be received from the port,
  3262.        if DATAREADY = 1 then the program will transfer to the label GORECEIVE:
  3263.        which would contain code to RECEIVE data from the port.
  3264.  
  3265.        Comments:
  3266.  
  3267.             Status Codes Returned by COMSTAT (Meaning when set to 1)
  3268.  
  3269.             Bit 0     Delta clear-to-send
  3270.                 1     Delta data-set-ready
  3271.                 2     Trailing-edge ring detector
  3272.                 3     Delta receive line signal detect
  3273.                 4     Clear-to-send
  3274.                 5     Data-set-ready
  3275.                 6     Ring Indicator
  3276.                 7     Received line signal detect
  3277.                 8     Data Ready
  3278.                 9     Overrun error
  3279.                10     Parity error
  3280.                11     Framing error
  3281.                12     Break-detect error
  3282.                13     Transfer holding register empty
  3283.                14     Transfer shift-register empty
  3284.                15     Time-out error
  3285.  
  3286.  
  3287.        See also:
  3288.  
  3289.             OPENCOM,SEND,RECEIVE
  3290.  
  3291.  
  3292.  
  3293.  
  3294.  
  3295.  
  3296.  
  3297.  
  3298.  
  3299.                                       Page - 49
  3300.  
  3301.  
  3302.  
  3303.  
  3304.  
  3305.  
  3306.                                         CSRLIN
  3307.  
  3308.        Format:        integer1 = CSRLIN
  3309.  
  3310.        Description:
  3311.  
  3312.             This function returns row of the cursor.
  3313.  
  3314.        Example:
  3315.  
  3316.                       LOCATE 10,20
  3317.                       A = CSRLIN
  3318.  
  3319.        The locate command will have positioned the cursor in row 10, column 20.
  3320.        After execution of the CSRLIN statement, "A" will contain the value of
  3321.        10.
  3322.  
  3323.        See also:
  3324.  
  3325.             POS
  3326.  
  3327.  
  3328.  
  3329.  
  3330.  
  3331.  
  3332.  
  3333.  
  3334.  
  3335.  
  3336.  
  3337.  
  3338.  
  3339.  
  3340.  
  3341.  
  3342.  
  3343.  
  3344.  
  3345.  
  3346.  
  3347.  
  3348.  
  3349.  
  3350.  
  3351.  
  3352.  
  3353.  
  3354.  
  3355.  
  3356.  
  3357.  
  3358.  
  3359.  
  3360.  
  3361.  
  3362.  
  3363.  
  3364.  
  3365.                                       Page - 50
  3366.  
  3367.  
  3368.  
  3369.  
  3370.  
  3371.  
  3372.                                          DATA
  3373.  
  3374.        Format:        DATA constant1[,constant2,...,constantn]
  3375.  
  3376.        Description:
  3377.  
  3378.             This statement is used store integer and string constants in memory
  3379.        for later retrieval by READ statements.  At least one integer or string
  3380.        constant must be specified, although multiples of each type are
  3381.        permitted.
  3382.  
  3383.        Example:
  3384.  
  3385.             DATA 1,"APPLE",2&,"ORANGES"
  3386.  
  3387.  
  3388.             READ A
  3389.             READ A$
  3390.             READ B&
  3391.             READ B$
  3392.  
  3393.        The above statements are equivalent of entering the following code:
  3394.  
  3395.             A=1
  3396.             A$="APPLE"
  3397.             B&=2&
  3398.             B$="ORANGES"
  3399.  
  3400.        Comments:
  3401.  
  3402.             All DATA Statements must be placed at the beginning of the program,
  3403.        before all other statement types, except DIM or REM statements (or blank
  3404.        lines).  DIM statements, if specified, must precede all other statements
  3405.        including DATA statements except REM statements (or blank lines).  As
  3406.        long as you follow these rules, you may specify an unlimited number of
  3407.        DATA statements.
  3408.  
  3409.             GWBASIC/BASICA does not require quotes around string constants in
  3410.        some instances.  ASIC always requires quotes around string constants.
  3411.  
  3412.        See also:
  3413.  
  3414.             READ,RESTORE
  3415.  
  3416.  
  3417.  
  3418.  
  3419.  
  3420.  
  3421.  
  3422.  
  3423.  
  3424.  
  3425.  
  3426.  
  3427.  
  3428.  
  3429.  
  3430.  
  3431.                                       Page - 51
  3432.  
  3433.  
  3434.  
  3435.  
  3436.  
  3437.  
  3438.                                         DATE$
  3439.  
  3440.        Format:        string1 = DATE$
  3441.  
  3442.        Description:
  3443.  
  3444.             This function returns the value of the system date in the format of
  3445.        "MM-DD-YYYY".
  3446.  
  3447.        Example:
  3448.  
  3449.             A$=DATE$
  3450.             PRINT A$
  3451.  
  3452.        After executing these statements, the date stored in the PC
  3453.         System Clock will be displayed on the screen.
  3454.  
  3455.  
  3456.        Comments:
  3457.  
  3458.  
  3459.             Note:  if the date printed is wrong, you have probably not set the
  3460.        system clock.  Most older XTs and PCs do not have a battery to preserve
  3461.        the DATE and TIME in the system clock, so you have to set them each time
  3462.        you power up the PC.  Most ATs and newer PCs have a battery backup, so
  3463.        that the date is preserved for you.
  3464.  
  3465.             Unlike GWBASIC/BASICA, you cannot set the system date with DATE$,
  3466.        however, you can set the system date from DOS by typing DATE.
  3467.  
  3468.        See also:
  3469.  
  3470.             TIME$, TIMER
  3471.  
  3472.  
  3473.  
  3474.                                         DEFSEG
  3475.  
  3476.        Format:        DEFSEG = integer1
  3477.  
  3478.             This function is used the alter the default data segment used when
  3479.        peeking and poking data with PEEK and POKE statements.  DEFSEG, PEEK,
  3480.        and especially POKE are not recommended for beginners.  If integer1 =-1,
  3481.        then the data segment address is set back to the ASIC default data
  3482.        segment address.
  3483.  
  3484.        Example:
  3485.  
  3486.             DEFSEG = -1
  3487.  
  3488.        Execution of the above statement would reset the default data segment to
  3489.        the default ASIC data segment.
  3490.  
  3491.        See also:
  3492.  
  3493.             PEEK, POKE, BLOAD, BSAVE
  3494.  
  3495.  
  3496.  
  3497.                                       Page - 52
  3498.  
  3499.  
  3500.  
  3501.  
  3502.  
  3503.  
  3504.                                          DIM
  3505.  
  3506.        Format:        DIM variable(integer1)
  3507.  
  3508.  
  3509.        Description:
  3510.                  
  3511.             This statement will create one dimensional arrays.  An integer
  3512.        variable name must be specified in variable.  Integer 1 contains the
  3513.        number of elements in the array.
  3514.  
  3515.        Example:
  3516.  
  3517.                  DIM A(10)
  3518.                  DIM A&(20)
  3519.  
  3520.        In this example an array of 10 normal integer variables is defined, and
  3521.        an array of 20 long integer variables is defined.
  3522.  
  3523.        Comments:
  3524.  
  3525.             On the DIM statement, integer1 may only be a constant.  Also, DIM
  3526.        statements must appear before all other statement types in the program
  3527.        except REM statements (or blank lines).
  3528.  
  3529.  
  3530.  
  3531.                                          END
  3532.  
  3533.        Format:        END [(integer1)]
  3534.  
  3535.        Description:
  3536.             
  3537.             This statement causes your program to terminate and return to DOS,
  3538.        optionally setting a return code.  Integer1 may be optionally specified
  3539.        to set the return code.  If omitted, ASIC uses a return code of zero by
  3540.        default.
  3541.  
  3542.        Example:
  3543.  
  3544.                  END
  3545.  
  3546.        In this example, the program will terminate and return to DOS with a
  3547.        return code of zero.
  3548.  
  3549.                  END (20)
  3550.  
  3551.        In this example, the program will terminate and return to DOS with a
  3552.        return code of "20".
  3553.  
  3554.        Comments:
  3555.  
  3556.             The optional return code is an extension over GWBASIC/BASICA.
  3557.  
  3558.  
  3559.  
  3560.  
  3561.  
  3562.  
  3563.                                       Page - 53
  3564.  
  3565.  
  3566.  
  3567.  
  3568.  
  3569.  
  3570.                                        ENVIRON$
  3571.  
  3572.        Format:        string1 = ENVIRON$(integer1)
  3573.  
  3574.        Description:
  3575.  
  3576.             This statement will retrieve DOS environment strings.  Integer1
  3577.        identifies which string to retrieve.  If found, the string is placed in
  3578.        string1.  If not found, a NULL string (length=0) is stored in string1.
  3579.  
  3580.        Example:
  3581.  
  3582.             FOR I=1 TO 5
  3583.                  A$=ENVIRON$(1)
  3584.                  PRINT A$
  3585.             NEXT I
  3586.             
  3587.        The above example will retrieve the first five DOS environment strings
  3588.        and display them.
  3589.  
  3590.        Comments:
  3591.  
  3592.             If the requested DOS environment string entry is greater than 80
  3593.        characters in length, ASIC will truncate it at 80 characters.
  3594.        Environment strings may be set in DOS using the SET command.
  3595.        Environment strings are one way of passing information to your program.
  3596.        Refer to your MS DOS Manual for more information.
  3597.  
  3598.  
  3599.  
  3600.  
  3601.  
  3602.  
  3603.  
  3604.  
  3605.  
  3606.  
  3607.  
  3608.  
  3609.  
  3610.  
  3611.  
  3612.  
  3613.  
  3614.  
  3615.  
  3616.  
  3617.  
  3618.  
  3619.  
  3620.  
  3621.  
  3622.  
  3623.  
  3624.  
  3625.  
  3626.  
  3627.  
  3628.  
  3629.                                       Page - 54
  3630.  
  3631.  
  3632.  
  3633.  
  3634.  
  3635.  
  3636.                                        FILEPOS
  3637.  
  3638.        Format:        integer1 = FILEPOS (integer2,integer3)   <--Format 1
  3639.                       integer1 = FILEPOS (integer2,EOF)        <--Format 2
  3640.                       integer1 = FILEPOS (integer2,CURRENT)    <--Format 3
  3641.  
  3642.        Description:
  3643.  
  3644.             This statement is used to set or retrieve the read/write position
  3645.        for files opened in Random mode.  In all three formats, integer2 is the
  3646.        file number of the file.  This file number must have been previously
  3647.        opened for Random mode by the OPEN statement.  Format 1 is used to set
  3648.        the current read/write position of the file specified by integer2.
  3649.        Integer3 should be the offset (in bytes) from the start of the file.
  3650.        Format 2 is used to set a read/write position of a random file to the
  3651.        end of the file.  Format 3 is used to retrieve the current read/write
  3652.        position (as a byte offset from the beginning of the file) of the file.
  3653.        In all cases, if an error occurs, the system ERROR variable will be set.
  3654.        A list of these codes is contained in the Error Codes Chapter of the
  3655.        ASIC Manual.  If no error occurs, then integer1 will be set to the
  3656.        current read/write position of the file.
  3657.  
  3658.        Example 1:
  3659.  
  3660.             A&=FILEPOS(1, 100)
  3661.  
  3662.        This example assumes that file 1 was previously opened for RANDOM I/O
  3663.        using the OPEN statement.  After execution of this statement, the
  3664.        read/write position of file number 1 will be set to 100.  Subsequent
  3665.        PRINT # statements would write to the file starting at position 101.
  3666.  
  3667.        Example 2:
  3668.  
  3669.             A&=FILEPOS(1,EOF)
  3670.  
  3671.        This example assumes that file 1 was previously opened for RANDOM I/O
  3672.        using the OPEN statement.  After execution of this statement, the
  3673.        read/write position of file number 1 will be set to the end of the file.
  3674.        Subsequent PRINT # operations to this file will result in data being
  3675.        appended to this file.
  3676.  
  3677.        Example 3:
  3678.  
  3679.             A&=FILEPOS(1,CURRENT)
  3680.  
  3681.        This example assumes that file 1 was previously opened for RANDOM I/O
  3682.        using the OPEN statement.  After execution of this statement, the
  3683.        current read/write position of file number 1 will retrieved and stored
  3684.        in integer1.  The read/write position of file number 1 will NOT be
  3685.        altered after execution of this statement.
  3686.  
  3687.  
  3688.  
  3689.  
  3690.  
  3691.  
  3692.  
  3693.  
  3694.  
  3695.                                       Page - 55
  3696.  
  3697.  
  3698.  
  3699.  
  3700.  
  3701.  
  3702.                                  FILEPOS (Continued)
  3703.  
  3704.        Comments:
  3705.  
  3706.             If you wish to use this command with files larger than 32767 bytes,
  3707.        you should use long integers with this statement.  If you set the
  3708.        read/write position past the physical end of file and attempt to read
  3709.        from the file, you will receive an error on the INPUT# command.  If you
  3710.        set the read/write position past the end of file and issue a PRINT#
  3711.        command, the data will be correctly written at the position you
  3712.        specified.
  3713.        
  3714.        See also:
  3715.  
  3716.             OPEN, INPUT#, PRINT#, CLOSE
  3717.  
  3718.  
  3719.  
  3720.  
  3721.  
  3722.  
  3723.  
  3724.  
  3725.  
  3726.  
  3727.  
  3728.  
  3729.  
  3730.  
  3731.  
  3732.  
  3733.  
  3734.  
  3735.  
  3736.  
  3737.  
  3738.  
  3739.  
  3740.  
  3741.  
  3742.  
  3743.  
  3744.  
  3745.  
  3746.  
  3747.  
  3748.  
  3749.  
  3750.  
  3751.  
  3752.  
  3753.  
  3754.  
  3755.  
  3756.  
  3757.  
  3758.  
  3759.  
  3760.  
  3761.                                       Page - 56
  3762.  
  3763.  
  3764.  
  3765.  
  3766.  
  3767.  
  3768.                                          FIND
  3769.  
  3770.        Format:        string1=FIND FIRST (string2,integer1)
  3771.                       string1=FIND CONTINUE
  3772.  
  3773.        Description:
  3774.  
  3775.             The FIND command is used to search the current file directory for
  3776.        file(s) which match a search string.  This command has two versions.
  3777.        FIND FIRST must be used to establish a new search and retrieve the first
  3778.        matching file name.  Thereafter, the FIND CONTINUE will retrieve
  3779.        additional file names which match the search string.  When performing
  3780.        the FIND FIRST, string2 should contain the full or partial file name to
  3781.        be searched for.  This string can be up to 8 alphanumeric characters
  3782.        optionally followed by a period and up to 3 alphanumeric characters for
  3783.        the file extension.  Standard DOS wild cards "*" and "?" may be included
  3784.        in the search string.  Integer1 is used to specify a file attribute.  If
  3785.        integer1 is "0", then all normal files in the directory will be
  3786.        searched.  (A normal file is one in which the hidden, system, volume
  3787.        label, or directory attribute bit is NOT set).  Setting various bits
  3788.        (see table below) of integer1 ON will expand the search to include
  3789.        normal files, plus those whose attributes have been specified in
  3790.        integer1.  If a matching file name is found, then it will be stored in
  3791.        string1.  If an error occurs, then the system ERROR variable will be
  3792.        set.  A list of ERROR codes is contained in the ERROR code chapter of
  3793.        the ASIC Manual.  After the initial FIND FIRST has been performed, you
  3794.        may search for additional files which match the search string and
  3795.        attribute by issuing a FIND CONTINUE statement.
  3796.  
  3797.        Search Attributes bits (integer1)
  3798.        --------------------------------
  3799.  
  3800.        BIT
  3801.  
  3802.        0    Not Used
  3803.        1    Hidden
  3804.        2    System
  3805.        3    Volume Label
  3806.        4    Subdirectory
  3807.        5-7  Not Used
  3808.  
  3809.        Note that these attributes can all be specified simultaneously.  For
  3810.        example, to specify both hidden and system, use an attribute value of
  3811.        &bin00000110 (in binary) or 6 (in decimal).
  3812.  
  3813.  
  3814.  
  3815.  
  3816.  
  3817.  
  3818.  
  3819.  
  3820.  
  3821.  
  3822.  
  3823.  
  3824.  
  3825.  
  3826.  
  3827.                                       Page - 57
  3828.  
  3829.  
  3830.  
  3831.  
  3832.  
  3833.  
  3834.                                    FIND (Continued)
  3835.  
  3836.        Example:
  3837.  
  3838.                  SEARCH$="*.ASI"
  3839.                  ATTRIB=0
  3840.                  FILENAME$=FIND FIRST (SEARCH$,ATTRIB)
  3841.                  IF ERROR>0 THEN DONE:
  3842.                  PRINT A$
  3843.             LOOP:FILENAME$=FIND CONTINUE
  3844.                  IF ERROR>0 THEN DONE:
  3845.                  PRINT A$
  3846.                  GOTO LOOP
  3847.             DONE: PRINT "ALL MATCHING FILES DISPLAYED"
  3848.             END
  3849.  
  3850.        After execution of the above statements, all of the files with a file
  3851.        extension of ".ASI" in the current directory will be displayed on the
  3852.        screen.
  3853.  
  3854.        Comments:
  3855.  
  3856.             If you execute a FIND CONTINUE without executing a FIND FIRST, then
  3857.        the results are unpredictable.  Additional information is retrieved by
  3858.        the FIND command besides the file name.  Advanced programmers can also
  3859.        find additional information using the PEEK command starting at offset
  3860.        149 (from the default ASIC data segment).  Do not modify this data.  If
  3861.        you do so, the results are unpredictable.
  3862.  
  3863.  
  3864.        Additional File Information
  3865.        ---------------------------
  3866.  
  3867.        Address   Size (bytes)   Description
  3868.  
  3869.  
  3870.        149       1              File Attribute
  3871.        150       2              File Time Stamp
  3872.        152       2              File Date Stamp
  3873.        154       4              File Size (bytes)
  3874.  
  3875.  
  3876.        See also:
  3877.  
  3878.             NAME, KILL, GETDIR, CHDIR, MKDIR, RMDIR
  3879.  
  3880.  
  3881.  
  3882.  
  3883.  
  3884.  
  3885.  
  3886.  
  3887.  
  3888.  
  3889.  
  3890.  
  3891.  
  3892.  
  3893.                                       Page - 58
  3894.  
  3895.  
  3896.  
  3897.  
  3898.  
  3899.  
  3900.                                        FOR/NEXT
  3901.  
  3902.        Format:        FOR integer1 = integer2 to integer3
  3903.                       NEXT integer1
  3904.  
  3905.        Description:
  3906.  
  3907.             These two statements are used to create a loop, so that you can
  3908.        execute a portion of your program a certain number of times.  All of the
  3909.        code between the FOR and the NEXT statement will be executed a certain
  3910.        number of times, but at least once.  The actual number of times the loop
  3911.        executes is dependent on integer1/integer2/integer3.
  3912.        When the FOR statement is encountered in your program, integer1 is
  3913.        assigned the value of integer2.  Then the statements up to the matching
  3914.        NEXT statement is executed one time.  Then, 1 is added to integer1, and
  3915.        integer1 is compared to integer3.  If integer1 is greater than integer3
  3916.        then the control passes to the statement following NEXT.  Otherwise, the
  3917.        program loops back up to the statement following the FOR statement.
  3918.  
  3919.        Example:
  3920.  
  3921.                  FOR I = 1 TO 2
  3922.                       FOR J = 3 TO 5
  3923.                            PRINT I;
  3924.                            PRINT J
  3925.                       NEXT J
  3926.                  NEXT I
  3927.                  PRINT "AFTER THE LOOP";
  3928.                  PRINT I;
  3929.                  PRINT J;
  3930.  
  3931.        Execution of this section of code would result in the following
  3932.        printout:
  3933.  
  3934.                  1    3
  3935.                  1    4
  3936.                  1    5
  3937.                  2    3
  3938.                  2    4
  3939.                  2    5
  3940.                  AFTER THE LOOP    3    6
  3941.  
  3942.        Comments:
  3943.             
  3944.             Unlike BASICA/GWBASIC, ASIC FOR/NEXT loops execute at least 1 time.
  3945.        For example, the value "HELLO" will be printed in the following example.
  3946.        It wouldn't have been in BASICA/GWBASIC.
  3947.  
  3948.                  FOR I = 1 TO 0
  3949.                       PRINT "HELLO"
  3950.                  NEXT I
  3951.  
  3952.  
  3953.  
  3954.  
  3955.  
  3956.  
  3957.  
  3958.  
  3959.                                       Page - 59
  3960.  
  3961.  
  3962.  
  3963.  
  3964.  
  3965.  
  3966.                                  FOR/NEXT (Continued)
  3967.  
  3968.             Unlike GWBASIC/BASICA, arrays may be used for integer1 and
  3969.        integer2.  However, if integer3 is an array, element zero will be used,
  3970.        regardless of the subscript you specify.
  3971.  
  3972.             ASIC will allow you to modify the value of integer3, while
  3973.        GWBASIC/BASICA ignores changes.
  3974.  
  3975.                  J=1
  3976.                  FOR I=1 TO J
  3977.                       J=2
  3978.                  NEXT I
  3979.  
  3980.             The above loop will execute one time in GWBASIC/BASICA, but it will
  3981.        execute two times in ASIC.
  3982.  
  3983.  
  3984.  
  3985.                                         GETDIR
  3986.  
  3987.        Format:        string1=GETDIR (integer1)
  3988.  
  3989.        Description:
  3990.  
  3991.             This statement is used to retrieve the current DOS directory.
  3992.        Integer1 should be set to "0" to obtain the directory for the current
  3993.        drive, "1" for the "A" drive, "2" for the "B" drive, etc.  If the
  3994.        statement is unsuccessful, the system ERROR variable will be set.  A
  3995.        complete list of ERROR codes is contained in the Error Code Chapter of
  3996.        the ASIC Manual.  The directory string will be stored in string1.  The
  3997.        directory string will not contain the drive letter, or the first "\".
  3998.        Thus, if the current directory on the specified drive was "C:\ASIC",
  3999.        then GETDIR would return "ASIC".  If the current directory was the root
  4000.        (eg, "C:\"), then GETDIR would return a NULL string ("").
  4001.  
  4002.        Example:
  4003.  
  4004.             A$=GETDIR(0)
  4005.  
  4006.        After execution of this statement, the variable A$ will contain the name
  4007.        of current directory on the current disk drive.
  4008.  
  4009.        See also:
  4010.  
  4011.             FIND, MDKIR, RMDIR, CHDIR
  4012.  
  4013.  
  4014.  
  4015.  
  4016.  
  4017.  
  4018.  
  4019.  
  4020.  
  4021.  
  4022.  
  4023.  
  4024.  
  4025.                                       Page - 60
  4026.  
  4027.  
  4028.  
  4029.  
  4030.  
  4031.  
  4032.                                         GOSUB
  4033.  
  4034.        Format:        GOSUB label1
  4035.  
  4036.        Description:
  4037.  
  4038.             This statement "calls" a subroutine called "label1".  This
  4039.        subroutine must contain a "RETURN".  After the subroutine is executed,
  4040.        control is returned to the next statement following the GOSUB.
  4041.  
  4042.        Example:
  4043.  
  4044.                  GOSUB PRINTIT:
  4045.                  PRINT "All Done!"
  4046.                  END
  4047.                  PRINTIT:  PRINT "It"
  4048.                  RETURN
  4049.  
  4050.        After execution of this code the screen would contain:
  4051.  
  4052.                  It
  4053.                  All Done!
  4054.  
  4055.  
  4056.  
  4057.                                          GOTO
  4058.  
  4059.        Format:        GOTO label1
  4060.  
  4061.        Description:
  4062.  
  4063.             This statement transfers program execution to the statement
  4064.        identified by label1.
  4065.  
  4066.        Example:
  4067.  
  4068.                  GOTO SKIPIT:
  4069.                  PRINT "YOU'LL NEVER GET HERE"
  4070.                  SKIPIT: PRINT "ALL DONE!"
  4071.  
  4072.        After execution of this code, the screen will appear as follows:
  4073.  
  4074.                  ALL DONE!
  4075.  
  4076.        Note that the first print statement never executes because of the GOTO.
  4077.  
  4078.  
  4079.  
  4080.  
  4081.  
  4082.  
  4083.  
  4084.  
  4085.  
  4086.  
  4087.  
  4088.  
  4089.  
  4090.  
  4091.                                       Page - 61
  4092.  
  4093.  
  4094.  
  4095.  
  4096.  
  4097.  
  4098.                                   IF/THEN/ELSE/ENDIF
  4099.  
  4100.        Format:        IF condition THEN label1                  <--Format 1
  4101.                       IF condition THEN label1 ELSE label2      <--Format 2
  4102.  
  4103.                       IF condition THEN                         <--Format 3
  4104.                            <zero or more ASIC statements>
  4105.                       ENDIF
  4106.  
  4107.                       IF condition THEN                         <--Format 4
  4108.                            <zero or more ASIC statements>
  4109.                       ELSE
  4110.                            <zero or more ASIC statements>
  4111.                       ENDIF
  4112.  
  4113.        Description:
  4114.  
  4115.             This statement is used to conditionally transfer to a different
  4116.        location in the program.  The operand "condition" is one of the
  4117.        following:
  4118.  
  4119.                       integer1 > integer2
  4120.                       string1  > string2
  4121.                       integer1 = integer2
  4122.                       string1  = string2
  4123.                       integer1 < integer2
  4124.                       string1  < string2
  4125.  
  4126.  
  4127.        Format 1--If "condition" is true, control is transferred to label1.
  4128.        Otherwise the program continues at the next statement.
  4129.  
  4130.        Format 2--If "condition" is true, control is transferred to label1,
  4131.        otherwise the program branches to label2 and continues execution from
  4132.        there.
  4133.  
  4134.        Format 3--If "condition" is true, the program will continue execution at
  4135.        the next statement.  If the condition is false, the program will branch
  4136.        to the statement following the next ENDIF statement encountered.
  4137.  
  4138.        Format 4--If "condition" is true, program will continue execution at the
  4139.        next statement up to the next ELSE statement encountered, at which point
  4140.        it will branch to the statement following the next ENDIF statement
  4141.        encountered.  If "condition" is false, the program will branch to the
  4142.        next ELSE statement and resume execution at that statement.
  4143.  
  4144.        Example 1:
  4145.  
  4146.                  IF A > 0 THEN APLUS:
  4147.  
  4148.        In this example, if A is greater than zero, the program jumps to the
  4149.        label called "APLUS:".
  4150.  
  4151.  
  4152.  
  4153.  
  4154.  
  4155.  
  4156.  
  4157.                                       Page - 62
  4158.  
  4159.  
  4160.  
  4161.  
  4162.  
  4163.  
  4164.                             IF/THEN/ELSE/ENDIF (Continued)
  4165.  
  4166.        Example 2:
  4167.  
  4168.                  IF A$="YES" THEN TRUE: ELSE FALSE:
  4169.  
  4170.        In this example, if A$ contains the string "YES", the program jumps to
  4171.        the label called "TRUE:", otherwise the program transfers to label
  4172.        "FALSE:"
  4173.  
  4174.        Example 3:
  4175.  
  4176.                  OPEN "I",1,"TEST.DAT"
  4177.                  IF ERROR>0 THEN
  4178.                       PRINT "ERROR OPENING FILE";
  4179.                       PRINT ERROR
  4180.                       END
  4181.                  ENDIF
  4182.                  REM rest of program follows
  4183.                  .
  4184.                  .         
  4185.  
  4186.  
  4187.        In this example, if there is an error opening file "TEST.DAT", the
  4188.        program will print an error message and terminate.  Otherwise control
  4189.        will fall through to the REM statement and the program will continue.
  4190.  
  4191.        Example 4:
  4192.  
  4193.                  PRINT "ENTER A NUMBER";
  4194.                  INPUT NUMBER
  4195.                  IF NUMBER > 100 THEN
  4196.                       PRINT "THAT'S A BIG NUMBER"
  4197.                  ELSE
  4198.                       PRINT "THAT'S A SMALL NUMBER"
  4199.                  ENDIF
  4200.  
  4201.        Comments:
  4202.  
  4203.             Formats 3 and 4 are BLOCK IF formats.  You can nest BLOCK IF
  4204.        statements up to 25 levels deep.  The example below is shown three
  4205.        levels deep.
  4206.  
  4207.             IF A=1 THEN                                  <-Level 1
  4208.                  IF B=2 THEN                             <-Level 2
  4209.                       IF C=3 THEN                        <-Level 3
  4210.                            PRINT "C=3, B=2, AND A=1"
  4211.                       ELSE
  4212.                            PRINT "C<>3, B=2, AND A=1"    <-ELSE  for Level 3
  4213.                       ENDIF                              <-ENDIF for Level 3
  4214.                  ENDIF                                   <-ENDIF for Level 2
  4215.             ENDIF                                        <-ENDIF for Level 1
  4216.  
  4217.             It's a good idea to indent your IFs, ELSEs and ENDIFs as shown
  4218.        above.  Otherwise matching IFs up with matching ENDIFs and ELSEs can
  4219.        become very confusing.
  4220.  
  4221.  
  4222.  
  4223.                                       Page - 63
  4224.  
  4225.  
  4226.  
  4227.  
  4228.  
  4229.  
  4230.                                         INKEY$
  4231.  
  4232.        Format:        string1 = INKEY$
  4233.  
  4234.        Description:
  4235.  
  4236.             Used to retrieve keystrokes from the keyboard buffer.  If a
  4237.        character is waiting in the buffer, string1 will be set to the value of
  4238.        that character, and that character will be removed from the keyboard
  4239.        buffer.  If the buffer is empty, string1 will be set to a value of ""
  4240.        (that is, a null string with a length of 0).  If an extended key is
  4241.        pressed (for example the function keys F1 through F10), the system
  4242.        variable EXTENDED will be set to 1, otherwise it will contain 0.
  4243.  
  4244.        Example:
  4245.  
  4246.                  LOOP: X$=INKEY$
  4247.                  IF X$="" THEN LOOP:
  4248.  
  4249.        The above code will cause the program to loop until a key is pressed.
  4250.  
  4251.        Comment:
  4252.  
  4253.             ASIC provides an extension here over BASICA/GWBASIC.  The EXTENDED
  4254.        system variable will allow you to detect special keys as mentioned
  4255.        above.  To do so requires an understanding of keyboard scan codes, which
  4256.        is beyond the scope of the ASIC Manual.  For more information I would
  4257.        suggest Peter Norton's Programmer Guide to the IBM PC (Microsoft Press).
  4258.  
  4259.  
  4260.  
  4261.                                          INP
  4262.  
  4263.        Format:        integer1 = INP (integer2)
  4264.  
  4265.        Description:
  4266.  
  4267.             This statement reads a byte from port integer2 and stores the
  4268.        result in integer1.
  4269.  
  4270.        Example:
  4271.  
  4272.             A=INP(513)
  4273.             A=ZBIT(4,A)
  4274.             IF A=1 THEN TRIGGERPRESSED:
  4275.  
  4276.        The above code will test the joystick port to see if the trigger is
  4277.        being pressed on joystick 1.  You need a game card and joystick for this
  4278.        to work.
  4279.  
  4280.        See also:
  4281.  
  4282.             OUT
  4283.  
  4284.  
  4285.  
  4286.  
  4287.  
  4288.  
  4289.                                       Page - 64
  4290.  
  4291.  
  4292.  
  4293.  
  4294.  
  4295.  
  4296.                                         INPUT
  4297.  
  4298.        Format:        INPUT variable1
  4299.  
  4300.        Description:
  4301.  
  4302.             This statement will retrieve a line of text terminated from the
  4303.        input buffer and stores it in variable1.  ASIC will first issue the
  4304.        prompt "?".  It will then wait until the user enters a string or integer
  4305.        and presses the <return> or <enter> key.  The type of data ASIC will
  4306.        expect is dependent on the type of variable1 (integer or string).  If an
  4307.        integer is being entered, ASIC will edit the input for validity as an
  4308.        integer, and if the edit fails will issue another "?" to the user, and
  4309.        will wait for the number to be retyped.  Only when a valid integer has
  4310.        been entered will variable1 be updated, and only then will control
  4311.        return to your ASIC program.
  4312.  
  4313.        Example:
  4314.  
  4315.                  PRINT "Enter a String";
  4316.                  INPUT A$
  4317.  
  4318.        ASIC will issue the prompt:
  4319.  
  4320.                  Enter a String?
  4321.  
  4322.        It will then wait until you enter a string or press enter.  If you
  4323.        pressed enter with no characters A$ would contain "" (ie its length
  4324.        would equal 0), otherwise A$ would contain the string entered.
  4325.  
  4326.        Example:
  4327.  
  4328.                  INPUT I
  4329.  
  4330.        In this example ASIC will issue the prompt:
  4331.  
  4332.                  ?
  4333.  
  4334.        ASIC will then wait for you to enter a valid number.  If you enter an
  4335.        invalid number, say "x", ASIC will reissue the "?" prompt and wait for
  4336.        you to retype your input.  Once the input has been edited by ASIC, "I"
  4337.        would contain the number entered.
  4338.  
  4339.        See Also:
  4340.  
  4341.             INKEY$
  4342.  
  4343.  
  4344.  
  4345.  
  4346.  
  4347.  
  4348.  
  4349.  
  4350.  
  4351.  
  4352.  
  4353.  
  4354.  
  4355.                                       Page - 65
  4356.  
  4357.  
  4358.  
  4359.  
  4360.  
  4361.  
  4362.                                         INPUT#
  4363.  
  4364.        Format:        INPUT# integer1, integer1               <-Format 1
  4365.                       INPUT# integer1, string1                <-Format 2
  4366.                       INPUT# integer1, string1 CRLF           <-Format 3
  4367.                       INPUT# integer1, string1 NONULL         <-Format 4
  4368.                       INPUT# integer1, string1 BYTE           <-Format 5
  4369.  
  4370.  
  4371.        Description:
  4372.  
  4373.             This statement will read a variable from a file identified by file
  4374.        number integer1.  It will be stored in integer1/string1.  If an error
  4375.        occurs during a read, the system variable ERROR will be set to a non-
  4376.        zero value.  The possible errors are listed in the error messages
  4377.        section the of the ASIC Manual.  If you read a file past its end, the
  4378.        contents of variable1 are undefined.
  4379.  
  4380.             Five formats of this statement are provided to provide greater
  4381.        flexibility in reading files written by ASIC and non-ASIC programs.  The
  4382.        five formats are summarized below:
  4383.  
  4384.        Format 1 -- Read integers from a file previously written by ASIC.
  4385.  
  4386.        Format 2 -- Read strings from a file previously written by ASIC.
  4387.  
  4388.        Format 3 -- Read strings from a non-ASIC file.  Assumes the strings
  4389.        (CRLF)      will be terminated by a CR/LF (carriage return/linefeed).
  4390.                    Note that ASIC still considers a NULL character, if
  4391.                    encountered, as an end of string character.  Also ASIC
  4392.                    terminates the string if 80 characters are read before
  4393.                    encountering a CR/LF pair.
  4394.  
  4395.        Format 4 -- Read strings from a file until 80 characters or the end
  4396.        (NONULL)    of the file is reached.  Note that ASIC still considers a
  4397.                    NULL character, if encountered, as an end of string
  4398.                    character.
  4399.  
  4400.        Format 5 -- Reads a single byte from a file and stores it in string1.
  4401.        (BYTE)      If ASIC has read a NULL byte, the string will be set to
  4402.                    NULL and its length will be 0.
  4403.  
  4404.        Example 1:
  4405.  
  4406.             OPEN "I",1,"TEMP.DAT"
  4407.             INPUT#1, A$
  4408.             IF ERROR=99 THEN ENDOFFILE:
  4409.  
  4410.        In this example, a string will be read from file "TEMP.DAT", and it will
  4411.        be stored in A$.  The system ERROR variable is then checked to see if
  4412.        End of file was reached.  Note, other ERRORS could also be returned by
  4413.        INPUT#, besides error code 99.  Refer to the error messages section for
  4414.        more information.
  4415.  
  4416.  
  4417.  
  4418.  
  4419.  
  4420.  
  4421.                                       Page - 66
  4422.  
  4423.  
  4424.  
  4425.  
  4426.  
  4427.  
  4428.                                  INPUT#  (Continued)
  4429.        Example 2:
  4430.  
  4431.             OPEN "I",1,"TEMP.DAT"
  4432.             INPUT#1, A$ NONULL
  4433.             IF ERROR=99 THEN ENDOFFILE:
  4434.             
  4435.        In this example, ASIC will read 80 characters from the file "TEMP.DAT",
  4436.        or up until the next NULL character in the file, which ever comes first.
  4437.  
  4438.        Example 3:
  4439.  
  4440.             OPEN "I",1,"CONFIG.DAT"
  4441.             INPUT#1, A$ BYTE
  4442.             IF ERROR=99 THEN ENDOFFILE:
  4443.             
  4444.        In this example, ASIC will read a single character from the file
  4445.        "CONFIG.DAT", and place it in the variable A$.
  4446.  
  4447.        Example 4:
  4448.  
  4449.             OPEN "I",1,"TEST.DAT"
  4450.             INPUT#1, A
  4451.             IF ERROR=99 THEN ENDOFFILE:
  4452.  
  4453.        In this example, ASIC will read an integer value from the file
  4454.        "TEST.DAT", and place it in the integer variable "A".
  4455.  
  4456.        Example 5:
  4457.  
  4458.             OPEN "I",1,"ASCII.DAT"
  4459.             OPEN "O",2,"ASCII.NEW"
  4460.             CR$=CHR$(13)
  4461.             LF$=CHR$(10)
  4462.             CRLF$=CR$+LF$
  4463.        READMORE:
  4464.             INPUT #1, A$ CRLF
  4465.             IF ERROR=96 THEN WRITE:
  4466.             IF ERROR>0 THEN ENDOFFILE:
  4467.        WRITEWITHCRLF:
  4468.             PRINT #2,A$ NONULL
  4469.             PRINT #2,CRLF$ NONULL
  4470.             GOTO READMORE:
  4471.        WRITE:    
  4472.             PRINT #2, A$ NONULL
  4473.             GOTO READMORE:
  4474.        ENDOFFILE:
  4475.             CLOSE 1
  4476.             CLOSE 2
  4477.  
  4478.        This example copies file ASCII.DAT to file ASCII.NEW.  Note:  Even
  4479.        though ASIC can only handle 80 character strings, this example shows
  4480.        that by checking the ERROR variable for a value of 96, it is possible to
  4481.        read the file in up-to-80-character chunks and reassemble the strings in
  4482.        their original forms in the new file.  Also note that ASIC will still
  4483.        treat any NULL characters in the file as an end of string character.
  4484.  
  4485.  
  4486.  
  4487.                                       Page - 67
  4488.  
  4489.  
  4490.  
  4491.  
  4492.  
  4493.  
  4494.                                   INPUT# (Continued)
  4495.  
  4496.        Comments:
  4497.  
  4498.             Note that integer1 must be a constant in the range of 1-3.  It
  4499.        identifies a file by file number which must have previously been opened
  4500.        by an OPEN command for modes INPUT or RANDOM.
  4501.  
  4502.             ASIC assumes that integers will be stored in files in 2-byte binary
  4503.        format, which is the format ASIC writes integers.  Consequently, If a
  4504.        file contained a string "123", but you told ASIC to read integer "X",
  4505.        then ASIC would read two bytes from the file and interpret "12" as two
  4506.        binary bytes that it would then combine and store as "X".  "X" would
  4507.        contain the integer value 12849.  Thus to read an integer correctly, you
  4508.        will have had to previously written it with an ASIC program.
  4509.  
  4510.        See Also:
  4511.  
  4512.             OPEN, CLOSE, PRINT#, FILEPOS
  4513.  
  4514.  
  4515.  
  4516.                                         INSTR
  4517.  
  4518.        Format:        integer1 = INSTR (string1,string2)
  4519.  
  4520.        Description:
  4521.  
  4522.             This statement is used to determine if a given substring exists
  4523.        within a string, and if so, the character position at which the
  4524.        substring first appears in the string.  String1 is the string to be
  4525.        searched.  String2 contains the substring to find within string1.  The
  4526.        character position of string2 within string1 is returned in integer1.
  4527.        If the string is not found then integer1 is set to zero.
  4528.  
  4529.        Example 1:
  4530.  
  4531.             A=INSTR("THE QUICK BROWN FOX","QUICK")
  4532.  
  4533.        After execution of this statement, variable "A" will contain the value
  4534.        5, which is the offset of the string "QUICK" within the string "THE
  4535.        QUICK BROWN FOX".
  4536.  
  4537.             B=INSTR("FOX","HEN")
  4538.  
  4539.        After the execution of this statement, variable "B" will contain 0,
  4540.        since the string "HEN" is not found within the string "FOX".
  4541.  
  4542.        See also:
  4543.  
  4544.             LEFT$, RIGHT$, MID$, LEN
  4545.  
  4546.  
  4547.  
  4548.  
  4549.  
  4550.  
  4551.  
  4552.  
  4553.                                       Page - 68
  4554.  
  4555.  
  4556.  
  4557.  
  4558.  
  4559.  
  4560.                                         INT86
  4561.  
  4562.        Format:        INT86(integer1,AX,BX,CX,DX,DI,SI,BP,DS,ES)
  4563.  
  4564.        Description:
  4565.  
  4566.             This statement is used to call a DOS, BIOS, or custom-written
  4567.        Interrupt.  Integer1 must be a constant, and should identify the number
  4568.        of the interrupt to be called.  The fields following integer1 represent
  4569.        the CPU registers.  For example, ASIC will move the value from the ASIC
  4570.        variable "AX" to the CPU register "AX" prior to performing the interrupt
  4571.        call.  After the call, ASIC will move the value from the CPU register
  4572.        "AX" to the ASIC variable "AX".  Your ASIC program can then use this
  4573.        "AX" variable just like any other integer variable in the rest of the
  4574.        program.  Each of the registers listed (AX,BX,CX,DX,DI,SI,BP,DS,ES) must
  4575.        be included on the INT86 statement in the same order as shown in the
  4576.        Format statement above.  The exception to this rule, is that you can
  4577.        substitute "NA" for any register you do not need for the call.  The BP
  4578.        register may be used to pass values to the INT86 call, however, unlike
  4579.        all of the other registers, ASIC does not return the value of the BP
  4580.        register following the INT86 call.
  4581.  
  4582.        Example 1:
  4583.  
  4584.                  INT86(5,NA,NA,NA,NA,NA,NA,NA,NA,NA)
  4585.  
  4586.        The above example shows the code to perform a screen print to the
  4587.        printer.  This example will call INT 5 (BIOS Print Screen Interrupt),
  4588.        pass no parameters to the call, and receive no return values from the
  4589.        call.
  4590.  
  4591.        Example 2:
  4592.  
  4593.                  AX=&hex3600
  4594.                  DX=0
  4595.                  INT86(&hex21,AX,BX,CX,DX,NA,NA,NA,NA,NA)
  4596.                  PRINT "Default Drive has:"
  4597.                  PRINT
  4598.                  PRINT "Sectors/Cluster";
  4599.                  PRINT AX
  4600.                  PRINT "Available Cluster Count";
  4601.                  PRINT BX
  4602.                  PRINT "Bytes/Sector";
  4603.                  PRINT CX
  4604.                  PRINT "Total Clusters";
  4605.                  PRINT DX
  4606.  
  4607.  
  4608.  
  4609.  
  4610.  
  4611.  
  4612.  
  4613.  
  4614.  
  4615.  
  4616.  
  4617.  
  4618.  
  4619.                                       Page - 69
  4620.  
  4621.  
  4622.  
  4623.  
  4624.  
  4625.  
  4626.                                   INT86 (Continued)
  4627.  
  4628.        This example show a more complex call to DOS to find out free disk space
  4629.        information for the current drive.  DOS Interrupt 21 (hex) function 36
  4630.        (hex) is used to retrieve this information.  The AX register is used to
  4631.        pass the function number.  The DX register is used to select the disk
  4632.        drive (0=the default disk drive).  Note that the BX and CX registers
  4633.        were included on the call.  No parameters are being passed to the call
  4634.        in these registers, however, we'll be receiving information back from
  4635.        DOS in them, so they need to be on the INT86 statement.  Since the
  4636.        SI,DI,BP,DS, and ES registers are not needed by the call, they have been
  4637.        substituted with "NA" which you can think of as meaning "Not Applicable"
  4638.        to this call.  After the call, the example program will display
  4639.        information about the default disk drive.
  4640.  
  4641.        Comments:
  4642.  
  4643.        This statement is intended for advanced programmers.  To use it
  4644.        properly, you must have some knowledge of assembler language, or at
  4645.        least about the CPU registers in the IBM PC.  You also need a DOS or
  4646.        BIOS reference manual to identify which registers to pass to each
  4647.        interrupt, and to identify the values to place in those registers.
  4648.  
  4649.        One register was required for ASIC housekeeping after the INT86 call.
  4650.        This is why the BP register is unavailable to receive return values from
  4651.        calls.  The BP register was chosen, because none of the DOS or BIOS
  4652.        Interrupts use this register to return values.  If you write your own
  4653.        interrupts and want to call them from an ASIC program, remember that you
  4654.        can pass the BP register to the interrupt, but the ASIC "BP" variable
  4655.        will not be updated following the interrupt.
  4656.  
  4657.        If a register is not needed for the call, specify "NA" instead of the
  4658.        register name.  ASIC does not generate any code for "NA" registers, and
  4659.        this will reduce the size of your program.
  4660.  
  4661.  
  4662.  
  4663.  
  4664.  
  4665.  
  4666.  
  4667.  
  4668.  
  4669.  
  4670.  
  4671.  
  4672.  
  4673.  
  4674.  
  4675.  
  4676.  
  4677.  
  4678.  
  4679.  
  4680.  
  4681.  
  4682.  
  4683.  
  4684.  
  4685.                                       Page - 70
  4686.  
  4687.  
  4688.  
  4689.  
  4690.  
  4691.  
  4692.                                          KILL
  4693.  
  4694.        Format:        KILL string1
  4695.  
  4696.        Description:
  4697.  
  4698.             This statement is used to delete a file from disk.  It is similar
  4699.        to the DOS ERASE Statement.  Specify the file to delete in string1.  You
  4700.        can specify the full path to the file, or just the file name if it is in
  4701.        the current directory.  If an error occurs (eg, File not found), then
  4702.        ASIC will set the System ERROR variable.  A list of codes returned by
  4703.        KILL is listed in the ERROR Messages Chapter of the ASIC Manual.
  4704.  
  4705.        Example:
  4706.  
  4707.                  KILL "TEMP.DAT"
  4708.                  IF ERROR = 0 THEN NOERROR:
  4709.                  REM CHECK ERROR CODES HERE
  4710.  
  4711.        After this statement is executed, the file "TEMP.DAT" will have been
  4712.        erased from the current directory of the current drive, and will no
  4713.        longer be accessible from DOS or your programs.
  4714.  
  4715.  
  4716.  
  4717.  
  4718.                                         LCASE$
  4719.  
  4720.        Format:        string1=LCASE$(string2)
  4721.  
  4722.        Description:
  4723.  
  4724.             This statement will convert all of the letters in string2 from
  4725.        upper case to lower case, and store the result in string1.
  4726.  
  4727.        Example:
  4728.  
  4729.             A$=LCASE$("123 Main Street, USA")
  4730.  
  4731.        After the execution of this statement, the variable A$ will contain the
  4732.        string "123 main street, usa".
  4733.  
  4734.        See also:
  4735.  
  4736.             UCASE$
  4737.  
  4738.  
  4739.  
  4740.  
  4741.  
  4742.  
  4743.  
  4744.  
  4745.  
  4746.  
  4747.  
  4748.  
  4749.  
  4750.  
  4751.                                       Page - 71
  4752.  
  4753.  
  4754.  
  4755.  
  4756.  
  4757.  
  4758.                                         LEFT$
  4759.  
  4760.        Format:        string1=LEFT$(string2,integer1)
  4761.  
  4762.        Description:
  4763.  
  4764.             This statement will copy integer1 characters from the left of
  4765.        string2 to string1.
  4766.  
  4767.        Example:
  4768.  
  4769.             A$=LEFT$("RED RIDING HOOD",3)
  4770.             
  4771.        After the execution of the above statement, the variable A$ will contain
  4772.        the string "RED".
  4773.  
  4774.        See also:
  4775.  
  4776.             MID$, RIGHT$
  4777.  
  4778.  
  4779.  
  4780.                                          LEN
  4781.  
  4782.        Format:        integer1 = LEN (string1)
  4783.  
  4784.        Description:
  4785.  
  4786.             This statement returns the length (number of characters) of a
  4787.        string, and stores the length in integer1.
  4788.  
  4789.        Example:
  4790.  
  4791.                  A$="abc"
  4792.                  LENGTH1 = LEN(A$)
  4793.  
  4794.        After execution of these statements, LENGTH1 would contain 3.
  4795.  
  4796.  
  4797.  
  4798.  
  4799.  
  4800.  
  4801.  
  4802.  
  4803.  
  4804.  
  4805.  
  4806.  
  4807.  
  4808.  
  4809.  
  4810.  
  4811.  
  4812.  
  4813.  
  4814.  
  4815.  
  4816.  
  4817.                                       Page - 72
  4818.  
  4819.  
  4820.  
  4821.  
  4822.  
  4823.  
  4824.                                         LOCATE
  4825.  
  4826.        Format:        LOCATE row,column
  4827.  
  4828.        Description:
  4829.  
  4830.             This statement is used to position the cursor to a row and column.
  4831.        Row and Column should be integers.  Row has the range 0-24, Column has
  4832.        the range 0-79.  This function does not perform edits on the ranges of
  4833.        row and column.  Consequently using this function with values outside
  4834.        these ranges will have unpredictable results.
  4835.  
  4836.        Example:
  4837.  
  4838.                  LOCATE 10,20
  4839.                  PRINT "HELLO"
  4840.  
  4841.  
  4842.        After execution of these statements, the message "HELLO" will appear
  4843.        beginning at row 10, column 20.
  4844.  
  4845.  
  4846.  
  4847.                                         LPRINT
  4848.  
  4849.        Format:        LPRINT printobject [;]
  4850.  
  4851.        Description:
  4852.  
  4853.             This statement is used to send the contents of printobject to an
  4854.        attached printer.  "printobject" can be any valid ASIC datatype:
  4855.        integer constant, integer number, string constant, string variable, and
  4856.        also array elements.  Optionally, a ";" can be included with this
  4857.        statement to suppress a carriage return/line feed which ASIC normally
  4858.        also sends to the printer following each LPRINT.  This can be used to
  4859.        string several printobjects together on a single print line.
  4860.  
  4861.        Example:
  4862.  
  4863.                  A=12345
  4864.                  LPRINT "The value of A is: ";
  4865.                  LPRINT A
  4866.  
  4867.        After execution of these statements the printer would print:
  4868.  
  4869.                  The value of A is: 12345
  4870.  
  4871.        Comments:
  4872.  
  4873.                  Note that if the printer is not "online" that DOS will issue a
  4874.        message to "Abort, Retry, or Ignore".  This could overwrite a portion of
  4875.        the program display, unless not planned for.
  4876.  
  4877.                  Note also, that some printers do not begin printing until they
  4878.        receive a carriage return/line feed sequence.
  4879.  
  4880.  
  4881.  
  4882.  
  4883.                                       Page - 73
  4884.  
  4885.  
  4886.  
  4887.  
  4888.  
  4889.  
  4890.                                         LTRIM$
  4891.  
  4892.        Format:        string1=LTRIM$(string2)
  4893.  
  4894.        Description:
  4895.  
  4896.             This statement will remove all leading spaces from string2 and
  4897.        store the result in string1.
  4898.  
  4899.        Example:
  4900.  
  4901.             A$="   XYZ"
  4902.             A$=LTRIM$(A$)
  4903.  
  4904.        After execution of these statements, the variable A$ will contain the
  4905.        string "XYZ" with no leading spaces.
  4906.  
  4907.        See also:
  4908.  
  4909.             RTRIM$
  4910.  
  4911.  
  4912.  
  4913.                                          MID$
  4914.  
  4915.        Format:        string1 = MID$(string2,integer1,integer2)
  4916.  
  4917.        Description:
  4918.  
  4919.             This statement is used to extract a substring from string2
  4920.        beginning at position integer1 within string2 and continuing for
  4921.        integer2 bytes.  This value is then stored in string1.
  4922.  
  4923.        Example:
  4924.  
  4925.                       A$="THE QUICK BROWN FOX"
  4926.                       B$=MID$(A$,1,4)
  4927.                       C$=MID$(A$,11,9)
  4928.                       D$=B$ + C$
  4929.  
  4930.        After execution of these statements, the contents of A$ will be
  4931.        unchanged.  The contents of B$ will be "THE ".  The contents of C$ will
  4932.        be "BROWN FOX", and the contents of D$ will be "THE BROWN FOX".
  4933.  
  4934.        See also:
  4935.  
  4936.             LEFT$, RIGHT$
  4937.  
  4938.  
  4939.  
  4940.  
  4941.  
  4942.  
  4943.  
  4944.  
  4945.  
  4946.  
  4947.  
  4948.  
  4949.                                       Page - 74
  4950.  
  4951.  
  4952.  
  4953.  
  4954.  
  4955.  
  4956.                                         MKDIR
  4957.  
  4958.        Format:        MKDIR string1
  4959.  
  4960.        Description:
  4961.  
  4962.             This statement is used to create a new DOS directory.  Specify the
  4963.        directory to create in string1.  If ASIC is unable to create the
  4964.        directory, it will set the System ERROR variable.  A list of ERROR codes
  4965.        may be found is the Error Messages Chapter of the ASIC Manual.
  4966.  
  4967.        Example:
  4968.  
  4969.                  MKDIR "WORK"
  4970.                  IF ERROR = 0 THEN NOERROR:
  4971.  
  4972.        This code would create a directory called "WORK" under the current
  4973.        directory of the current drive.
  4974.  
  4975.        Example 2:
  4976.  
  4977.                  MKDIR "C:\WORK"
  4978.  
  4979.        This code would create a directory called "WORK" under the root
  4980.        directory of drive "C".
  4981.  
  4982.        See also:
  4983.  
  4984.             CHDIR,RMDIR
  4985.  
  4986.  
  4987.  
  4988.                                          MOD
  4989.  
  4990.        Format:        integer1 = integer2 MOD integer3
  4991.  
  4992.        Description:
  4993.  
  4994.             This statement will perform modulo division of integer2 by integer3
  4995.        and store the remainder (instead of the quotient) in integer1.
  4996.  
  4997.        Example:
  4998.  
  4999.                  A = 8
  5000.                  B = 5
  5001.                  C = A MOD B
  5002.  
  5003.        After execution of these statements, variable "C" will contain the value
  5004.        "3" which is the remainder of the division of 8 by 5.
  5005.  
  5006.  
  5007.  
  5008.  
  5009.  
  5010.  
  5011.  
  5012.  
  5013.  
  5014.  
  5015.                                       Page - 75
  5016.  
  5017.  
  5018.  
  5019.  
  5020.  
  5021.  
  5022.                                          NAME
  5023.  
  5024.        Format:        NAME string1 AS string2
  5025.  
  5026.        Description:
  5027.  
  5028.             This statement will allow you to rename a file.  String1 should
  5029.        contain the current file name, and string2 should contain the new name
  5030.        for the file.  If ASIC is unable to rename the file, it will set the
  5031.        System ERROR variable.  A list of ERROR codes is contained in the Error
  5032.        Messages Chapter of the ASIC Manual.
  5033.  
  5034.        Example:
  5035.  
  5036.             NAME "olddata.txt" AS "newdata.txt"
  5037.             IF ERROR = 0 THEN SUCCESS:
  5038.  
  5039.        After execution of these statements, file "olddata.txt" will have been
  5040.        renamed to "newdata.txt"
  5041.  
  5042.        Comments:
  5043.  
  5044.             You cannot rename a file to a new disk drive.
  5045.  
  5046.  
  5047.  
  5048.                                          OPEN
  5049.  
  5050.        Format:        OPEN string1, integer1, string2
  5051.  
  5052.        Description:
  5053.  
  5054.             This statement is used to open a file for input or output.  Up to
  5055.        three files may be open concurrently, these are known as file 1, 2, or
  5056.        3.  You must specify with integer1 which file number you wish to open
  5057.        this file as.  Integer1 may only be a constant.  The file mode is
  5058.        specified in string1.  The valid values are "I" for INPUT, "O" for
  5059.        OUTPUT, "A" for APPEND, and "R" for RANDOM INPUT/OUTPUT.  The file name
  5060.        is specified with string2.  Any errors returned from DOS on the OPEN
  5061.        call will be returned in the system variable "ERROR".
  5062.  
  5063.        Example:
  5064.  
  5065.                  OPEN "I",3,"INFILE"
  5066.                  IF ERROR > 0 THEN PROCESSERROR:
  5067.                  OPEN "O",1,"A:\NEWFILE.DAT"
  5068.                  IF ERROR > 0 THEN PROCESSERROR:
  5069.  
  5070.        In this example, two files are opened.  File "INFILE" from the current
  5071.        disk drive and directory will be opened as file number 3 for input.  The
  5072.        file "A:\NEWFILE.DAT" will be opened for output as file number 1.  Note
  5073.        that if "A:\NEWFILE.DAT" previously existed, it contents will be
  5074.        destroyed in preparation for writing.
  5075.  
  5076.        See also:
  5077.  
  5078.        CLOSE, FILEPOS, INPUT#, PRINT#
  5079.  
  5080.  
  5081.                                       Page - 76
  5082.  
  5083.  
  5084.  
  5085.  
  5086.  
  5087.  
  5088.                                        OPENCOM
  5089.  
  5090.        Format:        OPENCOM(integer1,integer2,integer3,integer4,integer5)
  5091.  
  5092.        Description:
  5093.  
  5094.             This statement is used to initialize the serial port.  Integer1 is
  5095.        used to specify the baud rate.  Integer2 specifies parity.  Integer3
  5096.        specifies stop bits.  Integer4 specifies bytesize, and Integer5
  5097.        identifies which port to open (see the tables below).  OPENCOM does not
  5098.        check the validity of the values you give it.
  5099.  
  5100.                  (integer1)                        (integer2)
  5101.                  BAUD RATE                          PARITY
  5102.             ------+-----------                 ------+------------
  5103.             VALUE | DESCRIPTION                VALUE | DESCRIPTION
  5104.               0   | 110  baud                    0   | No Parity
  5105.               1   | 150  baud                    1   | Odd Parity
  5106.               2   | 300  baud                    3   | Even Parity
  5107.               3   | 600  baud
  5108.               4   | 1200 baud                      (integer3)
  5109.               5   | 2400 baud                      STOP BITS
  5110.               6   | 4800 baud                  ------+------------
  5111.               7   | 9600 baud                  VALUE | DESCRIPTION
  5112.                                                  0   | One Stop Bit
  5113.                                                  1   | Two Stop Bits
  5114.  
  5115.                  (integer4)                        (integer5)
  5116.                  BYTE SIZE                          COM PORT
  5117.             ------+------------                ------+------------
  5118.             VALUE | DESCRIPTION                VALUE | DESCRIPTION
  5119.               2   | 7 Bits                       0   | Com1
  5120.               3   | 8 Bits                       1   | Com2
  5121.  
  5122.        Example:
  5123.  
  5124.                  OPENCOM(2,0,0,3,0)
  5125.  
  5126.        This statement would open COM1 at 300 baud, No parity, 1 Stop bit, 8 bit
  5127.        bytesize.
  5128.  
  5129.  
  5130.  
  5131.        See also:
  5132.  
  5133.             COMSTAT,RECEIVE,SEND
  5134.  
  5135.  
  5136.  
  5137.  
  5138.  
  5139.  
  5140.  
  5141.  
  5142.  
  5143.  
  5144.  
  5145.  
  5146.  
  5147.                                       Page - 77
  5148.  
  5149.  
  5150.  
  5151.  
  5152.  
  5153.  
  5154.                                          OUT
  5155.  
  5156.        Format:        OUT (integer1,integer2)
  5157.  
  5158.        Description:
  5159.  
  5160.             This statement writes a byte to a port.  Integer1 should contain
  5161.        the port to write to.  Integer2 should contain an integer value in the
  5162.        range of 0-255 to be written to the port.
  5163.  
  5164.        Example:
  5165.  
  5166.             OUT 512,0
  5167.  
  5168.        The above statement would send a byte with the binary value of "0" to
  5169.        port number 512.
  5170.  
  5171.  
  5172.        See also:
  5173.  
  5174.             INP
  5175.  
  5176.  
  5177.  
  5178.                                          PEEK
  5179.  
  5180.        Format:        integer1 = PEEK (integer2)
  5181.  
  5182.        Description:
  5183.  
  5184.             This statement is used to examine actual memory location values
  5185.        directly.  By default, the ASIC DS address is assumed.  However, this
  5186.        may be overridden with the use of the DEFSEG command.  The value of the
  5187.        byte at address integer2 is stored in integer1.
  5188.  
  5189.        Example:
  5190.  
  5191.             DEFSEG = &hexB800
  5192.             A = PEEK (0)
  5193.  
  5194.        The above statements will retrieve the first byte of video memory for a
  5195.        CGA/EGA/VGA card and store it in variable "A".
  5196.  
  5197.        Comments:
  5198.  
  5199.             Since the Intel 8088 architecture is segmented in 64k segments,
  5200.        integer2 is limited to the range of 0-65535.
  5201.  
  5202.  
  5203.  
  5204.        See also:
  5205.  
  5206.             DEFSEG, POKE
  5207.  
  5208.  
  5209.  
  5210.  
  5211.  
  5212.  
  5213.                                       Page - 78
  5214.  
  5215.  
  5216.  
  5217.  
  5218.  
  5219.  
  5220.                                         POINT
  5221.  
  5222.        Format:        integer1 = POINT (integer2,integer3)
  5223.  
  5224.        Description:
  5225.  
  5226.             This statement is used to determine the color of a given pixel in
  5227.        medium and high resolution graphics modes.  The row to test is specified
  5228.        with integer2, the column with integer3.  The color of the pixel is
  5229.        stored in integer1.
  5230.  
  5231.        Example:
  5232.  
  5233.                  PCOLOR = POINT (10,20)
  5234.  
  5235.        After execution of this statement, PCOLOR will contain the color of the
  5236.        pixel in row 10 column 20.
  5237.  
  5238.        Comments:
  5239.  
  5240.             No range checking is performed on row and column.  If the specified
  5241.        row or column is outside the valid range for the given graphics mode,
  5242.        the results are unpredictable.
  5243.  
  5244.        See also:
  5245.  
  5246.             PSET, PRESET, SCREEN
  5247.  
  5248.  
  5249.  
  5250.  
  5251.  
  5252.  
  5253.  
  5254.  
  5255.  
  5256.  
  5257.  
  5258.  
  5259.  
  5260.  
  5261.  
  5262.  
  5263.  
  5264.  
  5265.  
  5266.  
  5267.  
  5268.  
  5269.  
  5270.  
  5271.  
  5272.  
  5273.  
  5274.  
  5275.  
  5276.  
  5277.  
  5278.  
  5279.                                       Page - 79
  5280.  
  5281.  
  5282.  
  5283.  
  5284.  
  5285.  
  5286.                                          POKE
  5287.  
  5288.        Format:        POKE integer1, integer2
  5289.  
  5290.        Description:
  5291.  
  5292.             This instruction is used store the byte value integer2 at the
  5293.        memory address specified by integer1.  By default, ASIC uses its default
  5294.        data segment address, however, this may be overridden with the DEFSEG
  5295.        statement.
  5296.  
  5297.        Example:
  5298.  
  5299.             DEFSEG = &hexB800
  5300.             POKE 0,1
  5301.  
  5302.        The above statements will store a byte with the binary value of "1" in
  5303.        the first byte of video memory for a CGA/EGA/VGA card.
  5304.  
  5305.        Comments:
  5306.  
  5307.             This statement is NOT RECOMMENDED FOR BEGINNERS.  Directly
  5308.        overwriting memory locations can be disastrous, unless you know what is
  5309.        stored at that address.  This can cause program "hangs", system crashes,
  5310.        etc.
  5311.  
  5312.             Since the Intel 8088 architecture is segmented in 64k segments,
  5313.        integer2 is limited to the range of 0-65535.
  5314.  
  5315.  
  5316.        See also:
  5317.  
  5318.             DEFSEG, PEEK
  5319.  
  5320.  
  5321.  
  5322.                                          POS
  5323.  
  5324.        Format:        integer1 = POS (integer2)
  5325.  
  5326.        Description:
  5327.  
  5328.             This statement finds the column number of the cursor and stores it
  5329.        in integer1.  integer2 is a dummy argument included only because a dummy
  5330.        argument is required in BASICA/GWBASIC.
  5331.  
  5332.        Example:
  5333.  
  5334.                  A = POS(0)
  5335.  
  5336.        After this statement executes, A will contain the column number of the
  5337.        cursor.
  5338.  
  5339.        See also:
  5340.  
  5341.             CSRLIN
  5342.  
  5343.  
  5344.  
  5345.                                       Page - 80
  5346.  
  5347.  
  5348.  
  5349.  
  5350.  
  5351.  
  5352.                                         PRESET
  5353.  
  5354.        Format:        PRESET (integer1,integer2)
  5355.  
  5356.        Description:
  5357.  
  5358.             This statement is used to set the color of a pixel to the
  5359.        background color. The row of the pixel is specified in integer1, and the
  5360.        column is specified in integer2.  This statement only works in graphics
  5361.        modes.
  5362.  
  5363.        Example:
  5364.  
  5365.                  PRESET (10,20)
  5366.  
  5367.        The pixel at row 10 column 20 would be set to the background color.
  5368.  
  5369.        See also:
  5370.  
  5371.             PSET, SCREEN, POINT
  5372.  
  5373.  
  5374.  
  5375.                                         PRINT
  5376.  
  5377.        Format:        PRINT [printobject1 [;]]
  5378.  
  5379.        Description:
  5380.  
  5381.             This statement is used to print to the screen.  Printing begins at
  5382.        the current cursor location.  Printobject1 is defined as any valid ASIC
  5383.        data type:  integer constant, integer variable, string constant, string
  5384.        variable, and arrays.  The semicolon is optional and is used to tell
  5385.        ASIC if you want a carriage return/line feed issued.  A semicolon at the
  5386.        end of a PRINT statement will suppress the carriage return/line feed
  5387.        ASIC normally issues.  If no operands are supplied, ASIC will simply
  5388.        issue a carriage return and line feed.
  5389.  
  5390.        Example:
  5391.  
  5392.                  A=1000
  5393.                  PRINT "A=";
  5394.                  PRINT A
  5395.                  PRINT
  5396.                  PRINT "DONE!"
  5397.  
  5398.        After execution of these statements your screen would display:
  5399.  
  5400.                  A=  1000
  5401.  
  5402.                  DONE!
  5403.  
  5404.  
  5405.        See also:
  5406.  
  5407.             COLOR, SCREEN, LOCATE
  5408.  
  5409.  
  5410.  
  5411.                                       Page - 81
  5412.  
  5413.  
  5414.  
  5415.  
  5416.  
  5417.  
  5418.                                         PRINT#
  5419.  
  5420.        Format:        PRINT# constant1, printobject1 [NONULL]
  5421.  
  5422.        Description:
  5423.  
  5424.             This statement is used to write integers and strings to disk.
  5425.        Constant1 identifies the file number that the file was opened as.  This
  5426.        must be a constant with a value of 1, 2 or 3.  The file must have been
  5427.        previously opened with the OPEN command.  If printobject1 is a string,
  5428.        you can also add the optional argument "NONULL", which will cause ASIC
  5429.        to suppress the trailing NULL character it would normally write to disk.
  5430.        DOS errors are returned in the system variable "ERROR".  A list of these
  5431.        error codes may be found in the error messages section of the ASIC
  5432.        Manual.  Also, refer to the technical details section of the ASIC Manual
  5433.        for more information on the format in which ASIC writes the data to
  5434.        disk.
  5435.  
  5436.        Example:
  5437.  
  5438.                  PRINT# 1, "HELLO"
  5439.                  IF ERROR = 255 THEN DISKFULL:
  5440.                  PRINT# 1, "WORLD"
  5441.                  IF ERROR = 255 THEN DISKFULL:
  5442.  
  5443.        After successful execution of the print statements the file identified
  5444.        by file number 1 would contain "HELLO0WORLD0" . Note that the "0"
  5445.        following HELLO and WORLD in our example represents the ASCII null
  5446.        character.  Strings in ASIC are always internally terminated with ASCII
  5447.        null characters.  By default, these nulls are also written to disk.
  5448.  
  5449.                  PRINT# 2, "HELLO" NONULL
  5450.  
  5451.        In this example, the string "HELLO" would be written to file #2, and no
  5452.        trailing NULL will be written to disk.
  5453.  
  5454.                  PRINT #3, 1234
  5455.  
  5456.        In this example, the number "1234" would be written to file #3 as two
  5457.        bytes in Intel binary format (the file would contain the two hexadecimal
  5458.        bytes:  D2 04).
  5459.  
  5460.  
  5461.  
  5462.  
  5463.  
  5464.  
  5465.  
  5466.  
  5467.  
  5468.  
  5469.  
  5470.  
  5471.  
  5472.  
  5473.  
  5474.  
  5475.  
  5476.  
  5477.                                       Page - 82
  5478.  
  5479.  
  5480.  
  5481.  
  5482.  
  5483.  
  5484.                                   PRINT# (Continued)
  5485.  
  5486.        Comments:
  5487.  
  5488.          Note that while ASIC doesn't generate carriage returns and line feeds
  5489.        for you as it does with the PRINT command, you can write these
  5490.        characters to disk as follows:
  5491.  
  5492.                  A$=CHR$(13)
  5493.                  B$=CHR$(10)
  5494.                  A$ = A$ + B$
  5495.                  PRINT #1, A$
  5496.  
  5497.        You might be wondering about the purpose of the NONULL option.  ASIC
  5498.        normally writes trailing NULLs with strings.  This is desirable if you
  5499.        plan to read the file exclusively with other ASIC programs.
  5500.  
  5501.        However, sometimes you may want to write a string for use by another
  5502.        program.  In this case, the NULL character sometimes confuses the other
  5503.        program.  Specifying the NONULL option will cause ASIC to suppress the
  5504.        offending NULL character.
  5505.  
  5506.        What happens if you read a string that is terminated by a Carriage
  5507.        Return/Line Feed Sequence (such as GWBASIC/BASICA produces)?  In this
  5508.        instance, specify the CRLF option on the INPUT# statement.  Then ASIC
  5509.        will read the string until it finds a CR/LF or until it reads 80
  5510.        characters, whichever comes first.
  5511.  
  5512.        See also:
  5513.  
  5514.                  OPEN, CLOSE, INPUT#, FILEPOS
  5515.  
  5516.  
  5517.  
  5518.  
  5519.  
  5520.  
  5521.  
  5522.  
  5523.  
  5524.  
  5525.  
  5526.  
  5527.  
  5528.  
  5529.  
  5530.  
  5531.  
  5532.  
  5533.  
  5534.  
  5535.  
  5536.  
  5537.  
  5538.  
  5539.  
  5540.  
  5541.  
  5542.  
  5543.                                       Page - 83
  5544.  
  5545.  
  5546.  
  5547.  
  5548.  
  5549.  
  5550.                                          PSET
  5551.  
  5552.        Format:        PSET (integer1,integer2),integer3
  5553.  
  5554.        Description:
  5555.  
  5556.             This statement is used to set a pixel to a specified color in
  5557.        graphics modes.  The row is specified in integer1, the column in
  5558.        integer2, and the color in integer3.  Note that no range checking is
  5559.        performed on integer1 or integer2.  A row or column specified outside
  5560.        the range allowed by the graphics mode in use can result in
  5561.        unpredictable results.
  5562.  
  5563.        Example:
  5564.  
  5565.                  PSET (10,20),1
  5566.  
  5567.        In this example the pixel defined at row 10 and column 20 will be set to
  5568.        color 1.
  5569.  
  5570.        See also:
  5571.  
  5572.             PRESET, SCREEN, POINT
  5573.  
  5574.  
  5575.  
  5576.                                       RANDOMIZE
  5577.  
  5578.        Format:        RANDOMIZE
  5579.  
  5580.        Description:
  5581.  
  5582.                  This statement will cause the seed for the random number
  5583.        generator to be reseeded using the system timer.  This statement should
  5584.        always precede the first RND statement in your program, unless you want
  5585.        the same sequence of random numbers generated.
  5586.  
  5587.        Example:
  5588.  
  5589.             RANDOMIZE
  5590.  
  5591.        The above statement would insure that each time your program runs, any
  5592.        subsequent RND numbers generated would be different.
  5593.  
  5594.        See also:
  5595.  
  5596.             RND
  5597.  
  5598.  
  5599.  
  5600.  
  5601.  
  5602.  
  5603.  
  5604.  
  5605.  
  5606.  
  5607.  
  5608.  
  5609.                                       Page - 84
  5610.  
  5611.  
  5612.  
  5613.  
  5614.  
  5615.  
  5616.                                          READ
  5617.  
  5618.        Format:        READ variable1
  5619.  
  5620.        Description:
  5621.  
  5622.             This statement reads a constant from DATA statements into a
  5623.        variable.  Variable1 is either a string or integer type variable.
  5624.  
  5625.        Example:
  5626.  
  5627.             DATA 7,"CARGO"
  5628.  
  5629.             READ A
  5630.             READ B$
  5631.  
  5632.        After execution of these statements, "A" will contain 7, and B$ will
  5633.        contain "CARGO".
  5634.  
  5635.        Comments:
  5636.  
  5637.             ASIC does not check to see that the data type on the READ statement
  5638.        matches the data type on the DATA statement.  It is up to the programmer
  5639.        to insure that the types match.  The above example is correct.  The DATA
  5640.        statement contains an integer, then a string.  This is the same sequence
  5641.        in which the DATA is READ (ie, integer, then string).  In the above
  5642.        example, if the read statements were reversed, the contents of A and B$
  5643.        are undefined.  Also note that ASIC does not check to see that you don't
  5644.        read past the end of the DATA you specified.  In the above example, if
  5645.        you had a third READ statement that contained "READ C$", then C$ would
  5646.        contain random garbage, since you read three values, but only provided
  5647.        data for two.
  5648.  
  5649.        See also:
  5650.  
  5651.             DATA,RESTORE
  5652.  
  5653.  
  5654.  
  5655.  
  5656.  
  5657.  
  5658.  
  5659.  
  5660.  
  5661.  
  5662.  
  5663.  
  5664.  
  5665.  
  5666.  
  5667.  
  5668.  
  5669.  
  5670.  
  5671.  
  5672.  
  5673.  
  5674.  
  5675.                                       Page - 85
  5676.  
  5677.  
  5678.  
  5679.  
  5680.  
  5681.  
  5682.                                        RECEIVE
  5683.  
  5684.        Format:        variable1 = RECEIVE(integer2)
  5685.  
  5686.        Description:
  5687.  
  5688.             This statement will read a byte from the specified serial port.
  5689.        Integer2 identifies which port to read (0=COM1, and 1=COM2).  The byte
  5690.        read is stored in variable1 (which may be an integer or string type
  5691.        variable).  Before executing this statement you should first check to
  5692.        see if there is data waiting to be read.  Executing this statement when
  5693.        data is not waiting can cause your PC to "hang" until data is received
  5694.        at the hardware serial port.  The example below illustrates how to
  5695.        determine if data is waiting to be received.
  5696.  
  5697.        Example:
  5698.  
  5699.             OPENCOM(2,0,0,3,0)
  5700.             
  5701.             PORTSTAT = COMSTAT(0)
  5702.             DATAREADY = ZBIT(8,PORTSTAT)
  5703.             IF DATAREADY = 0 THEN NODATAWAITING:
  5704.             A$=RECEIVE(0)
  5705.  
  5706.  
  5707.        These statements do the following.  The first retrieves the status of
  5708.        COM1 to the variable PORTSTAT.  The second checks to see if bit 8 is on,
  5709.        DATAREADY will contain 1 if so, otherwise it will contain 0.  Since Bit
  5710.        8 is used to determine if data is waiting to be received from the port,
  5711.        if DATAREADY NOT = 0 then the program will RECEIVE data from the port to
  5712.        variable "A$".
  5713.  
  5714.        Comments:
  5715.  
  5716.             Variable1 can be either a string or integer type variable.
  5717.        However, if variable1 is a string, bear in mind that you cannot directly
  5718.        receive a NULL (ASCII Code 0), since NULL is used to delimit the end of
  5719.        a string in ASIC.  However, if in the above example data was waiting at
  5720.        the port but A$ contained "" after the receive, you would know that the
  5721.        character received was a NULL.  This is not a problem if variable1 is an
  5722.        integer variable.
  5723.  
  5724.        See also:
  5725.  
  5726.             OPENCOM,SEND,COMSTAT
  5727.  
  5728.  
  5729.  
  5730.  
  5731.  
  5732.  
  5733.  
  5734.  
  5735.  
  5736.  
  5737.  
  5738.  
  5739.  
  5740.  
  5741.                                       Page - 86
  5742.  
  5743.  
  5744.  
  5745.  
  5746.  
  5747.  
  5748.                                          REM
  5749.  
  5750.        Format:        REM  free form comments
  5751.  
  5752.        Description:
  5753.  
  5754.             This statement is used to insert comments into your program.
  5755.        Everything following REM is treated by ASIC as a comment.
  5756.  
  5757.        Example:
  5758.  
  5759.             REM The compiler will ignore this line
  5760.  
  5761.  
  5762.  
  5763.                                        RESTORE
  5764.  
  5765.        Format:        RESTORE
  5766.  
  5767.        Description:
  5768.  
  5769.             This statement allows you to READ data from DATA statements after
  5770.        you have already READ it once.
  5771.  
  5772.        Example:
  5773.                  DATA 0
  5774.  
  5775.                  READ A
  5776.                  RESTORE
  5777.                  READ B
  5778.  
  5779.        In this example, "READ A" causes variable "A" to be set to 0.  Now, the
  5780.        DATA statement is "used up".  There is no more data left on it to be
  5781.        read.  The RESTORE resets the DATA so that the next statement "READ B"
  5782.        will result in "B" being set to 0.  If the RESTORE was not done, the
  5783.        contents of B would be undefined.
  5784.  
  5785.        See also:
  5786.  
  5787.             READ, DATA
  5788.  
  5789.  
  5790.  
  5791.  
  5792.  
  5793.  
  5794.  
  5795.  
  5796.  
  5797.  
  5798.  
  5799.  
  5800.  
  5801.  
  5802.  
  5803.  
  5804.  
  5805.  
  5806.  
  5807.                                       Page - 87
  5808.  
  5809.  
  5810.  
  5811.  
  5812.  
  5813.  
  5814.                                         RETURN
  5815.  
  5816.        Format:        RETURN
  5817.  
  5818.        Description:
  5819.  
  5820.             Used to return from a GOSUB call.
  5821.  
  5822.        Example:
  5823.  
  5824.             GOSUB PRINTIT:
  5825.             END
  5826.             
  5827.             PRINTIT: PRINT "IT"
  5828.             RETURN
  5829.  
  5830.        In the above example, the word "IT" will be printed on the screen.  The
  5831.        RETURN statement causes program execution to resume on the statement
  5832.        following the corresponding GOSUB statement.  In this example, control
  5833.        will be returned to the END statement.
  5834.  
  5835.        Comments:
  5836.  
  5837.             Executing a RETURN statement without having first executed a GOSUB
  5838.        statement could cause unpredictable results.
  5839.  
  5840.        See also:
  5841.  
  5842.             GOSUB
  5843.  
  5844.  
  5845.  
  5846.                                         RIGHT$
  5847.  
  5848.        Format:        string1 = RIGHT$(string2,integer1)
  5849.  
  5850.        Description:
  5851.  
  5852.             This statement will copy the rightmost integer1 characters from
  5853.        string2 to string1.
  5854.  
  5855.        Example:
  5856.  
  5857.             A$=RIGHT$("RED RIDING HOOD",4)
  5858.             
  5859.        After the execution of the above statement, the variable A$ will contain
  5860.        the string "HOOD".
  5861.  
  5862.        See also:
  5863.  
  5864.             MID$, LEFT$
  5865.  
  5866.  
  5867.  
  5868.  
  5869.  
  5870.  
  5871.  
  5872.  
  5873.                                       Page - 88
  5874.  
  5875.  
  5876.  
  5877.  
  5878.  
  5879.  
  5880.                                         RMDIR
  5881.  
  5882.        Format:        RMDIR string1
  5883.  
  5884.        Description:
  5885.  
  5886.             This statement will delete an empty directory from disk.  String1
  5887.        should contain the name of the directory to delete.  If ASIC is unable
  5888.        to delete the directory, it will set the System ERROR variable.  A list
  5889.        of ERROR codes is listed in the Error Messages Chapter of the ASIC
  5890.        Manual.
  5891.  
  5892.        Example:
  5893.  
  5894.                  RMDIR "C:\WORK\TEST"
  5895.                  IF ERROR = 0 THEN SUCCESS:
  5896.  
  5897.        After execution of this code, the directory TEST under directory WORK
  5898.        will be deleted (if it had no files or subdirectories in it, and if it
  5899.        is not the current directory for drive "C").
  5900.  
  5901.        See also:
  5902.  
  5903.             MKDIR,CHDIR
  5904.  
  5905.  
  5906.  
  5907.  
  5908.  
  5909.  
  5910.  
  5911.  
  5912.  
  5913.  
  5914.  
  5915.  
  5916.  
  5917.  
  5918.  
  5919.  
  5920.  
  5921.  
  5922.  
  5923.  
  5924.  
  5925.  
  5926.  
  5927.  
  5928.  
  5929.  
  5930.  
  5931.  
  5932.  
  5933.  
  5934.  
  5935.  
  5936.  
  5937.  
  5938.  
  5939.                                       Page - 89
  5940.  
  5941.  
  5942.  
  5943.  
  5944.  
  5945.  
  5946.                                          RND
  5947.  
  5948.        Format:        integer1 = RND (integer2)
  5949.  
  5950.        Description:
  5951.  
  5952.             This statement will return an integer number in the range of 0
  5953.        through 32767 for normal integers, and in the range of 0 to
  5954.        2,147,483,647 for long integers. This random number will be stored in
  5955.        integer1.  Integer2 is a dummy argument and can be any valid integer
  5956.        value.
  5957.  
  5958.        Example 1:
  5959.  
  5960.                  A& = RND(0)
  5961.  
  5962.        After execution of this statement "A" will contain a number between 0
  5963.        and 2,147,483,647 inclusive.
  5964.  
  5965.        Example 2:
  5966.  
  5967.                  RANDOMIZE
  5968.  
  5969.                  DIEROLL=RND(0)
  5970.                  DIEROLL=DIEROLL MOD 6
  5971.                  DIEROLL=DIEROLL+1
  5972.                  PRINT "YOU ROLLED A";DIEROLL
  5973.                  
  5974.        The above example demonstrates how to generate a number in a given
  5975.        range.  In this case, the range will be 1-6, which would be suitable for
  5976.        simulating the roll of a die.  The above example will generate the
  5977.        simulated die roll, and print the result.
  5978.  
  5979.  
  5980.        Comments:
  5981.  
  5982.               In BASICA/GWBASIC, RND always returns a value between 1 and 0.
  5983.  
  5984.  
  5985.  
  5986.  
  5987.  
  5988.  
  5989.  
  5990.  
  5991.  
  5992.  
  5993.  
  5994.  
  5995.  
  5996.  
  5997.  
  5998.  
  5999.  
  6000.  
  6001.  
  6002.  
  6003.  
  6004.  
  6005.                                       Page - 90
  6006.  
  6007.  
  6008.  
  6009.  
  6010.  
  6011.  
  6012.                                         RTRIM$
  6013.  
  6014.        Format:        string1=RTRIM$(string2)
  6015.  
  6016.        Description:
  6017.  
  6018.             This statement will remove all trailing spaces from string2 and
  6019.        store the resulting string in string1.
  6020.  
  6021.        Example:
  6022.  
  6023.             A$=RTRIM$("XYZ   ")
  6024.  
  6025.        After the execution of this statement, the variable "A$" will contain
  6026.        "XYZ".
  6027.  
  6028.        See also:
  6029.  
  6030.             LTRIM$
  6031.  
  6032.  
  6033.  
  6034.  
  6035.  
  6036.  
  6037.  
  6038.  
  6039.  
  6040.  
  6041.  
  6042.  
  6043.  
  6044.  
  6045.  
  6046.  
  6047.  
  6048.  
  6049.  
  6050.  
  6051.  
  6052.  
  6053.  
  6054.  
  6055.  
  6056.  
  6057.  
  6058.  
  6059.  
  6060.  
  6061.  
  6062.  
  6063.  
  6064.  
  6065.  
  6066.  
  6067.  
  6068.  
  6069.  
  6070.  
  6071.                                       Page - 91
  6072.  
  6073.  
  6074.  
  6075.  
  6076.  
  6077.  
  6078.                                          RUN
  6079.  
  6080.        Format:        RUN string1
  6081.  
  6082.        Description:
  6083.  
  6084.             This function can be used to load and execute other programs
  6085.        compiled with ASIC or another compiler.  String1 represents the name of
  6086.        the program to execute.  If an error occurs when ASIC attempts to RUN
  6087.        the program, it will set the system ERROR variable to 255.  Otherwise,
  6088.        the ERROR variable will be set to the value of the return code of the
  6089.        called program (which is 0 unless the called program specifies
  6090.        otherwise).
  6091.  
  6092.        Example:
  6093.  
  6094.             RUN "OTHER.COM"
  6095.  
  6096.        Comments:
  6097.  
  6098.             String1 must contain the FULL pathname of the program
  6099.        (ie,"\directory\progname.COM") only if the program is NOT in the current
  6100.        directory.  You must include the file extension on the file name (for
  6101.        example, use "MYPROG.COM" instead of just "MYPROG", or use "MYPROG.EXE"
  6102.        instead of "MYPROG").
  6103.  
  6104.             At this time, RUN and CALL are functionally equivalent, with one
  6105.        exception.  RUN does not accept program arguments, but CALL does.
  6106.  
  6107.        CAUTION:
  6108.  
  6109.             You may use the debugger with programs which contain "CALL" or
  6110.        "RUN" statements.  However, the programs you call should not themselves
  6111.        contain debugging code.  For example, if A.ASI calls B.ASI, then make
  6112.        sure you compile B.ASI with the "Debugging Code" option OFF before you
  6113.        try to debug program A.ASI.  Failure to do so will cause the debugger to
  6114.        behave erratically.  This also applies to programs you write using other
  6115.        compilers, since they also use the same interrupt that ASIC uses (INT 3)
  6116.        for debugging purposes.
  6117.  
  6118.        See also:
  6119.  
  6120.             CALL
  6121.  
  6122.  
  6123.  
  6124.  
  6125.  
  6126.  
  6127.  
  6128.  
  6129.  
  6130.  
  6131.  
  6132.  
  6133.  
  6134.  
  6135.  
  6136.  
  6137.                                       Page - 92
  6138.  
  6139.  
  6140.  
  6141.  
  6142.  
  6143.  
  6144.                                         SCREEN
  6145.  
  6146.        Format:        SCREEN integer1
  6147.  
  6148.        Description:
  6149.  
  6150.             This statement will transfer the computer between text mode and
  6151.        graphics modes.  Integer1 must be an integer constant with a value of 0,
  6152.        1, 2, 7, 9, or 13.  These modes are described in the table below.  The
  6153.        "Mode" column identifies the value of integer1 to specify on the SCREEN
  6154.        command to select that graphics mode.  The "Graphics Resolution" column
  6155.        has three numbers.  The first identifies the number of rows of pixels
  6156.        supported in this mode.  The second number identifies the number of
  6157.        columns.  The third number identifies the number of colors which may
  6158.        displayed on screen at one time.  The numbers in the "Text Resolution"
  6159.        column tell you how many rows, columns and colors you may display on the
  6160.        screen when displaying text.  The adapters column identifies the type of
  6161.        graphics adapter required to use this mode.
  6162.  
  6163.        Mode      Graphics Resolution      Text Resolution     Adapters
  6164.        -----     -------------------      ---------------     -------
  6165.          0       None                     25 x 80 x 16        Any Adapter
  6166.          1       200 x 320 x 4            25 x 40 x 4         CGA/EGA/VGA
  6167.          2       200 x 640 x 2            25 x 80 x 2         CGA/EGA/VGA
  6168.          7       200 x 320 x 16           25 x 40 x 16        EGA/VGA
  6169.          9       350 x 640 x 16           25 x 80 x 16        EGA/VGA
  6170.         13       200 x 320 x 256          25 x 40 x 16        VGA
  6171.  
  6172.  
  6173.  
  6174.        Example:
  6175.  
  6176.                  SCREEN 13
  6177.  
  6178.        After execution of this statement, the PC will be in Graphics Mode 13
  6179.        which will allow you to display 200 rows by 320 columns of pixels in 256
  6180.        different colors.  Up to 25 rows and 80 columns of text can be displayed
  6181.        in up to 256 colors.  And finally, mode 13 requires a VGA Graphics Card.
  6182.  
  6183.        Comments:
  6184.  
  6185.             Any program which uses the SCREEN command should issue a "SCREEN 0"
  6186.        command before terminating.  Otherwise, the screen will not be reset
  6187.        properly when you return to DOS.
  6188.  
  6189.        See also:
  6190.  
  6191.             PSET, PRESET, POINT, ZMODE
  6192.  
  6193.  
  6194.  
  6195.  
  6196.  
  6197.  
  6198.  
  6199.  
  6200.  
  6201.  
  6202.  
  6203.                                       Page - 93
  6204.  
  6205.  
  6206.  
  6207.  
  6208.  
  6209.  
  6210.                                          SEND
  6211.  
  6212.        Format:        SEND (data1,integer2)
  6213.  
  6214.        Description:
  6215.  
  6216.             This statement is used to send one character to a serial port.  The
  6217.        port should initialized with OPENCOM prior to using this statement.
  6218.        Data1 may be any valid data type (integer or string, variable or
  6219.        constant) and it should contain the character to be sent to the port.
  6220.        Integer2 identifies which COM port to send to (0=COM1, 1=COM2).
  6221.  
  6222.        Example:
  6223.  
  6224.                  OPENCOM(2,0,0,3,0)
  6225.                  SEND ("X",0)
  6226.  
  6227.        The above code will open COM1 at 300baud, 1 stop bit, 8bit character
  6228.        size, with no parity.  It will then send the character "X" to COM1.
  6229.  
  6230.        See also:
  6231.  
  6232.             RECEIVE,COMSTAT,OPENCOM
  6233.  
  6234.  
  6235.  
  6236.                                         SOUND
  6237.  
  6238.        Format:        SOUND integer1,integer2
  6239.  
  6240.        Description:
  6241.  
  6242.             This statement will generate a sound on your computer speaker with
  6243.        a frequency of integer1, and a duration of integer2.  Frequency should
  6244.        be in the range of 0 to 32767.  ASIC, however, only checks to see that
  6245.        it is non-negative.
  6246.  
  6247.        Example:
  6248.  
  6249.                  SOUND  400,20
  6250.  
  6251.        Execution of the above statement will produce a short beep.
  6252.  
  6253.        Comments:
  6254.  
  6255.             ASIC "frequencies" values go from high to low.  That is, a
  6256.        frequency of 0 is the highest, and 32767 is the lowest.
  6257.  
  6258.  
  6259.  
  6260.  
  6261.  
  6262.  
  6263.  
  6264.  
  6265.  
  6266.  
  6267.  
  6268.  
  6269.                                       Page - 94
  6270.  
  6271.  
  6272.  
  6273.  
  6274.  
  6275.  
  6276.                                         SPACE$
  6277.  
  6278.        Format:        string1=SPACE$(integer1)
  6279.  
  6280.        Description:
  6281.  
  6282.             This statement will return a string containing integer1 ASCII space
  6283.        characters.
  6284.  
  6285.        Example:
  6286.  
  6287.             A$=SPACE$(10)
  6288.             B$="<"+A$
  6289.             B$=B$+">"
  6290.  
  6291.        After execution of these statements, variable "B$" will contain the
  6292.        string "<          >".
  6293.  
  6294.        See also:
  6295.  
  6296.             STRING$
  6297.  
  6298.  
  6299.  
  6300.                                          STR$
  6301.  
  6302.        Format:        string1 = STR$ (integer1)
  6303.  
  6304.        Description:
  6305.  
  6306.             This statement will convert integer1 to a string format and store
  6307.        the string format in string1.
  6308.  
  6309.        Example:
  6310.  
  6311.                  A=1234
  6312.                  A$ = STR$(A)
  6313.  
  6314.        After execution of these statements, A$ would contain the string "1234".
  6315.  
  6316.        See also:
  6317.  
  6318.             VAL
  6319.  
  6320.  
  6321.  
  6322.  
  6323.  
  6324.  
  6325.  
  6326.  
  6327.  
  6328.  
  6329.  
  6330.  
  6331.  
  6332.  
  6333.  
  6334.  
  6335.                                       Page - 95
  6336.  
  6337.  
  6338.  
  6339.  
  6340.  
  6341.  
  6342.                                        STRING$
  6343.  
  6344.        Format:        string1=STRING$(integer1,integer2)  <--Format 1
  6345.  
  6346.                       string1=STRING$(integer1,string2)   <--Format 2
  6347.  
  6348.        Description:
  6349.  
  6350.             This statement will return a string containing integer1 characters
  6351.        of ASCII value integer2 (Format1).  If format 2 is used, this statement
  6352.        will create a string containing integer1 characters. Each of these
  6353.        characters will be the same as the first character of string2.
  6354.  
  6355.        Example 1:
  6356.  
  6357.             A$=STRING$(8,111)
  6358.  
  6359.        After execution of these statements, variable "A$" will contain the
  6360.        string "oooooooo".
  6361.  
  6362.        Example 2:
  6363.  
  6364.             A$=STRING$(5,"xyz")
  6365.  
  6366.        After execution of these statements, variable "A$" will contain the
  6367.        string "xxxxx".
  6368.  
  6369.        See also:
  6370.  
  6371.             SPACE$
  6372.  
  6373.  
  6374.  
  6375.  
  6376.  
  6377.  
  6378.  
  6379.  
  6380.  
  6381.  
  6382.  
  6383.  
  6384.  
  6385.  
  6386.  
  6387.  
  6388.  
  6389.  
  6390.  
  6391.  
  6392.  
  6393.  
  6394.  
  6395.  
  6396.  
  6397.  
  6398.  
  6399.  
  6400.  
  6401.                                       Page - 96
  6402.  
  6403.  
  6404.  
  6405.  
  6406.  
  6407.  
  6408.                                         TIME$
  6409.  
  6410.        Format:        string1 = TIME$
  6411.  
  6412.        Description:
  6413.  
  6414.             This statement will retrieve the current time from the PC's system
  6415.        clock.  The time will be retrieved and stored in String1, in the format:
  6416.        "HH.MM.SS".
  6417.  
  6418.        Example:
  6419.  
  6420.             CURTIME$=TIME$
  6421.             PRINT CURTIME$
  6422.  
  6423.        After execution of the above statements the current time (as per the
  6424.        PC's internal clock) will be displayed on the screen.
  6425.  
  6426.        Comments:
  6427.  
  6428.             Note:  if the time printed is wrong, you have probably not set the
  6429.        system clock.  Most older XTs and PCs do not have a battery to preserve
  6430.        the DATE and TIME in the system clock, so you have to set them each time
  6431.        you power up the PC.  Most ATs and newer PCs have a battery backup, so
  6432.        that the date is preserved for you.
  6433.  
  6434.             Unlike GWBASIC/BASICA, you cannot set the system time with TIME$,
  6435.        however, you can set the system time from DOS by typing TIME.
  6436.  
  6437.        See also:
  6438.  
  6439.             DATE$, TIMER
  6440.  
  6441.  
  6442.  
  6443.  
  6444.  
  6445.  
  6446.  
  6447.  
  6448.  
  6449.  
  6450.  
  6451.  
  6452.  
  6453.  
  6454.  
  6455.  
  6456.  
  6457.  
  6458.  
  6459.  
  6460.  
  6461.  
  6462.  
  6463.  
  6464.  
  6465.  
  6466.  
  6467.                                       Page - 97
  6468.  
  6469.  
  6470.  
  6471.  
  6472.  
  6473.  
  6474.                                         TIMER
  6475.  
  6476.        Format:        integer1 = TIMER
  6477.  
  6478.        Description:
  6479.  
  6480.             This statement will retrieve a timer count from the PCs hardware
  6481.        circuitry.  The timer count will be placed in integer1.  The timer count
  6482.        is in "clock ticks".  A "clock tick" occurs in the PC approximately 18.2
  6483.        times per second.  The PC is continually incrementing this clock
  6484.        counter.  This statement can be used to time the duration of events.
  6485.  
  6486.        Example:
  6487.  
  6488.  
  6489.             CLS
  6490.             PRINT "PRESS A KEY"
  6491.             STARTCNT&=TIMER
  6492.        LOOP:X$=INKEY$
  6493.             IF X$="" THEN LOOP:
  6494.             ENDCNT&=TIMER
  6495.             ELAPSED&=ENDCNT&-STARTCNT&
  6496.             ELAPSED&=ABS(ELAPSED&)
  6497.             ELAPSED&=ELAPSED&/18
  6498.             PRINT "IT TOOK YOU APPROXIMATELY";
  6499.             PRINT ELAPSED&
  6500.             PRINT " SECONDS TO PRESS A KEY"
  6501.             
  6502.  
  6503.        The above code fragment will time how long you wait to press a key in
  6504.        seconds.  You could modify it easily to display in clock ticks, which
  6505.        would provide much more accuracy, if you deleted the statement which
  6506.        divides the ELAPSED count by 18.
  6507.  
  6508.        Comments:
  6509.  
  6510.             Note that it is necessary to use the absolute value of ELAPSED&
  6511.        since the clock counts is stored as unsigned integers.  ASIC integers,
  6512.        on the other hand, are signed.  If integer1 is a long integer variable,
  6513.        then TIMER retrieves the full PC timer value.  However, if a normal
  6514.        integer variable is specified as integer1, then ASIC retrieves the least
  6515.        16 significant bits from the PC timer.
  6516.  
  6517.        See also:
  6518.  
  6519.             DATE$,TIME$
  6520.  
  6521.  
  6522.  
  6523.  
  6524.  
  6525.  
  6526.  
  6527.  
  6528.  
  6529.  
  6530.  
  6531.  
  6532.  
  6533.                                       Page - 98
  6534.  
  6535.  
  6536.  
  6537.  
  6538.  
  6539.  
  6540.                                         UCASE$
  6541.  
  6542.        Format:        string1=UCASE$(string2)
  6543.  
  6544.        Description:
  6545.  
  6546.             This statement will convert all lowercase letters in string2 to
  6547.        uppercase, and store the resulting string in string1.
  6548.  
  6549.        Example:
  6550.  
  6551.             A$=UCASE$("123 Main St, USA")
  6552.  
  6553.        After execution of this statement, the variable "A$" will contain the
  6554.        string "123 MAIN ST, USA".
  6555.  
  6556.        See also:
  6557.  
  6558.             LCASE$
  6559.  
  6560.  
  6561.  
  6562.                                          VAL
  6563.  
  6564.        Format:        integer1 = VAL (string1)
  6565.  
  6566.        Description:
  6567.  
  6568.             This statement will attempt to convert string1 into an integer
  6569.        value, and it will store the result in integer1.
  6570.  
  6571.        Example:
  6572.  
  6573.                  A$ = "12345"
  6574.                  A = VAL (A$)
  6575.  
  6576.        After execution of these statements, variable "A" would contain the
  6577.        value 12345.
  6578.  
  6579.  
  6580.        See also:
  6581.  
  6582.             STR$
  6583.  
  6584.  
  6585.  
  6586.  
  6587.  
  6588.  
  6589.  
  6590.  
  6591.  
  6592.  
  6593.  
  6594.  
  6595.  
  6596.  
  6597.  
  6598.  
  6599.                                       Page - 99
  6600.  
  6601.  
  6602.  
  6603.  
  6604.  
  6605.  
  6606.                                         VARPTR
  6607.  
  6608.        Format:        integer1 = VARPTR (variable1)
  6609.  
  6610.        Description:
  6611.  
  6612.             This statement will return the address of a variable  variable1 and
  6613.        store it in integer1.  This may be used to peek and poke values directly
  6614.        into a variable.
  6615.  
  6616.        Example:
  6617.  
  6618.                  A$ = "XYZ"
  6619.                  B = VARPTR(A$)
  6620.                  C = PEEK (B)
  6621.                  PRINT C
  6622.  
  6623.        After execution of these statements the screen would display the number
  6624.        88 which is the number for the ASCII character "X".
  6625.  
  6626.        See also:
  6627.  
  6628.             PEEK, POKE
  6629.  
  6630.  
  6631.  
  6632.                                       WHILE/WEND
  6633.  
  6634.        Format:        WHILE condition
  6635.                       WEND
  6636.  
  6637.        Description:
  6638.  
  6639.             This statement will execute those statements which are between the
  6640.        WHILE and the WEND statements as long as the "condition" is true.  The
  6641.        operand "condition" is one of the following:
  6642.  
  6643.                       integer1 > integer2
  6644.                       string1  > string2
  6645.                       integer1 = integer2
  6646.                       string1  = string2
  6647.                       integer1 < integer2
  6648.                       string1  < string2
  6649.  
  6650.        Example:
  6651.  
  6652.                  PRINT "PRESS A KEY TO CONTINUE"
  6653.                  A$=""
  6654.                  WHILE A$=""
  6655.                       A$=INKEY$
  6656.                  WEND
  6657.  
  6658.        In this example, the program will pause until the user presses a key.
  6659.        WHILE statements may be nested 25 levels deep.
  6660.  
  6661.  
  6662.  
  6663.  
  6664.  
  6665.                                       Page - 100
  6666.  
  6667.  
  6668.  
  6669.  
  6670.  
  6671.  
  6672.                                         WIDTH
  6673.  
  6674.        Format:        WIDTH integer1
  6675.  
  6676.        Description:
  6677.  
  6678.             This statement will set the screen to 40 column text or 80 column
  6679.        text mode only.  The only two valid values for integer1 are thus 40 and
  6680.        80.  In ASIC, WIDTH 80 is equivalent to executing SCREEN 0.  Also, WIDTH
  6681.        40 is equivalent to executing SCREEN 1.  If you use WIDTH 40, you should
  6682.        always reset the screen back to WIDTH 80 before terminating your program
  6683.        with END.  Otherwise, your PC will be left in 40 column mode.
  6684.  
  6685.        Example:
  6686.  
  6687.             WIDTH 40
  6688.  
  6689.        The above statement would put the PC in 40 column mode.
  6690.  
  6691.  
  6692.  
  6693.                                          ZBIT
  6694.  
  6695.        Format:        integer1 = ZBIT(integer2,integer3)
  6696.  
  6697.        Description:
  6698.  
  6699.             This statement is used to determine if a single "bit" in an integer
  6700.        variable is set to "1".  Integer2 represents the bit to be tested.  It
  6701.        should be in the range 0 to 15.  Integer3 represents the integer
  6702.        variable or constant to be tested.  The result of the test is returned
  6703.        to integer1.  If the bit was set, integer1 will be set to "1",
  6704.        otherwise, integer1 will be set to "0".
  6705.  
  6706.        Example:
  6707.  
  6708.                  GAMEPORT = INP(513)
  6709.                  TRIGGER = ZBIT(4,GAMEPORT)
  6710.                  IF TRIGGER = 1 THEN TRIGGERPRESSED:
  6711.  
  6712.        In this example, the joystick port is read, and its status is placed in
  6713.        the variable "GAMEPORT".  The bit which represents the trigger for
  6714.        joystick 1 is then tested using ZBIT.  If the trigger bit is set, then
  6715.        the program would transfer to the label "TRIGGERPRESSED:".  Note that
  6716.        the above code assumes that a game card is present in the computer.
  6717.  
  6718.        Comments:
  6719.  
  6720.             This statement is an extension over GWBASIC/BASICA, although it is
  6721.        possible to perform similar tests in GWBASIC/BASICA with the boolean AND
  6722.        statement.
  6723.  
  6724.  
  6725.  
  6726.  
  6727.  
  6728.  
  6729.  
  6730.  
  6731.                                       Page - 101
  6732.  
  6733.  
  6734.  
  6735.  
  6736.  
  6737.  
  6738.                                         ZMODE
  6739.  
  6740.        Format:        integer = ZMODE
  6741.  
  6742.        Description:
  6743.  
  6744.             This command returns a code which indicates whether a color or
  6745.        monochrome card is active in the system.  ZMODE returns a value of 1
  6746.        when a color card is detected, and a value of 0 for monochrome.
  6747.  
  6748.        Example:
  6749.  
  6750.                  A = ZMODE
  6751.                  IF A = 1 THEN CONTINUE:
  6752.                  PRINT "This program requires a Color Card to Run"
  6753.                  END
  6754.                  CONTINUE: REM rest of code follows here
  6755.  
  6756.        The above code fragment will check for a color card, if not found the
  6757.        program will terminate with an appropriate message.  Otherwise the
  6758.        program will continue.
  6759.  
  6760.        Comments:
  6761.  
  6762.             This statement is an extension over BASICA/GWBASIC.
  6763.  
  6764.  
  6765.  
  6766.  
  6767.  
  6768.  
  6769.  
  6770.  
  6771.  
  6772.  
  6773.  
  6774.  
  6775.  
  6776.  
  6777.  
  6778.  
  6779.  
  6780.  
  6781.  
  6782.  
  6783.  
  6784.  
  6785.  
  6786.  
  6787.  
  6788.  
  6789.  
  6790.  
  6791.  
  6792.  
  6793.  
  6794.  
  6795.  
  6796.  
  6797.                                       Page - 102
  6798.  
  6799.  
  6800.  
  6801.  
  6802.  
  6803.  
  6804.  
  6805.  
  6806.  
  6807.                                        A S I C
  6808.  
  6809.                                       Chapter 8
  6810.  
  6811.                           Compatibility with GWBASIC/BASICA
  6812.  
  6813.  
  6814.        In general, although ASIC does not support all options on every BASIC
  6815.        statement, those it does support work like they do in BASICA/GWBASIC.
  6816.        The known exceptions are listed in this chapter.
  6817.  
  6818.  
  6819.        INKEY$
  6820.  
  6821.             This statement is compatible, however ASIC does provide an
  6822.        extension over GWBASIC/BASICA.  If an extended key is pressed (e.g. F1-
  6823.        F10), ASIC returns the scan code for the extended key, and sets a
  6824.        special system variable "EXTENDED" to a value of 1.  For non-extended
  6825.        keys, the "EXTENDED" variable will contain 0.
  6826.  
  6827.  
  6828.        FILE HANDLING
  6829.  
  6830.             ASIC provides no EOF statement or ON ERROR statements.  Instead,
  6831.        ASIC sets a special system variable when an error occurs during file
  6832.        I/O.  This special variable is called "ERROR" and it is set after every
  6833.        file I/O statement (OPEN/INPUT#/PRINT#/CLOSE, etc) to either 0 to
  6834.        indicate no errors, or a non-zero value.  If a non-zero value is
  6835.        present, an error has occurred.  The specific errors are identified in
  6836.        chapter 10.
  6837.  
  6838.  
  6839.        FILE FORMAT
  6840.  
  6841.             ASIC Files are written with 2/4 bytes per normal/long integer in
  6842.        binary format, instead of string format as in BASICA/GWBASIC.  Strings
  6843.        are written as a sequence of ASCII characters terminated by an ASCII
  6844.        null, or optionally with no NULL terminator.
  6845.  
  6846.  
  6847.        PUNCTUATION
  6848.  
  6849.             ASIC permits use of punctuation that it does not require to allow
  6850.        you to enter statements in their familiar GWBASIC/BASICA Formats.  For
  6851.        example:
  6852.  
  6853.                  A = ABS (B(1))
  6854.  
  6855.             This statement is valid in both ASIC and in GWBASIC/BASICA.
  6856.        However, ASIC ignores the parenthesis and comma.  Thus ASIC will
  6857.        actually accept the following formats as alternatives to the above:
  6858.  
  6859.             A = ABS B 1
  6860.             A = ABS B 1,,,,,,)))))
  6861.  
  6862.  
  6863.                                       Page - 103
  6864.  
  6865.  
  6866.  
  6867.  
  6868.  
  6869.  
  6870.        FOR/NEXT
  6871.  
  6872.             FOR/NEXT loops always fall through the body of the FOR at least one
  6873.        time in ASIC.  This does not happen in BASICA/GWBASIC.  For more
  6874.        information on this, refer to Chapter 7.
  6875.  
  6876.  
  6877.        RND
  6878.  
  6879.             RND (N) returns a value from 0-32767 for normal integers and     0-
  6880.        2,147,483,647 for long integers instead of 0 to 1 as in BASICA/GWBASIC.
  6881.  
  6882.  
  6883.        LOCATE/CSRLIN/POS
  6884.  
  6885.             Coordinates are specified in range 0-24 and 0-79 instead of 1-25
  6886.        and 1-80.
  6887.  
  6888.  
  6889.        PSET/PRESET/POINT
  6890.  
  6891.             Coordinates are specified in row/column order instead of column/row
  6892.        order.
  6893.  
  6894.  
  6895.        BLOAD/BSAVE
  6896.  
  6897.             File formats are not compatible with GWBASIC/BASICA.  BLOAD
  6898.        requires offset and the number of bytes to read.
  6899.  
  6900.        OPENCOM/COMSTAT/SEND/RECEIVE
  6901.  
  6902.             These statements provide serial port support in ASIC.  In
  6903.        GWBASIC/BASICA this is provided by OPEN/INPUT#/PRINT#.
  6904.  
  6905.        DATE$/TIME$
  6906.  
  6907.             ASIC allows you to retrieve the system date and time, but will not
  6908.        allow you to set new system date/time values.
  6909.  
  6910.        CALL/RUN
  6911.  
  6912.             These statements perform functions similar to their GWBASIC/BASICA
  6913.        counterparts, but function differently.  Refer to the keyword reference
  6914.        for the appropriate keyword for details on their operation.
  6915.  
  6916.  
  6917.  
  6918.  
  6919.  
  6920.  
  6921.  
  6922.  
  6923.  
  6924.  
  6925.  
  6926.  
  6927.  
  6928.  
  6929.                                       Page - 104
  6930.  
  6931.  
  6932.  
  6933.  
  6934.  
  6935.  
  6936.        EXTENSIONS OVER BASICA/GWBASIC
  6937.  
  6938.  
  6939.        CODE                COMMAND$
  6940.        INT86               FILEPOS
  6941.        FIND                LCASE$
  6942.        LTRIM$              MOD
  6943.        RTRIM               UCASE$
  6944.        ZBIT                ZMODE
  6945.  
  6946.             The statements above are extensions over BASICA/GWBASIC.
  6947.  
  6948.  
  6949.  
  6950.  
  6951.  
  6952.  
  6953.  
  6954.  
  6955.  
  6956.  
  6957.  
  6958.  
  6959.  
  6960.  
  6961.  
  6962.  
  6963.  
  6964.  
  6965.  
  6966.  
  6967.  
  6968.  
  6969.  
  6970.  
  6971.  
  6972.  
  6973.  
  6974.  
  6975.  
  6976.  
  6977.  
  6978.  
  6979.  
  6980.  
  6981.  
  6982.  
  6983.  
  6984.  
  6985.  
  6986.  
  6987.  
  6988.  
  6989.  
  6990.  
  6991.  
  6992.  
  6993.  
  6994.  
  6995.                                       Page - 105
  6996.  
  6997.  
  6998.  
  6999.  
  7000.  
  7001.  
  7002.  
  7003.  
  7004.  
  7005.                                        A S I C
  7006.  
  7007.                                       Chapter 9
  7008.  
  7009.                                 Technical Details/Tips
  7010.  
  7011.  
  7012.        This chapter contains technical information and tips regarding ASIC.
  7013.  
  7014.  
  7015.  
  7016.                                    COMPILER LIMITS
  7017.  
  7018.  
  7019.        Maximum Source Program Size:   Unlimited - Command Line
  7020.                                       809 Lines - Integrated Environment
  7021.  
  7022.        Maximum Object Program Size:   64k bytes  (.COM Format restriction)
  7023.  
  7024.        Maximum Source Line Length     128 bytes - Command Line
  7025.                                       80 bytes - Integrated Environment
  7026.  
  7027.        Compiler Symbol Table Size:    750+ Symbols
  7028.  
  7029.        Maximum Number of Arrays:      25
  7030.  
  7031.        FOR/NEXT Nesting Depth         25
  7032.  
  7033.        IF/THEN/ELSE Nesting Depth     25
  7034.  
  7035.        WHILE/WEND Nesting Depth       25
  7036.  
  7037.        Compiler Memory Requirements   305k - Command Line
  7038.                                       405k - Integrated Environment
  7039.  
  7040.  
  7041.                                   COMPILER OPERATION
  7042.  
  7043.  
  7044.             ASIC is a single pass compiler written entirely in C (Borland Turbo
  7045.        C Version 2.0).  Each source statement is translated directly into
  7046.        machine code.  ASIC compiles 100% in memory for maximum speed.  The
  7047.        compiler does not require any disk work space.  ASIC generates a minimum
  7048.        of error checking code.  This is because the ASIC philosophy stresses
  7049.        execution speed.  This does place greater responsibility on the
  7050.        programmer to check for out of bounds conditions, etc..
  7051.  
  7052.  
  7053.  
  7054.  
  7055.  
  7056.  
  7057.  
  7058.  
  7059.  
  7060.  
  7061.                                       Page - 106
  7062.  
  7063.  
  7064.  
  7065.  
  7066.  
  7067.  
  7068.  
  7069.  
  7070.  
  7071.                                  MEMORY OPTIMIZATION
  7072.  
  7073.  
  7074.             ASIC 3.0 provides 32 bit long integers in addition to 16 bit normal
  7075.        integers.  This allows you to store much larger numbers, however,
  7076.        nothing in life is free.  Long integers will increase the size of the
  7077.        resulting ".COM" file by approximately 475 bytes.  If you are not using
  7078.        long integers, be sure to compile with the "Extended Math" Option turned
  7079.        OFF so that ASIC does not include these unneeded bytes in your ".COM"
  7080.        file. Otherwise, ASIC will include the long integer support code in your
  7081.        ".COM" file, even if you never create a single long integer!  Note: by
  7082.        default, this option is turned off in both the command line and
  7083.        integrated version of the compiler.
  7084.  
  7085.             Also remember that ASIC's debugging option increases your ".COM"
  7086.        file size.  So don't forget to recompile your program with the
  7087.        "Debugging" Option turned off (after you have finished debugging it, of
  7088.        course).
  7089.  
  7090.  
  7091.  
  7092.  
  7093.  
  7094.  
  7095.  
  7096.  
  7097.  
  7098.  
  7099.  
  7100.  
  7101.  
  7102.  
  7103.  
  7104.  
  7105.  
  7106.  
  7107.  
  7108.  
  7109.  
  7110.  
  7111.  
  7112.  
  7113.  
  7114.  
  7115.  
  7116.  
  7117.  
  7118.  
  7119.  
  7120.  
  7121.  
  7122.  
  7123.  
  7124.  
  7125.  
  7126.  
  7127.                                       Page - 107
  7128.  
  7129.  
  7130.  
  7131.  
  7132.  
  7133.  
  7134.  
  7135.  
  7136.  
  7137.                                    DEBUGGER LIMITS
  7138.  
  7139.  
  7140.        Maximum Concurrent Breakpoints 20
  7141.  
  7142.        Maximum Concurrent Watches     10
  7143.  
  7144.        Maximum Symbol Length          30 Characters
  7145.  
  7146.        Maximum Symbols                Same as Compiler
  7147.  
  7148.        Maximum Source Statements      809 Lines
  7149.  
  7150.  
  7151.                                   DEBUGGER OPERATION
  7152.  
  7153.             When you select the "Debugging code" compiler option, the ASIC
  7154.        compiler inserts additional machine language instructions into your
  7155.        program.  It inserts a single statement at the beginning of your program
  7156.        (specifically, INT 3) which allows it to gain control.  When the ASIC
  7157.        editor is loaded, it saves the existing INT 3 vector, and installs the
  7158.        ASIC Debugger as INT 3.  In this way, when your program begins
  7159.        executing, the INT 3 statement that ASIC inserted in your program causes
  7160.        a transfer of control to the debugger.  Once the debugger gains control,
  7161.        it can set or remove additional breakpoints as needed in your program,
  7162.        plus provide access to the video memory and variable memory locations
  7163.        with the Swap, Watch, Unwatch, and Modify Commands.  When you exit the
  7164.        ASIC editor, ASIC deinstalls the debugger from INT 3, and restores the
  7165.        original interrupt 3 vector.
  7166.  
  7167.             The compiler also creates a file with a ".DBG" extension which
  7168.        contains the symbolic information needed by the debugger (ie, variable
  7169.        names and offsets, and source statement offsets).
  7170.  
  7171.  
  7172.                                   DEBUGGER OVERHEAD
  7173.  
  7174.             Running a program in debugging mode adds a small amount of overhead
  7175.        to your program (both compiled code size, and execution speed).
  7176.        Specifically, the size of the debugging code will be (approximately):
  7177.  
  7178.                  CodeSizeIncrease = 1 + LinesOfSourceCode
  7179.  
  7180.        Note that the actual increase will usually be less than the above, since
  7181.        DIM, DATA, REM, and blank source lines do not require debugging code.
  7182.        The reduction in execution speed is very slight in most cases (for you
  7183.        assembly language programmers out there, a single NOP instruction is
  7184.        executed for each source line).
  7185.  
  7186.  
  7187.  
  7188.  
  7189.  
  7190.  
  7191.  
  7192.  
  7193.                                       Page - 108
  7194.  
  7195.  
  7196.  
  7197.  
  7198.  
  7199.  
  7200.  
  7201.  
  7202.  
  7203.                                    STORAGE FORMATS
  7204.  
  7205.  
  7206.        Normal integers are stored in ASIC as two bytes, with the low order byte
  7207.        appearing first (as per Intel conventions).  Long integers are stored in
  7208.        ASIC as four bytes, with the least significant word first, followed by
  7209.        the most significant word.  Within these two words, the least
  7210.        significant byte appears first followed by the most significant byte.
  7211.        String variables are stored as FIXED 80 character strings terminated by
  7212.        an ASCII null character for a total length of 81 characters.  String
  7213.        constants are stored with 1 byte per character in the string followed by
  7214.        a terminating ASCII null character.  Each element in an array requires
  7215.        two bytes.  (Don't forget arrays have an element zero (ie  DIM A(2) is
  7216.        comprised of A(0), A(1), and A(2)).
  7217.  
  7218.        Examples:
  7219.  
  7220.                  Item        Data Type              Storage Requirements
  7221.                    A         Integer Variable            2 bytes
  7222.                    17        Integer Constant            2 bytes
  7223.                    A&        Long Integer Variable       4 bytes
  7224.                  55555&      Long Integer Constant       4 bytes
  7225.                   A$         String Variable             81 bytes
  7226.                   "ABC"      String Constant             4 bytes
  7227.                   "A"        String Constant             2 bytes
  7228.                  DIM A(10)   Integer Array               22 bytes
  7229.                  DIM A(1)    Integer Array               4 bytes
  7230.                  DIM A&(10)  Long Integer Array          44 bytes
  7231.  
  7232.        As you can see, string variables are expensive in terms of storage
  7233.        space.  Since string constants are stored at actual length +1, It is
  7234.        MUCH more efficient to store short strings as constants in ASIC in terms
  7235.        of storage space.  There is no performance advantage to constants over
  7236.        variables, however.
  7237.  
  7238.        In disk files, strings and integers are written out in the above
  7239.        formats.  Note that unlike GWBASIC/BASICA, integers are NOT expanded
  7240.        into strings when written, and conversely, not converted from strings to
  7241.        integers when read.  String variables and constants are written out  as
  7242.        ASCII strings terminated by a null character (however, the null can be
  7243.        suppressed).  Thus, string variables when written to disk, take the same
  7244.        space byte for byte as string constants.
  7245.  
  7246.        The reason behind fixed length string variables was avoidance of string
  7247.        "garbage collection".  In addition to slight performance advantages,
  7248.        there is the added benefit of providing a string memory address which
  7249.        never changes.  Thus once VARPTR retrieves the address of a variable,
  7250.        you never have to worry about it changing.
  7251.  
  7252.  
  7253.  
  7254.  
  7255.  
  7256.  
  7257.  
  7258.  
  7259.                                       Page - 109
  7260.  
  7261.  
  7262.  
  7263.  
  7264.  
  7265.  
  7266.  
  7267.  
  7268.  
  7269.                                       MEMORY MAP
  7270.  
  7271.        The following describes the structure of the ".COM" file created by
  7272.        ASIC.  All addresses are in Hexadecimal.
  7273.  
  7274.  
  7275.  
  7276.             Description                   Address Range
  7277.        ------------------------------     -------------
  7278.        Program Segment Prefix (PSP)       0000 - 00FF
  7279.         (Created/Required by DOS)
  7280.  
  7281.        Transfer to Program Code           0100 - 0102
  7282.        String Conversion Buffer           0103 - 0109
  7283.        Input Buffer                       010A - 015B
  7284.        Screen Width                       015C
  7285.        Color/Attribute Byte               015D
  7286.        Screen Graphics Mode               015E
  7287.        Cursor Position                    015F - 0160
  7288.        File Control Table                 0161 - 0169
  7289.        ERROR System Variable              016A - 016B
  7290.        System Subroutine Vectors          016C - 017F
  7291.        EXTENDED System Variable           0180 - 0181
  7292.        RND Seed                           0182 - 0185
  7293.        Math Work Area                     0186 - 018D
  7294.        DEFSEG System Variable             018E - 018F
  7295.        Start DATA Block Pointer           0190 - 0191
  7296.        Current DATA Block Pointer         0192 - 0193
  7297.        Reserved for future use            0194 - 0195
  7298.        System Subroutines                 0196+
  7299.                  |
  7300.                  |
  7301.                  v
  7302.        Data Segment                       Address Varies
  7303.                  |
  7304.                  |
  7305.                  |
  7306.                  v
  7307.        Code Segment                       Address Varies
  7308.                  |
  7309.                  |
  7310.                  |
  7311.                  v
  7312.                  ^
  7313.                  |
  7314.                  |
  7315.        Program Stack  (builds downward)   FFFF
  7316.  
  7317.  
  7318.  
  7319.  
  7320.  
  7321.  
  7322.  
  7323.  
  7324.  
  7325.                                       Page - 110
  7326.  
  7327.  
  7328.  
  7329.  
  7330.  
  7331.  
  7332.  
  7333.  
  7334.  
  7335.                                        A S I C
  7336.  
  7337.                                       Chapter 10
  7338.  
  7339.                                     Error Messages
  7340.  
  7341.  
  7342.        This chapter contains compiler messages, run-time error messages, and
  7343.        File I/O Error Codes.
  7344.  
  7345.  
  7346.  
  7347.                                    COMPILER ERRORS
  7348.  
  7349.  
  7350.  
  7351.             These messages indicate errors in your source program.  Those which
  7352.        begin with "** E" indicate "fatal" errors, which prevent ASIC from
  7353.        successfully compiling your program.  Warnings begin with "* W" and
  7354.        indicate possible errors and informative messages which will not prevent
  7355.        ASIC from generating an executable ".COM" file.
  7356.  
  7357.  
  7358.                                      FATAL ERRORS
  7359.  
  7360.        ** E001 **  File Extensions must be either ".ASI" or omitted
  7361.  
  7362.             ASIC requires source programs to have the extension ".ASI".  Rename
  7363.        your source file with the DOS "RENAME" command to the name "file.ASI",
  7364.        where "file" is your source program name.  Then resubmit the compile.
  7365.  
  7366.  
  7367.        ** E002 ** File Name specified is too long
  7368.  
  7369.             The source file may be identified by a file name up to 124
  7370.        characters long including disk drive specifiers and sub directory names.
  7371.        Move the source program to a directory which may be specified within
  7372.        this length.
  7373.  
  7374.  
  7375.        ** E003 ** Error Opening File:  xxxxxxxx.xxx
  7376.  
  7377.             The file indicated by "xxxxxxxx.xxx" could not be opened by ASIC.
  7378.        This error can be issued when ASIC attempts to read your source file, or
  7379.        when it writes any one of the possible output files (".COM", ".LST", or
  7380.        ".SYM").  If indicated file is your source program name, verify the
  7381.        spelling, and either make sure it is in the same directory as ASIC, or
  7382.        specify the full path name for the file.  If the indicated file is an
  7383.        output file, the error is usually a result of a write protect tab on the
  7384.        diskette or insufficient disk space.
  7385.  
  7386.  
  7387.  
  7388.  
  7389.  
  7390.  
  7391.                                       Page - 111
  7392.  
  7393.  
  7394.  
  7395.  
  7396.  
  7397.  
  7398.        ** E004 ** DIM Statements must precede all others except REMs
  7399.  
  7400.             In ASIC, DIM statements must appear before all other statement
  7401.        types, except REM statements (or blank lines).
  7402.  
  7403.  
  7404.        ** E005 ** Too many characters in source line
  7405.  
  7406.             Source program lines in ASIC are limited to 120 characters.  Change
  7407.        the indicated source line, so that it fits within this limit.
  7408.  
  7409.  
  7410.        ** E006 ** Unmatched Quote ('"') in source line
  7411.  
  7412.             A string constant was found with either no opening or closing quote
  7413.        mark.  Quotation marks must be matched in pairs within source lines.
  7414.  
  7415.  
  7416.        ** E007 ** Token in source line > 82 characters long
  7417.  
  7418.             Individual tokens in ASIC are limited to 82 characters in length,
  7419.        regardless of type.  A token is a group of letters and/or numbers
  7420.        delimited on either side by a space or math symbol.  Example, even
  7421.        though string constants are limited to 80 characters, ASIC considers the
  7422.        "token" to include the quotation marks.  In this case, however, ASIC
  7423.        detected a token longer than the longest possible token, the string
  7424.        constant.  Check for "tokens" or "words" more than 82 characters long in
  7425.        the indicated source line.
  7426.  
  7427.  
  7428.        ** E008 ** More than 30 tokens in source line
  7429.  
  7430.             Since all ASIC statements require less than 30 tokens, ASIC will
  7431.        flag any statement which contains more than this number.  A token is a
  7432.        group of letters and/or numbers delimited on either side by a space or
  7433.        math symbol.
  7434.  
  7435.  
  7436.        ** E009 ** Keyword Unknown:  xxxxxxxxx
  7437.  
  7438.             ASIC detected the symbol indicated by "xxxxxxxx" in your source
  7439.        line, but it was not a valid variable name, constant, label, or ASIC
  7440.        Function Name.
  7441.  
  7442.  
  7443.        ** E010 ** Symbol Table Space Exhausted
  7444.  
  7445.             The symbol table is used by ASIC to keep track of your variables,
  7446.        constants and labels.  It is also used to hold information used in
  7447.        FOR/NEXT processing, and internal system subroutine generation.  Reduce
  7448.        the number of LABELS, VARIABLE NAMES, or CONSTANTS in your program, and
  7449.        recompile.
  7450.  
  7451.  
  7452.  
  7453.  
  7454.  
  7455.  
  7456.  
  7457.                                       Page - 112
  7458.  
  7459.  
  7460.  
  7461.  
  7462.  
  7463.  
  7464.        ** E011 ** Symbol Incomplete Reference Space Exhausted
  7465.  
  7466.             This table is a sister table to the Symbol Table, it contains
  7467.        references to LABEL type symbols which have been defined in the symbol
  7468.        table.  Try to reduce the number of references made to LABEL symbols
  7469.        within the program and recompile.
  7470.  
  7471.  
  7472.        ** E012 ** No keywords in source line
  7473.  
  7474.             Every ASIC source program line must contain an ASIC keyword (eg.
  7475.        "PRINT", "=", "GOSUB", etc).
  7476.  
  7477.  
  7478.        ** E013 ** Syntax Error
  7479.  
  7480.             The "catch-all" error for ASIC.  This error is usually issued when
  7481.        ASIC has identified an error in the parameters for an ASIC keyword.  The
  7482.        best way to find this error is to refer to the entry in the Keyword
  7483.        Reference (chapter 7) for that particular keyword.
  7484.  
  7485.  
  7486.        ** E014 ** Undefined Symbol:  xxxxxx
  7487.  
  7488.             ASIC detected a LABEL "xxxxxx" which was referenced, but never
  7489.        defined in the program.  A label is considered to be defined when it is
  7490.        the first token on the source line.  A reference to a label occurs when
  7491.        a label name appears elsewhere in the source statement
  7492.  
  7493.             Example:           PRINTIT:   PRINT "hello"      <---Defined
  7494.                                GOTO PRINTIT:                 <--Referenced
  7495.  
  7496.  
  7497.        ** E015 ** Compiled Code Exceeds 64k-Can't fit in .COM file
  7498.  
  7499.             Your source program is too large to fit in the .COM file format.
  7500.        Eliminate extraneous variables and program statements.  Note:  REM
  7501.        statements do NOT generate any output code, so elimination of REM
  7502.        statements will not alleviate this problem.
  7503.  
  7504.  
  7505.        ** E016 ** Integer Constant Not in range +32767 to -32767
  7506.  
  7507.             The above range of numbers is the maximum which can be contained in
  7508.        integer format in ASIC.  Reduce the constant so that it falls within the
  7509.        specified range.
  7510.  
  7511.  
  7512.        ** E017 ** Duplicate Label:    xxxxxx
  7513.  
  7514.             The indicated label "xxxxxx" was defined more than once in the
  7515.        program.  Reduce the multiple definitions to a single definition and
  7516.        then recompile.
  7517.  
  7518.  
  7519.  
  7520.  
  7521.  
  7522.  
  7523.                                       Page - 113
  7524.  
  7525.  
  7526.  
  7527.  
  7528.  
  7529.  
  7530.        ** E018 ** Second FOR defined for variable with no intervening NEXT
  7531.  
  7532.             FOR/NEXT Statements cannot be nested with the same variable name.
  7533.  
  7534.                  VALID                              INVALID
  7535.  
  7536.                  FOR I=1 TO 10                      FOR I=1 TO 10
  7537.                       FOR J=1 TO 20                      FOR I=1 TO 20
  7538.                       NEXT J                             NEXT I
  7539.                  NEXT I                             NEXT I
  7540.  
  7541.  
  7542.        ** E019 ** For/Next Table Space Exhausted
  7543.  
  7544.             An unlimited of FOR/NEXT statements can exist, however, they can be
  7545.        "nested" to a maximum depth of 25.
  7546.  
  7547.  
  7548.        ** E020 ** NEXT without FOR
  7549.  
  7550.             A NEXT statement was found, however it was not preceded in the
  7551.        source program with a matching FOR statement.
  7552.  
  7553.  
  7554.        ** E021 ** FOR without NEXT at Source Line NNNNN
  7555.  
  7556.             The indicated source line NNNNN contains a FOR statement, for which
  7557.        no NEXT statement was ever found.
  7558.  
  7559.  
  7560.        ** E022 ** Invalid Option:  x
  7561.  
  7562.             An invalid compile option was specified.  Review Chapter 5 for a
  7563.        list of valid compile options.
  7564.  
  7565.  
  7566.        ** E023 ** More than 63000 bytes in Data Segment
  7567.  
  7568.             An ASIC program can be up to 64k bytes in size.  Of this total,
  7569.        63000 bytes can contain program variables and constants, leaving at
  7570.        least 1k for program code.  Reduce the number of variables and constants
  7571.        in your program.
  7572.  
  7573.  
  7574.        ** E024 ** Too many arrays defined
  7575.  
  7576.             A single ASIC source program can contain up to 25 arrays.
  7577.  
  7578.  
  7579.        ** E025 ** Re-DIMension of previously DIMensioned variable
  7580.  
  7581.             Only one DIM statement can be specified per array name.
  7582.  
  7583.  
  7584.  
  7585.  
  7586.  
  7587.  
  7588.  
  7589.                                       Page - 114
  7590.  
  7591.  
  7592.  
  7593.  
  7594.  
  7595.  
  7596.        ** E026 ** Invalid subscript on Array
  7597.  
  7598.             A subscript was found which is not valid.  Either ASIC expected
  7599.        more or less subscripts than were present, or ASIC detected a subscript
  7600.        which was itself an array.  Subscripts on arrays may only be non-array
  7601.        variables and/or integer constants.
  7602.  
  7603.  
  7604.        ** E027 ** String Arrays Are Not Supported
  7605.  
  7606.             A DIM statement specified a string variable type.  Only integer
  7607.        arrays are supported.
  7608.  
  7609.  
  7610.        ** E028 ** Comfile Buffer - Memory Allocation Failed
  7611.  
  7612.             ASIC attempted to allocate memory for an internal buffer .  This
  7613.        memory allocation failed.  More memory is required.  If you have any
  7614.        TSRs loaded in memory, remove them and try again.
  7615.  
  7616.  
  7617.        ** E029 ** Codeseg Buffer - Memory Allocation Failed.
  7618.  
  7619.             ASIC attempted to allocate memory for an internal buffer.  This
  7620.        memory allocation failed.  More memory is required.  If you have any
  7621.        TSRs are loaded in memory, remove them and try again.
  7622.  
  7623.  
  7624.        ** E030 ** Code Segment Memory Exhausted
  7625.  
  7626.             ASIC will attempt to allocate 64k of memory to use a work space to
  7627.        hold the code generated by your program statements.  This message
  7628.        indicates that the amount of memory it was able to allocate was not
  7629.        sufficient to hold the code generated by the program you are trying to
  7630.        compile.
  7631.  
  7632.  
  7633.        ** E031 ** Data Segment Memory Exhausted
  7634.  
  7635.             ASIC will attempt to allocate 64k of memory to use a work space to
  7636.        hold the data segment for your program.  This message indicates that the
  7637.        amount of memory it was able to allocate was not sufficient to hold the
  7638.        data generated by the program you are trying to compile.
  7639.  
  7640.  
  7641.        ** E032 ** Insufficient Memory to Run ASIC
  7642.  
  7643.             You don't have enough memory to run ASIC.  If you have any TSRs
  7644.        loaded, try removing them and re-compiling.
  7645.  
  7646.  
  7647.        ** E033 ** Edit Buffer Memory Allocation Failed
  7648.  
  7649.             ASIC attempted to allocate memory for the edit buffer in the
  7650.        integrated environment, but was unable to.  If you have any TSRs loaded,
  7651.        remove them from memory, and try again.
  7652.  
  7653.  
  7654.  
  7655.                                       Page - 115
  7656.  
  7657.  
  7658.  
  7659.  
  7660.  
  7661.  
  7662.        ** E034 ** DATA Statements Must Precede All Except DIMs or REMs
  7663.  
  7664.             If you wish to use the DATA statement in ASIC, you must place them
  7665.        all at the beginning of your program following any DIM and/or REM
  7666.        statements (or blank lines).
  7667.  
  7668.  
  7669.        ** E035 ** Requires 32 Bit Math--Recompile W/Math Option
  7670.  
  7671.             The compiler found a statement containing long (32bit) integer
  7672.        variables or constants.  You must compile with the Extended Math Option
  7673.        turned on to be able to use long integer math.  Turn on the "Extended
  7674.        Math" Option from the Compile Menu in the ASIC Integrated Environment,
  7675.        and recompile the program.  If you are compiling from the MS DOS command
  7676.        line, recompile using switch "E".
  7677.  
  7678.  
  7679.        ** E036 ** Error Allocating Debugger Screen Memory
  7680.  
  7681.             ASIC was unable to allocate memory to save the screen output from
  7682.        your programs when you run your program in debugging mode in the ASIC
  7683.        integrated environment.  You could try removing some TSRs from your
  7684.        AUTOEXEC.BAT file.  Then try running ASIC again.
  7685.  
  7686.  
  7687.        ** E037 ** IF Statements Nested Deeper Than 25 Levels
  7688.  
  7689.             An unlimited number of block IF statements may be used in your
  7690.        program, however, they may be nested to a maximum depth of 25 levels.
  7691.        See the IF statement documentation in Chapter 7 for more information.
  7692.  
  7693.  
  7694.        ** E038 ** ELSE Statement Without Preceding IF Statement.
  7695.  
  7696.             ASIC found an ELSE statement but did not find a preceding block IF
  7697.        statement.  See the IF Statement documentation in Chapter 7 for more
  7698.        information.
  7699.  
  7700.  
  7701.        ** E039 ** ENDIF Statement Without Preceding IF Statement.
  7702.  
  7703.             ASIC found an ENDIF statement with no preceding matching IF
  7704.        statement.  See the IF statement documentation in Chapter 7 for more
  7705.        information.
  7706.  
  7707.  
  7708.        ** E040 ** Block IF Statement Without Matching ENDIF Statement.
  7709.  
  7710.             When using the block IF format of the IF statement, you must always
  7711.        specify a matching ENDIF statement.  See the IF Statement documentation
  7712.        in Chapter 7 for more information.
  7713.  
  7714.  
  7715.  
  7716.  
  7717.  
  7718.  
  7719.  
  7720.  
  7721.                                       Page - 116
  7722.  
  7723.  
  7724.  
  7725.  
  7726.  
  7727.  
  7728.        ** E041 ** WHILE Statements Nested Deeper Than 25 Levels
  7729.  
  7730.             An unlimited number of WHILE statements may be used in your
  7731.        program, however, they may be nested to a maximum depth of 25 levels.
  7732.        See the WHILE statement in Chapter 7 for more information.
  7733.  
  7734.  
  7735.        ** E042 ** WEND Statement Without Preceding WHILE Statement
  7736.  
  7737.             ASIC found a WEND statement with no preceding matching WHILE
  7738.        statement.  See the WHILE statement documentation in Chapter 7 for more
  7739.        information.
  7740.  
  7741.  
  7742.        ** E043 ** WHILE Statement Without Matching WEND Statement
  7743.  
  7744.             Each WHILE statement must be followed by a matching WEND statement.
  7745.        See the WHILE statement documentation in Chapter 7 for more information.
  7746.  
  7747.  
  7748.  
  7749.  
  7750.  
  7751.  
  7752.  
  7753.  
  7754.  
  7755.  
  7756.  
  7757.  
  7758.  
  7759.  
  7760.  
  7761.  
  7762.  
  7763.  
  7764.  
  7765.  
  7766.  
  7767.  
  7768.  
  7769.  
  7770.  
  7771.  
  7772.  
  7773.  
  7774.  
  7775.  
  7776.  
  7777.  
  7778.  
  7779.  
  7780.  
  7781.  
  7782.  
  7783.  
  7784.  
  7785.  
  7786.  
  7787.                                       Page - 117
  7788.  
  7789.  
  7790.  
  7791.  
  7792.  
  7793.  
  7794.                                   NON-FATAL WARNINGS
  7795.  
  7796.        * W001 * Last Statement Not END -- END supplied
  7797.  
  7798.             Warning only.  ASIC expects the last statement of a program to be
  7799.        an END statement.  If it does not find one, it generates one for you.
  7800.  
  7801.  
  7802.        * W002 * Printer Not Ready - 'P' Option Ignored
  7803.  
  7804.             You selected the "Printer" option, but ASIC was not able to access
  7805.        the printer.  Make sure the printer is online before compiling with the
  7806.        'P' option.
  7807.  
  7808.  
  7809.        * W004 * Edit Buffer Full--File Truncated
  7810.  
  7811.             While loading a file, the edit buffer filled before ASIC reached
  7812.        end-of-file.  The file is truncated in memory.  IF YOU SAVE THE FILE
  7813.        AFTER RECEIVING THIS MESSAGE, PART OF THE FILE WILL BE LOST ON DISK.  IT
  7814.        IS RECOMMENDED THAT YOU EITHER EXIT ASIC IMMEDIATELY, OR THAT YOU SAVE
  7815.        THE TRUNCATED FILE UNDER A NEW NAME SO THAT THE ORIGINAL FILE IS NOT
  7816.        DAMAGED.
  7817.  
  7818.  
  7819.        * W005 *  Edit Buffer Full
  7820.  
  7821.             ASIC issues this message when the edit buffer is full and you
  7822.        attempt to insert a line.  Delete some unnecessary source lines to
  7823.        create space in the edit buffer.
  7824.  
  7825.  
  7826.        * W006 * Source/Dest of Block Copy/Move May Not Overlap
  7827.  
  7828.             You attempted to move or copy a block of lines to a destination
  7829.        line which was within the source block of lines.  Execution of this
  7830.        block move/copy would result in an endless series of copies or moves.
  7831.        Move the cursor outside of the highlighted block of lines, and try
  7832.        again.
  7833.  
  7834.  
  7835.        * W007 * Source Program Modified.  Recompile? (Y/N)
  7836.  
  7837.             You selected the RUN or TRACE option of ASIC.  ASIC has noticed
  7838.        that you have modified the source.  You should answer "Y" here to cause
  7839.        ASIC to recompile your program before running it.  If you instead answer
  7840.        "N", ASIC will execute the existing copy of the compiled program, which
  7841.        will not contain your latest changes.
  7842.  
  7843.  
  7844.        * W009 * File has been modified.  Save File Now? (Y/N)
  7845.  
  7846.             You have told ASIC to exit back to DOS, but the edit buffer has
  7847.        been modified.  You should answer "Y" so that ASIC will save your
  7848.        changes back to disk.  If you answer "N" here, any changes you have made
  7849.        to your program since the last SAVE command will be lost.
  7850.  
  7851.  
  7852.  
  7853.                                       Page - 118
  7854.  
  7855.  
  7856.  
  7857.  
  7858.  
  7859.  
  7860.        * W010 * Too Much Debugging Info-Truncating
  7861.  
  7862.             ASIC could not handle all of the debugging information it found.
  7863.        This error should not occur.
  7864.  
  7865.  
  7866.        * W011 * Variable Not Found
  7867.  
  7868.             During the processing of a Watch, Unwatch, or Modify Command, you
  7869.        specified a variable name which ASIC could not find in the debugging
  7870.        information.  Checking your spelling for possible errors.  Also, verify
  7871.        that you have compiled your program with the Debugging compiler option
  7872.        turned ON.
  7873.  
  7874.  
  7875.        * W012 * Maximum Number of Variables Are Being Watched
  7876.  
  7877.             You are already "watching" the maximum number of variables that
  7878.        this version of ASIC supports.  "Unwatch" one of the variables in the
  7879.        watch window.  This will allow you to "Watch" a new one.
  7880.  
  7881.  
  7882.        * W013 * There Are No Variables Being Watched
  7883.  
  7884.             You selected the "Unwatch" command.  However, there are no
  7885.        variables in the watch window to "Unwatch".  Before this command may be
  7886.        used, you must first have added a variable to the Watch window using the
  7887.        "Watch variable" command.
  7888.  
  7889.  
  7890.        * W014 * Unable to Load/Run Program
  7891.  
  7892.             When ASIC attempted to load and run either the compiler or your
  7893.        program it detected an error.  This is due to one of two reasons.
  7894.        First, ASIC could not find the program on disk.  If compiling, make sure
  7895.        that the ASICC.EXE file is in the same directory as the ASIC.EXE file,
  7896.        and make that directory current.  The second reason that you might get
  7897.        this error is that there may be insufficient memory available on your
  7898.        PC.  In this case, you either need to free up more memory (by removing
  7899.        TSRs etc), or you could execute your program or the compiler from the
  7900.        DOS command line.  For more information on compiling from the command
  7901.        line, see Chapter 5--Stand-alone Compiler Options.
  7902.  
  7903.  
  7904.        * W015 * Can't Set Breakpoint There--No Code Generated For That Source
  7905.                 Line
  7906.  
  7907.             You attempted to set a breakpoint and either 1) You haven't
  7908.        compiled with the Debugging Compiler Option turned on, or 2)  You have
  7909.        tried to set a breakpoint on a line which did not generate any object
  7910.        code.  Thus, breakpoints cannot be set on REM or DATA statements, for
  7911.        example.  If you are sure that you have compiled with the above option
  7912.        turned on, then try setting the breakpoint on another nearby statement.
  7913.  
  7914.  
  7915.  
  7916.  
  7917.  
  7918.  
  7919.                                       Page - 119
  7920.  
  7921.  
  7922.  
  7923.  
  7924.  
  7925.  
  7926.        * W018 * Your Program Must Be Running To Use This Function
  7927.  
  7928.             You selected a function which is only operable when you are running
  7929.        a program (which was compiled with the debugging compiler option turned
  7930.        on).  After your program terminates, this function is not available.
  7931.  
  7932.  
  7933.        * W019 * Function Unavailable Until You Terminate Your Program
  7934.  
  7935.             You selected a function while your program was running in debugging
  7936.        mode.  Before you can execute this function you must either Abort your
  7937.        program, or allow it to Run until normal termination.  Both the Run and
  7938.        the Abort Options are available on the "Run" Menu.
  7939.  
  7940.  
  7941.        * W020 * Invalid Debug (.DBG) File Format
  7942.  
  7943.             ASIC attempted to access the symbolic debugging information file
  7944.        created by the compiler for your program.  It was able to locate the
  7945.        file, but detected an error in the format while reading it.  Make sure
  7946.        that the version number of both the ASIC Integrated Editor and the ASIC
  7947.        Compiler are the same.  The version number is displayed on the top line
  7948.        of the editor screen, following the word "ASIC".  It is also displayed
  7949.        on the compiler status screen while a compile is executing.
  7950.  
  7951.  
  7952.        * W021 * Maximum Number of Breakpoints Already Set
  7953.  
  7954.             You have attempted to set another breakpoint, but the maximum
  7955.        number that this version of ASIC can support are already in use.  Remove
  7956.        one of the existing breakpoints you have set.  This will free one up for
  7957.        your use elsewhere.
  7958.  
  7959.  
  7960.        * W022 * Can't Open ASIC.IDX File
  7961.  
  7962.             You requested online help for an ASIC keyword.  This function
  7963.        requires a file called "ASIC.IDX" provided with your ASIC package, and
  7964.        ASIC could not find this file in the current disk directory.  Copy this
  7965.        file from your ASIC package to the directory in which you are running
  7966.        ASIC and try again.
  7967.  
  7968.  
  7969.        * W023 * Can't Open ASIC.DOC File
  7970.  
  7971.             You requested online help for an ASIC keyword or menu option.  This
  7972.        function requires a file called "ASIC.DOC" provided with your ASIC
  7973.        package, and ASIC could not find this file in the current disk
  7974.        directory.  Copy this file from your ASIC package to the directory in
  7975.        which you are running ASIC and try again.
  7976.  
  7977.  
  7978.  
  7979.  
  7980.  
  7981.  
  7982.  
  7983.  
  7984.  
  7985.                                       Page - 120
  7986.  
  7987.  
  7988.  
  7989.  
  7990.  
  7991.  
  7992.        * W024 * Can't Open ASICM.IDX File
  7993.  
  7994.             You requested online help for an ASIC menu option.  This function
  7995.        requires a file called "ASICM.IDX" which was provided with your ASIC
  7996.        package, and ASIC could not find this file in the current disk
  7997.        directory.  Copy this file from your ASIC package to the directory in
  7998.        which you are running ASIC and try again.
  7999.  
  8000.  
  8001.        * W025 * No Help Available For Selected Item
  8002.  
  8003.             There is no online help available for the item you selected.  The
  8004.        information should be available in the ASIC Manual.
  8005.  
  8006.  
  8007.        * W026 * Unable To Write ASIC.CFG File
  8008.  
  8009.             You told ASIC to save your current Integrated Environment Options.
  8010.        ASIC attempted to do so, but was not able to.  Your options were not
  8011.        saved to disk.  This is usually caused by one of two things: 1)  The
  8012.        disk is full, or 2)  The disk is write-protected.  If the disk is full,
  8013.        delete some unneeded files and try again.  If the disk is write-
  8014.        protected, remove the write-protect tab from the disk and try again.
  8015.  
  8016.  
  8017.        * W027 * Debugger Can't Fully Save User Screen--Insufficient Memory
  8018.  
  8019.             ASIC was not able to allocate enough memory to save the screen
  8020.        output from your program while it was running in debugging mode in the
  8021.        integrated environment.  As a result, the screen displays may become
  8022.        garbled.  You should normally only see this message when your program is
  8023.        using a high resolution EGA/VGA graphic mode on machines with very low
  8024.        memory, or you have many TSRs installed.  Either purchase more memory,
  8025.        go to a lesser graphics mode, remove some TSRs from the AUTOEXEC.BAT
  8026.        file, or run your program outside of the integrated environment.
  8027.  
  8028.  
  8029.  
  8030.  
  8031.  
  8032.  
  8033.  
  8034.  
  8035.  
  8036.  
  8037.  
  8038.  
  8039.  
  8040.  
  8041.  
  8042.  
  8043.  
  8044.  
  8045.  
  8046.  
  8047.  
  8048.  
  8049.  
  8050.  
  8051.                                       Page - 121
  8052.  
  8053.  
  8054.  
  8055.  
  8056.  
  8057.  
  8058.                                    RUN TIME ERRORS
  8059.  
  8060.  
  8061.        Divide Overflow
  8062.  
  8063.  
  8064.             This message indicates that your program attempted to divide by
  8065.        zero.
  8066.  
  8067.  
  8068.  
  8069.  
  8070.  
  8071.  
  8072.  
  8073.  
  8074.  
  8075.  
  8076.  
  8077.  
  8078.  
  8079.  
  8080.  
  8081.  
  8082.  
  8083.  
  8084.  
  8085.  
  8086.  
  8087.  
  8088.  
  8089.  
  8090.  
  8091.  
  8092.  
  8093.  
  8094.  
  8095.  
  8096.  
  8097.  
  8098.  
  8099.  
  8100.  
  8101.  
  8102.  
  8103.  
  8104.  
  8105.  
  8106.  
  8107.  
  8108.  
  8109.  
  8110.  
  8111.  
  8112.  
  8113.  
  8114.  
  8115.  
  8116.  
  8117.                                       Page - 122
  8118.  
  8119.  
  8120.  
  8121.  
  8122.  
  8123.  
  8124.  
  8125.  
  8126.  
  8127.                                SYSTEM ERROR CODE VALUES
  8128.  
  8129.  
  8130.        After most commands which access the disk, ASIC sets a special "ERROR"
  8131.        variable to indicate success or failure of that command.  After you
  8132.        execute one of these commands, you can reference this variable as a
  8133.        regular variable in your program, to determine the outcome of the
  8134.        command(eg. "IF ERROR = 000 THEN OKAY:").
  8135.  
  8136.  
  8137.        ERROR Codes Set by BLOAD
  8138.  
  8139.        000       No Error
  8140.        002       File Not Found
  8141.        003       Path Not Found or File Doesn't Exist
  8142.        004       File Not Found
  8143.        005       File Access Denied
  8144.        006-255   Read Past End of File
  8145.  
  8146.        ERROR Codes Set by BSAVE
  8147.  
  8148.        000       No Error
  8149.        002       File Not Found
  8150.        004       File Not Found
  8151.        005       File Access Denied
  8152.        006-255   Disk Full
  8153.  
  8154.        ERROR Codes Set by CALL
  8155.  
  8156.        000-254   Return Code from Program (Zero If Not Set by User Program)
  8157.        255       Error Loading/Running Program
  8158.  
  8159.        ERROR Codes Set by CHDIR
  8160.  
  8161.        000       No Error
  8162.        003       Path Not Found
  8163.  
  8164.        ERROR Codes Set by CLOSE
  8165.  
  8166.        000       No Error
  8167.        006       Invalid Handle
  8168.        095       Cannot Close File -- File is not Open
  8169.  
  8170.        ERROR Codes Set by FILEPOS
  8171.  
  8172.        000       No Error
  8173.        001       Invalid Function Number
  8174.        006       Invalid Handle
  8175.        098       File mode not Random or Append
  8176.  
  8177.  
  8178.  
  8179.  
  8180.  
  8181.  
  8182.  
  8183.                                       Page - 123
  8184.  
  8185.  
  8186.  
  8187.  
  8188.  
  8189.  
  8190.                          SYSTEM ERROR CODE VALUES (Continued)
  8191.  
  8192.  
  8193.        ERROR Codes Set by FIND
  8194.  
  8195.        000       No Error
  8196.        002       File Not Found
  8197.        018       No More Files Match Search Criteria
  8198.  
  8199.        ERROR Codes Set by GETDIR
  8200.  
  8201.        000       No Error
  8202.        015       Invalid Disk Drive Specification
  8203.  
  8204.        ERROR Codes Set by INPUT#
  8205.  
  8206.        000       No Error
  8207.        005       Read Access Denied
  8208.        006       Invalid File Handle
  8209.        096       Input String Truncated at 80 characters
  8210.                  (this error code is not set when you specify NONULL)
  8211.        098       File Not Open for Input or Random Modes
  8212.        099       End of File
  8213.  
  8214.        ERROR Codes Set by KILL
  8215.  
  8216.        000       No Error
  8217.        002       File Not Found
  8218.        005       Access Denied
  8219.  
  8220.        ERROR Codes Set by MKDIR
  8221.  
  8222.        000       No Error
  8223.        003       Path Not Found
  8224.        005       Access Denied
  8225.  
  8226.        ERROR Codes Set by NAME
  8227.  
  8228.        000       No Error
  8229.        002       File Not Found
  8230.        003       Path Not Found or File Doesn't Exist
  8231.        005       Access Denied
  8232.        017       Not Same Disk Drive
  8233.  
  8234.        ERROR Codes Set by OPEN --- Mode Input
  8235.  
  8236.        000       No Error
  8237.        002       File Not Found
  8238.        004       File Not Found
  8239.        005       File Access Denied
  8240.        254       File Number Already in Use
  8241.  
  8242.  
  8243.  
  8244.  
  8245.  
  8246.  
  8247.  
  8248.  
  8249.                                       Page - 124
  8250.  
  8251.  
  8252.  
  8253.  
  8254.  
  8255.  
  8256.                          SYSTEM ERROR CODE VALUES (Continued)
  8257.  
  8258.  
  8259.        ERROR Codes Set by OPEN --- Mode Output, Append, or Random
  8260.  
  8261.        000       No Error
  8262.        001       Invalid Append Function
  8263.        003       Path Not Found
  8264.        004       No File Handle Available
  8265.        005       File Access Denied
  8266.        006       Invalid Append Handle
  8267.        254       File Number Already in Use
  8268.  
  8269.        ERROR Codes Set by PRINT#
  8270.  
  8271.        000       No Error
  8272.        005       File Access Denied
  8273.        006       Invalid File Handle
  8274.        097       File Not Open for Output, Append, or Random Modes
  8275.        255       Disk Full
  8276.  
  8277.        ERROR Codes Set by RMDIR
  8278.  
  8279.        000       No Error
  8280.        003       Path Not Found
  8281.        005       Access Denied
  8282.        006       Can't Delete Current Directory
  8283.        016       Can't Delete Current Directory
  8284.  
  8285.        ERROR Codes Set by RUN
  8286.  
  8287.        000-254   Return Code from Program (Zero If Not Set by User Program)
  8288.        255       Error Loading/Running Program
  8289.  
  8290.  
  8291.  
  8292.  
  8293.  
  8294.  
  8295.  
  8296.  
  8297.  
  8298.  
  8299.  
  8300.  
  8301.  
  8302.  
  8303.  
  8304.  
  8305.  
  8306.  
  8307.  
  8308.  
  8309.  
  8310.  
  8311.  
  8312.  
  8313.  
  8314.  
  8315.                                       Page - 125
  8316.  
  8317.