home *** CD-ROM | disk | FTP | other *** search
/ A.C.E. 2 / ACE CD 2.iso / FILES / DOCS / AMOSCOMP.LHA / AmosCompiler.doc next >
Encoding:
Text File  |  1994-11-27  |  95.3 KB  |  2,165 lines

  1.                                       \
  2.                                       \\
  3.                                       \\\
  4.                             \          \\ \
  5.                             \\\       /    \
  6.               _____          \\\\    /      \          ____
  7.               \    \         \\\ \  /  /\    )        /   /
  8.                \    \        \    \/  /  \  /        /   /
  9.                 \    \        \      /    \/        /   /
  10.                  \    \        \    /              /   /
  11.                   \    \        \  /     _________/   /
  12.                    \    \        \/     /  ______    /
  13.                     \    \_________    /  /     /   /
  14.                      \             \  /  (_____/   /
  15.                       \_____________)(____________/[PAZZA]
  16.  
  17.                               P R E S E N T
  18.  
  19.                      THE AMOS COMPILER INSTRUCTIONS
  20.  
  21.  
  22. Typed by SIDEWINDER of LSD.
  23. Manual Supplied by TORCH (The man in the floppy hat!)
  24.  
  25.  
  26. CHAPTER 1: OMITTED as its just a description of AMOS etc.
  27.  
  28.  
  29. CHAPTER 2: QUICK START
  30.  
  31. By the time you're reading this, you'll probably be raring to go!  Don't be
  32. too impatient though.  You'll need to install the compiler onto a working
  33. COPY of your AMOS program disk.  The whole process takes about 10 minutes,
  34. but thankfully it only needs to be done once.  Here's a quick run-down of
  35. the general technique.
  36.  
  37.  o Make an immediate back-up of the Compiler disk on a freshly formatted
  38.    disk.
  39.  
  40.  o Now place your new copy of the AMOS Compiler disk into the internal
  41.    drive, and boot up your Amiga in the normal way.  After a few short
  42.    moments, the AMOS Installation program will be executed, and you'll
  43.    be presented with the following screen:
  44.  
  45.                  +-------------------------------------+
  46.                  |    A M O S    C O M P I L E R       |
  47.                  +-------------------------------------+
  48.                  | +-----------------+                 |
  49.                  | |  R E A D   M E  |                 |
  50.                  | +-----------------+                 |
  51.                  | +-----------------+                 |
  52.                  | |  U P D A T E    |                 |
  53.                  | +-----------------+                 |
  54.                  | +-----------------+     +---------+ |
  55.                  | |  I N S T A L L  |     | E X I T | |
  56.                  | +-----------------+     +---------+ |
  57.                  +-------------------------------------+
  58.  
  59. Notice the three large icons to the left of the screen.  These can be
  60. selected by simply clicking on them with the left mouse button.  To reach
  61. the point where you can start compiling, follow the three main steps:
  62.  
  63. 1 READ ME
  64. Displays a complete explanation of the compiler installation along with a
  65. full list of any updates or changes to the compiler.  It's a good idea to
  66. read this very carefully before continuing.  (Use the mouse to move up and
  67. down the text file.)
  68.  
  69. 2 UPDATE (see chapter 3)
  70. Updates your current version of AMOS Basic to the latest version using the
  71. supplied Updater disk.
  72.  
  73. NOTE: The AMOS Compiler will only work with versions of AMOS Basic from 1.3
  74. upwards.  So if you're using an earlier version, it's essential to upgrade
  75. immediately using the updater included.
  76.      You'll now need to insert a COPY of your AMOS program disk at this
  77. point.
  78.  
  79. WARNING! -  DON'T UPDATE THE ORIGINAL AMOS PROGRAM DISK!  The updater will
  80. automatically delete any existing AMOS programs to make room for the new
  81. version.  Use a back-up copy instead.
  82.  
  83. 3. INSTALL (see chapter 4)
  84. Installs the compiler extension onto a copy of your AMOS program disk.  As
  85. mentioned previously, the compiler should only be installed on versions of
  86. AMOS from 1.3 onwards.
  87.  
  88.  
  89. CHAPTER 3: UPDATING TO AMOS VERSION 1.3
  90.  
  91. The AMOS compiler should only be used with AMOS V1.3 or higher.  There's no
  92. need to worry if you've got a previous version.  We've helpfully included a
  93. free update to AMOS V1.3 along with this compiler.  If you've been using
  94. the original AMOS V1.1 all this time, you should notice a number of
  95. significant improvements (see the What's new in V1.3 supplement).
  96.  
  97.      Here's the procedure in detail, for updating to version 1.3:
  98.  
  99.   o  The first job you must do is create a copy of your AMOS programs
  100.      disk (see Making a back-up).  Once you've created a new AMOS
  101.      Programs disk and have it tested works, you'll be ready to update
  102.      this disk to 1.3.
  103.  
  104.   o  Place the AMOS Compiler disk into the internal drive and turn on
  105.      your Amiga.  The Compiler Installation program will automatically
  106.      load into memory and the following welcome screen will be displayed:
  107.  
  108.                 +--------------------------------------+
  109.                 |    A M O S    C O M P I L E R        |
  110.                 +--------------------------------------+
  111.                 | +-----------------+                  |
  112.                 | |  R E A D   M E  |                  |
  113.                 | +-----------------+                  |
  114.                 | +-----------------+                  |
  115.                 | |  U P D A T E    |                  |
  116.                 | +-----------------+                  |
  117.                 | +-----------------+      +---------+ |
  118.                 | |  I N S T A L L  |      | E X I T | |
  119.                 | +-----------------+      +---------+ |
  120.                 +--------------------------------------+
  121.  
  122.   o  Now insert the AMOS Updater disk into any drive and select the
  123.      Update button with the left mouse button.
  124.  
  125.   o  The AMOS Updater program will be loaded and a new screen will be
  126.      displayed:
  127.  
  128.                      +-----------------------------+
  129.                      |  A M O S  1.3  U P D A T E  |
  130.                      +-----------------------------+
  131.                      |       +-------------+       |
  132.                      |       | U P D A T E |       |
  133.                      |       +-------------+       |
  134.                      |         +---------+         |
  135.                      |         | E X I T |         |
  136.                      |         +---------+         |
  137.                      +-----------------------------+
  138.  
  139.   o  The process of updating is completely automatic.  If you want to
  140.      update to a hard disk though, you'll have to update a floppy disk
  141.      first and then copy across the relevant files (see below).
  142.  
  143.   o  WARNING!  The updater will automatically delete any non-essential
  144.      program files from the backed-up AMOS disk!  So it's vital to
  145.      ensure that you've made a copy of the AMOS program disk and are not
  146.      using the original AMOS master.
  147.  
  148.   o  Start the updater by pressing the left mouse button when the pointer
  149.      is over the Update icon.
  150.  
  151.   o  You'll be prompted to insert the copy of the AMOS Program disk (the
  152.      one you prepared earlier) into any available drive.  If you've an
  153.      external drive, you should keep the Updater disk in Df:0 and place
  154.      the program disk into the external drive.  This will avoid the need
  155.      to do any laborious disk swapping.  (For unexpanded A500 users,
  156.      There are only 12 disk swaps during this process.)
  157.  
  158. Your AMOS program disk will be updated to AMOS 1.3.  Once the update is
  159. complete, select the EXIT button and you'll be asked to insert the compiler
  160. disk.  Upon responding to this you'll be returned straight to the main
  161. welcome screen.
  162.      Before continuing, you are strongly recommended to make an immediate
  163. back-up of the new system onto a fresh disk.  See 'Making a back-up' for
  164. more details.
  165.  
  166. INSTALLING AMOS V1.3 ONTO A HARD DISK
  167.   o  Follow the above procedure so that you have a copy of V1.3 on a
  168.      floppy disk.
  169.  
  170.   o  Boot up your Amiga from your hard disk as normal.
  171.  
  172.   o  Enter the CLI or SHELL.
  173.  
  174.   o  Insert your new copy of AMOS 1.3 into the internal drive.
  175.  
  176.   o  Set the directory to the internal drive:
  177.  
  178.   o  You can now type the following line from the CLI prompt (note the
  179.      space between AMOS1.3 and the filename INSTALL.AMOS:
  180.  
  181.   o  AMOS will load into memory and you'll be presented with the hard
  182.      disk installation program automatically.  This program will be
  183.      requesting you to select an option from the main menu.
  184.  
  185.   o  Pull down the INSTALLATION menu by pressing the RIGHT mouse button
  186.      and highlighting the Installation text.
  187.  
  188.   o  From the resulting menu list, move the mouse over the AMOS MASTER
  189.      DISK ENTRY.  This will produce another menu list associated with
  190.      installing files from the AMOS1.3 master to the hard disk.
  191.  
  192.   o  Select the JUST INSTALL AMOS option from the menu.
  193.  
  194.   o  When the file selector appears and requests you to select the drive
  195.      you wish AMOS1.3 installed onto, first use the right mouse button to
  196.      change the directory list into a DRIVE list.
  197.  
  198.   o  From the DRIVE list that appears, select the one you want AMOS1.3
  199.      installed onto by highlighting the drive name and clicking on the
  200.      LEFT mouse button.
  201.  
  202.   o  The files on the selected drive will now be listed in the file
  203.      selector.  When you're happy you've selected the right drive, click
  204.      with the left mouse button on the file selector's OK button.
  205.  
  206.   o  Now wait for the installation to finish.
  207.  
  208.   o  When the installation is complete, automatic amendments to the hard
  209.      disk startup-sequence can be performed.  Unless you know what this
  210.      means (read below) we strongly advise that you avoid this option and
  211.      select QUIT at this point.
  212.  
  213.   o  If you want to append a new assign command to your startup-sequence,
  214.      then use the file selector to find the startup-sequence you wish to
  215.      add the line to, select it with the left mouse button and click on
  216.      OK.
  217.  
  218. Inserting an assign means that every time you boot your hard disk, the use
  219. of AMOS at the start of a filename will inform AmigaDos of where AMOS is
  220. located on the hard disk.
  221. For example:
  222.  
  223.      assign AMOS_DATA: WORK:AMOS_Discs/Data_disc
  224.  
  225.  
  226. This will set up AmigaDos so that use of AMOS_DATA will always look on the
  227. hard disk partition WORK: and inside the folder path AMOS_Discs/Data_disc.
  228. In other words:
  229.  
  230.      dir AMOS_DATA:
  231.  
  232. is the same as typing:
  233.  
  234.      dir WORK:AMOS_Discs/Data_disc
  235.  
  236. A word of warning though: You must be sure the startup-sequence you select
  237. is used by the system to boot up.  You must also be sure it doesn't finish
  238. its work before it reaches the new assign at the end of the startup-
  239. sequence.
  240.      If you're unsure about the whole idea, simply select Quit at this
  241. option is not essential.
  242.  
  243.  
  244. CHAPTER 4: INSTALLING THE COMPILER
  245.  
  246. Now that you have an AMOS programs disk containing the new version, you'll
  247. need to install a special extension of commands onto it.  This extension
  248. adds new commands to AMOS (similar to the Compactor, Requester and Serial
  249. extensions).
  250.  
  251.   o  If you already haven't upgraded to AMOS Version 1.3, now's the time
  252.      to do so.  Jump back to the previous chapter on UPGRADING TO AMOS
  253.      1.3.
  254.  
  255.      The installation procedure is straightforward:
  256.  
  257.   o  If using floppy disks, place a COPY of your Compiler disk into the
  258.      internal drive, and re-boot your Amiga.  The WELCOME program will
  259.      now load into memory.
  260.  
  261.   o  Hard disk users should boot from their hard disk, insert the
  262.      Compiler disk into DF0: and double click on the disk icon.  When the
  263.      window has displayed the programs on the disk, double click on the
  264.      WELCOME icon.
  265.  
  266.                  +-------------------------------------+
  267.                  |    A M O S    C O M P I L E R       |
  268.                  +-------------------------------------+
  269.                  | +-----------------+                 |
  270.                  | |  R E A D   M E  |                 |
  271.                  | +-----------------+                 |
  272.                  | +-----------------+                 |
  273.                  | |  U P D A T E    |                 |
  274.                  | +-----------------+                 |
  275.                  | +-----------------+     +---------+ |
  276.                  | |  I N S T A L L  |<--+ | E X I T | |
  277.                  | +-----------------+   | +---------+ |
  278.                  +-----------------------|-------------+
  279.                                          |
  280.  
  281.   o  You are now ready to install the AMOS compiler extension file onto
  282.      your new AMOS program disk.
  283.  
  284.   o  Select the Install icon with the mouse and click once on the left
  285.      button.  This will automatically load a separate Installation
  286.      program from the disk.
  287.  
  288.                    +--------------------------------+
  289.                    |   A M O S   C O M P I L E R    |
  290.                    +--------------------------------+
  291.                    |       +-----------------+      |
  292.                    |       |  I N S T A L L  |      |
  293.                    |       +-----------------+      |
  294.                    |           +---------+          |
  295.                    |           | E X I T |          |
  296.                    |           +---------+          |
  297.                    +--------------------------------+
  298.  
  299.   o  This screen allows you to choose between several possible machine
  300.      configurations.  These allow you to customise the compiler to your
  301.      own particular system.  Each option can be selected by simply
  302.      clicking on the relevant text with the left mouse button.
  303.  
  304.   o  Before proceeding with the Installation, the program will carefully
  305.      explain the pros and cons of the relative configuration.  If the
  306.      chosen setting is not to your liking, you can return to the previous
  307.      menu by selecting the ABORT button.  The final choice is entirely up
  308.      to you.
  309.  
  310.      You can, for instance, safely use the unexpanded A500 setting on
  311. machines with a megabyte or more of memory.  You can create a range of
  312. different compiler disks to cope with various programming requirements.
  313.  
  314.   o  When you have decided which configuration to use, simply click on
  315.      the relevant text.
  316.  
  317.   o  Floppy disk users will be asked to insert their new AMOS programs
  318.      disk into any drive.
  319.  
  320.   o  Hard disk users are presented with a file selector.  From this you
  321.      must double click on the AMOS1.3 file located on the hard disk.
  322.      This then informs the installer where to do the installation.
  323.  
  324.   o  Follow the prompts at the bottom of the screen for a successful
  325.      install.
  326.  
  327.  
  328. CHAPTER 5: COMPILER TUTORIAL
  329.  
  330. The best way of getting to know the compiler is to have a go at using it.
  331. To do this, we'll guide you through the easy process of compiling one of
  332. the example programs from the AMOS compiler disk.  Two of the tutorials (1
  333. meg systems with floppy drives) require you to have a blank formatted disk
  334. prepared.  So if you haven't one handy prepare it now.
  335.      As our starting point, let's make sure that the compiler has been
  336. installed properly.
  337.  
  338.   o  Boot up AMOS and check that the compiler extension is in memory.  If
  339.      it is, COMPILER EXTENSION V1.00 should be listed on the screen:
  340.  
  341.           +--------------------------------------------------+
  342.           |                    Version 1.3                   |
  343.           +--------------------------------------------------+
  344.           |                                                  |
  345.           |         +-----------------------------+          |
  346.           |         |                             |          |
  347.           |         |       AMOS The Creator      |          |
  348.           |         |                             |          |
  349.           |         |      by Francois Lionet     |          |
  350.           |         |    (c) 1990 Mandarin/Jawx   |          |
  351.           |         |                             |          |
  352.           |         +-----------------------------+          |
  353.           |                                                  |
  354.           |              Music extension V1.3                |
  355.           |             Picture compactor V1.2               |
  356.           |                 Requester V1.3                   |
  357.           |           Compiler extension V1.00               |
  358.           |                                                  |
  359.           +--------------------------------------------------+
  360.  
  361.   o  If this message is not on your screen, refer back to the quick start
  362.      section.  It will explain the three steps you must take to reach
  363.      this point.
  364.  
  365.   o  Now place the AMOS compiler disk into any drive and load the file
  366.      3D_Cube.AMOS from the EXAMPLES folder.
  367.  
  368.   o  We'll first this example program running in standard interpreted
  369.      AMOS Basic.  Click on RUN to see it in action.
  370.  
  371.   o  If you've had to remove the AMOS programs disc, you'll find that
  372.      AMOS requests this disk to be re-inserted.  This is because the
  373.      program it is running requires important maths routines from the
  374.      disk.
  375.  
  376.   o  When the cube appears on the screen, press the 3, 7 and 9 keys on
  377.      the numeric keypad.  This will spin the cube in 3D!  Repeated
  378.      pressing on the numbered keys will spin the cube faster.
  379.  
  380.   o  To stop the program press Control-C.
  381.  
  382.   o  Go back to the AMOS Editor.
  383.  
  384. Before you go any further, it's very important to remember what types of
  385. compiler installation process was used.  If you're using extra memory,
  386. extra drives or a hard drive you must use the correct tutorial listed
  387. below.
  388.  
  389. THE UNEXPANDED AMIGA 500 WITH ONE OR TWO DISK DRIVES
  390.  
  391.   o  With the 3d_cube.AMOS program still in memory, you should now test
  392.      the program by pressing F2 or by selecting this option with the
  393.      mouse.  This is very important as you cannot compile a program that
  394.      has not been previously tested.
  395.  
  396.   o  Save the tested AMOS program as CUBE.AMOS to the AMOS programs disk.
  397.  
  398.   o  Load the program.COMPILER.AMOS from the programs disk and RUN it.
  399.  
  400.   o  Since the process of compilation on the unexpanded Amiga is entirely
  401.      disk based, it is very important to check that the compiler has been
  402.      set up correctly.  On the menu screen you should note two disk icons
  403.      which represent the source and destination of the program to be
  404.      compiled.  You should also note the Workbench icon on the far right
  405.      of the screen - this specifies that the compiled program is to be
  406.      run from the Workbench.
  407.  
  408.   o  Now here comes the exciting bit!  Select the compile icon with the
  409.      mouse.  You should now be presented with the usual AMOS file
  410.      selector from which you should select Cube.AMOS.
  411.  
  412.   o  After telling the computer which program you want to compile, you
  413.      must then inform it of the filename it must use to create the
  414.      compiled version.  For now, simply click on O.K. and the compiler
  415.      will take the source name (3D_Cube.AMOS) and create a destination
  416.      file called 3D_Cube.
  417.  
  418.   o  The progress of the compilation is depicted by yellow arrows moving
  419.      left to right across the screen.  If the compiler has no problems
  420.      compiling, it will finish its work when all the yellow arrows have
  421.      lit up.
  422.  
  423.   o  Now it's time to run the compiled program.  Because a Workbench type
  424.      of file was selected you'll have to first re-boot the Amiga with
  425.      your Commodore Workbench disk in the internal drive.
  426.  
  427.   o  When Workbench is displayed, insert the AMOS programs disk, double
  428.      click on its icon representing Cube.
  429.  
  430.   o  Single drive users will be requested to re-insert their Workbench
  431.      disk prior to the program fully running.  This is so that the
  432.      program can access libraries from the boot disk.
  433.  
  434.   o  All being well, the newly compiled program will appear and the speed
  435.      at which it operates will show you the compiler's real worth.
  436.  
  437.   o  Welldone!
  438.  
  439.  
  440.      THE EXPANDED AMIGA (1 MEGABYTE+) WITH ONLY ONE DRIVE
  441.  
  442.   o  Ensure you have a formatted blank disk prepared for this tutorial.
  443.      this is where our compiled program will be placed.
  444.  
  445.   o  With the 3d_cube.AMOS program still in memory, you should now test
  446.      the program by pressing F2 or by selecting this option with the
  447.      mouse.  This is very important as you cannot compile a program that
  448.      has not been previously tested.
  449.  
  450.   o  Save the tested AMOS program as CUBE.AMOS to the previously
  451.      formatted disk.
  452.  
  453.   o  Load the program Compiler.AMOS from the programs disk and RUN it.
  454.  
  455.   o  Since the process of compilation on the expanded Amiga is entirely
  456.      RAM based, it is very important to check that the compiler has been
  457.      set up correctly.  On the menu screen you should note two RAM icons
  458.      which represent the source and the destination of the program to be
  459.      compiled.  You should also note the AMOS icon on the far right of
  460.      the screen - this specifies that the compiled program is to be run
  461.      from AMOS.
  462.  
  463.   o  At this point, all the library routines that the compiler accessory
  464.      uses are transferred to the RAM disk, utilising the full
  465.      capabilities of your expanded machine.
  466.  
  467.   o  Insert the disk with Cube.AMOS on it, into the internal drive.
  468.  
  469.   o  Now here comes the exciting bit!  Select the compile icon with the
  470.      mouse.  You will now be presented with the unusual AMOS file
  471.      selector from which you should select CUBE.AMOS.
  472.  
  473.   o  After telling the computer which program you want to compile, you
  474.      must then inform it of the filename it must use to create the
  475.      compiled version.  For now, simply click on O.K. and the compiler
  476.      will take the source name (3D_CUBE.AMOS) and create a destination
  477.      file called 3D_Cube_C.AMOS.
  478.  
  479.   o  The progress of the compilation is depicted by yellow arrows moving
  480.      left to right across the screen.  If the compiler has no problems
  481.      compiling, it will finish its work when the yellow arrows have lit
  482.      up.
  483.  
  484.   o  Now it's time to run the compiled program.  Select the Exit icon
  485.      with the mouse and return to the AMOS Editor.
  486.  
  487.   o  Now load in the compiled program 3D_Cube_C.AMOS and run it.
  488.  
  489.   o  All being well, the newly compiled program will appear and the speed
  490.      at which it operates will show you the compiler's real worth.
  491.  
  492.   o  Welldone!
  493.  
  494.  
  495.           THE EXPANDED AMIGA (1 MEGABYTE+) WITH TWO DISK DRIVES
  496.  
  497.   o  Ensure you have a formatted blank disk prepared for this tutorial.
  498.      This is where our compiled program will be placed.
  499.  
  500.   o  With the 3d_cube.AMOS program still in memory, you should test this
  501.      program by pressing F2 or by selecting this option with the mouse.
  502.      This is very important as you cannot compile a program that has not
  503.      been previously tested.
  504.  
  505.   o  Insert the blank formatted disk into the external drive.
  506.  
  507.   o  Save the tested AMOS program as CUBE.AMOS to the blank disk in the
  508.      external drive.
  509.  
  510.   o  Load the program Compiler.AMOS from the programs disk and RUN it.
  511.  
  512.   o  Since the process of compilation on the expanded Amiga is entirely
  513.      RAM based, it is very important to check that the compiler has been
  514.      set up correctly.  On the menu screen you should note two RAM icons
  515.      which represent the source and the destination of the program to be
  516.      compiled.  You should also note the AMOS icon on the far right of
  517.      the screen - this specifies that the compiled program is to be run
  518.      from AMOS.
  519.  
  520.   o  Now here comes the exciting bit!  Select the compile icon with the
  521.      mouse.  You will now be presented with the usual AMOS file selector
  522.      from which you should select CUBE.AMOS.  In this case you'll have
  523.      to first make the file selector display the contents of the disk in
  524.      the external drive.  To do this, click the right mouse button to
  525.      display the available drives.
  526.  
  527.   o  After telling the computer which program you want to compile, you
  528.      must then inform it of the filename it must use to create the
  529.      compiled version.  For now, simply click on O.K. and the compiler
  530.      will take the source name (3D_CUBE.AMOS) and create a destination
  531.      file called 3D_Cube_C.AMOS on the same disk.
  532.  
  533.   o  The program is depicted by yellow arrows moving left to right across
  534.      the screen.  If the compiler has no problem compiling, it will
  535.      finish its work when all the yellow arrows have lit up.
  536.  
  537.   o  Now it's time to run the compiled program.  Select the Exit icon
  538.      with the mouse and return to the AMOS Editor.
  539.  
  540.   o  All being well, the newly compiled program will appear and the speed
  541.      at which it operates will show you the compiler's real worth.
  542.  
  543.   o  Welldone!
  544.  
  545.  
  546.                 ANY AMIGA (1 MEGABYTE+) WITH A HARD DISK
  547.  
  548.   o  Hello hard disk users (you lucky guys).  Compiling on the hard disk
  549.      is easy and extremely fast.
  550.  
  551.   o  With the 3d_cube.AMOS program still in memory, you should now test
  552.      the program by pressing F2 or by selecting this option with the
  553.      mouse.  This is very important as you cannot compile a program that
  554.      has not been previously tested.
  555.  
  556.   o  Save the tested AMOS program as CUBE.AMOS to the hard disk.
  557.  
  558.   o  Load the program Compiler.AMOS from the hard disk and RUN it.
  559.  
  560.   o  Since the process of compilation on the expanded Amiga is entirely
  561.      disk based, it is very important to check that the compiler has been
  562.      set up correctly.  On the menu screen you should note two disk icons
  563.      which represent the source and the destination of the program to be
  564.      compiled.  You should also note the AMOS icon on the far right of
  565.      the screen - this specifies that the compiled program is to be run
  566.      from AMOS.
  567.  
  568.   o  Now here comes the exciting bit!  Select the compile icon with the
  569.      mouse.  You will now be presented with the usual AMOS file selector
  570.      from which you should select CUBE.AMOS.
  571.  
  572.   o  After telling the computer which program you want to compile, you
  573.      must then inform it of the filename it must use to create the
  574.      compiled version.  For now, simply click on O.K. and the compiler
  575.      will take the source name (3D_CUBE.AMOS) and create a destination
  576.      file called 3D_Cube_C.AMOS.
  577.  
  578.   o  The process of the compilation is depicted by yellow arrows moving
  579.      left to right across the screen.  If the compiler has no problems
  580.      compiling, it will finish its work when all the yellow arrows have
  581.      lit up.
  582.  
  583.   o  Now it's time to run the compiled program.  Select the Exit icon
  584.      with the mouse and return to the AMOS Editor.
  585.  
  586.   o  Now load in the compiled program 3D_Cube_C.AMOS and run it!
  587.  
  588.   o  All being well, the newly compiled program will appear and the speed
  589.      at which it operates will show you the compiler's worth.
  590.  
  591.   o  Welldone!
  592.  
  593.  
  594. CHAPTER 6: USING THE COMPILER
  595.  
  596. Although the compiler works best on an expanded machine, it has been
  597. carefully designed to produce superb results with even the smallest
  598. machines.  It comes complete with a number of powerful memory saving
  599. options, which allow you to compile massive programs on any Amiga from an
  600. unexpanded A500 to the latest A3000 system.
  601.      In order to make the most out of the compiler, you'll need to tailor
  602. the package to suit your own precise systems configuration.  Just to make
  603. life easier for you, here's a detailed list of the various possibilities.
  604.  
  605. ON A HALF MEG A500
  606.      First, the good news!  The AMOS compiler will work fine on your
  607. system, and there will be absolutely no restrictions on the size of the
  608. programs you will able to compile.  In fact, because of its advanced memory
  609. conservation features, the compiler will even cope with programs which
  610. would never have squeezed into the original interpreter!
  611.      The compiler can be executed straight from AMOS Basic using the
  612. COMPILER.AMOS accessory.  This can be entered into memory with either the
  613. Load or Load Other commands from the editor.
  614.      Although memory will be pretty tight, you will still be able to
  615. compile and run most programs without ever having to leave the AMOS system.
  616. Compiled programs can be executed directly from the Editor, just like the
  617. interpreted versions.  So there are no complicated new commands to
  618. remember.
  619.      The compiler provides a range of options which allow you to reduce the
  620. memory consumption to the absolute minimum.  The biggest savings can be
  621. accomplished by setting both the Source and Destination icons to Disk from
  622. the compiler accessory.
  623.      It's also possible to ignore the accessory entirely and compile your
  624. programs from direct mode.
  625.      Since the compiler only works with tested programs, you should first
  626. check the current program for errors using the Test option from the editor
  627. (F2).  You can then save your program onto the disk using Amiga-S or by
  628. selecting the Save option from the main menu.
  629.      Hit the Esc key to enter Direct mode and type:
  630.  
  631.      AMOS>Screen Close 0
  632.  
  633. This will force the compiler messages to be displayed in the Direct mode
  634. window, saving 32k of memory.
  635.      Compile your program with:
  636.  
  637.      AMOS>compile "prog.amos -D11 -T3"
  638.  
  639. PROG.AMOS is the name of your program.  It could obviously be anything you
  640. like.
  641.      The D11 bit activates the compiler's memory conservation feature and
  642. writes your program straight to the disk.
  643.      T3 saves the program in .AMOS format.  You'll now be able to enter it
  644. into AMOS Basic using a simple Load command from the editor.  As it's
  645. compiled, your new program will automatically be saved under the filename
  646. such as 'prog'.
  647.      Finally, you can load and run the compiled program straight from AMOS
  648. Basic with Run (F1).  You can also execute the program immediately from the
  649. command line with:
  650.  
  651.      AMOS>Run "prog"
  652.  
  653.  
  654. ON AN UNEXPANDED SINGLE DRIVE MACHINE
  655. As a default, the compiler expects to find a series of library files in the
  656. AMOS_System folder of the current disk.  The installation routines will
  657. automatically free up as much space as possible on your working compiler
  658. disk.  You'll now be left with around 350k to hold your programs and data.
  659. Hopefully, this should be more than sufficient for the vast majority of
  660. applications.
  661.  
  662. ON AN UNEXPANDED TWO DRIVE MACHINE
  663. In this case, you can simplify matters considerably by using a separate
  664. disk to hold your programs and data.  The compiler disk should now be
  665. placed in the internal drive, and the program data disk in DF1:.  You now
  666. have more than enough space to compile even the largest AMOS programs with
  667. consummate ease.
  668.  
  669. WITH A MEGABYTE OF MEMORY
  670. On an expanded machine, you'll be able to hold both the compiled and
  671. interpreted versions of your programs simultaneously in memory.  So
  672. whenever a problem occurs in one of your compiled programs, you can now
  673. jump straight back to your original interpreted program and correct it
  674. immediately.  The compiled program is stored just like any other AMOS Basic
  675. program and can be called straight from the editor.  It's therefore
  676. possible to flick effortless between the interpreted and compiled versions
  677. of the program in a matter of seconds.
  678.      The compiler accessory is intelligent and makes full use of any extra
  679. memory you've installed  in your system.  At the start of the session, the
  680. compiler accessory automatically copies all the compiler libraries onto a
  681. super fast RAM disk.  Once these libraries have been loaded into memory,
  682. they will be permanantly available to the compiler.  So the next time you
  683. enter the accessory, it will be immediately ready for use.
  684.      Another advantage of this system, is that there's no need to keep a
  685. copy of the compiler disk in the current drive.  If you've got a single
  686. drive you can therefore store all your programs and data on a completely
  687. separate disk.  This can be placed in the internal drive ready for use at a
  688. moment's notice.
  689.      The resulting speed increases have to be seen to be believed!  You
  690. can, for instance, compile the 500-line Amosteriods program from the AMOS
  691. Data disk in well under 20 seconds!  Surprisingly enough, this figure
  692. includes the time spent loading and saving the program to the disk.
  693.      Usually, you'll be able to compile your programs directly into memory
  694. using the default compiler settings.  However, if your program is
  695. especially large, you may need to activate one of the compiler's many
  696. built-in memory conservation features.  These can be selected by clicking
  697. on the Source and Destination icons on the accessory screen.
  698.      If you are unsure about this, see the section on the Compiler
  699. accessory for a detailed explanation.
  700.      Try changing the Source option first.  This will save you a fair
  701. amount of memory, and is capable of compiling your programs reasonably
  702. quickly.  If all else fails, simply set both the source and destination set
  703. to Disk.  It's not the end of the world, of course.  You'll still be able
  704. to compile most programs in under two minutes!
  705.  
  706. WITH A MEGABYTE OF MEMORY AND TWO DRIVES
  707. In addition to the previous option, you can keep the boot disk permanently
  708. in the internal drive, and store your programs on a separate disk in drive
  709. two (Df1:).  This is ideal if you are only intending to use the compiler
  710. occasionally basis, since it reduces the memory overhead to a mere 2k.
  711. You'll now be left with the maximum possible space to hold your programs
  712. and data.
  713.      On the other hand, the compilation will be slowed down considerably,
  714. as the system will now be forced to read the compiler libraries directly
  715. from disk.  You can of course, easily create separate AMOS program disks
  716. for each possible configuration.  You can then boot up a different version
  717. of AMOS Basic depending on your current programming requirements.
  718.  
  719. ON A HARD DISK
  720. Actually, there's not much to say.  As you would expect, the AMOS compiler
  721. will perform superbly on your system, and you'll be able to compile even
  722. the largest problems with consummate ease.  The installation program will
  723. automatically place all the required files on your hard disk.  After that,
  724. you can simply run AMOS Basic and go!
  725.      The compiler libraries can be kept on the hard disk, or loaded into
  726. RAM disk as required.  Because of the speed of your hard disk, there's not
  727. a great deal of difference!  You can also compile straight onto the disk
  728. whenever memory is running a little tight.  This will certainly be slower
  729. than compiling into memory, but you'll still be able to compile most
  730. programs in a matter of seconds.
  731.  
  732.  
  733. CHAPTER 7: COMPILING FROM THE CLI
  734.  
  735. If you're a CLI enthusiast, you can also access the compiler directly from
  736. the command line.  The ACMP utility is a complete standalone version of the
  737. compiler which provides you with total control over the compilation
  738. process.
  739.      Since ACMP is only about 27k long, it can be copied straight into your
  740. C directory.  Hard disk users just need to copy the file across from the
  741. installation program.  Floppy disk users just need to copy the file across
  742. from the compiler disk.  You'll now be able to compile your programs
  743. instantly from anywhere in your system.  Don't delete the original version
  744. of ACMP from the AMOS_System folder though.  You'll need it whenever you
  745. call the compiler from within AMOS Basic.
  746.      As a default, the compiler will expect to find a series of libraries
  747. in the :AMOS_System/folder in the root directory of your current disk.
  748. This folder should also contain a copy of the current
  749. Compiler_Configuration file.  If these files are stored on another drive,
  750. you'll need to enter their pathnames explicitly from the command line using
  751. the options: -F and -C.
  752.      The syntax of the ACMP command is:
  753.  
  754. ACMP [source.AMOS] [,OPTIONS]
  755.  
  756. where source.AMOS is the program to be compiled.
  757.      If the source program is omitted, a default filename will be
  758. automatically read from the Compiler_Configuration file.  If you are
  759. continually compiling the same program, you can save some time by editing
  760. the Compiler_Configuration file and replacing the default with the current
  761. program name.  You will now be able to compile your program with a simple:
  762.  
  763. 1>ACMP
  764.  
  765. Also note that if the filename includes embedded spaces, the whole pathname
  766. should be enclosed between quotes.  For example:
  767.  
  768. ACMP "test program.AMOS"
  769.  
  770. compiles 'test program.AMOS.
  771.  
  772.  
  773. COMPILER OPTIONS
  774. The AMOS compiler supports a wide range of powerful options which can be
  775. entered straight from the command line.  Each option is specified by a dash
  776. - followed by a single letter in upper or lower case.  Any additional
  777. information should be placed immediately after an initial letter.  Spaces
  778. are not allowed, as they are needed to separate the various compiler
  779. options.  Also note that the quote system mentioned previously can only be
  780. used inside a path or filename specification.
  781.  
  782. CHOOSING THE DESTINATION FILE
  783.  
  784. -object_file  (Object)
  785.  
  786. object_file is the name of the new file which will be used to hold the
  787. compiled program.  If it's omitted, the compiler will automatically
  788. generate the destination filename by removing the ".AMOS" suffix from the
  789. original name.
  790.      Note: The new filename should be placed immediately after the -O.  So
  791. don't include a space after the -O.  The object file doesn't have to be on
  792. the current drive of course.  It can be stored on any disk you like.
  793.      If you've only access to a single drive, you can place your object
  794. file on a separate disk.  Providing you are compiling completely in memory
  795. you'll only have to swap the disk twice.  Obviously, you should NEVER use
  796. this feature when you are compiling to the disk, as you could waste hours
  797. swapping between the various disks.
  798.  
  799. Examples:
  800.  
  801.      1>ACMP prog.AMOS -Oprog
  802.  
  803. compiles the program prog.AMOS and places the completed program into the
  804. file prog.  The new program can now be executed from the CLI by simply
  805. typing:
  806.  
  807.      1>prog
  808.  
  809.  
  810. MEMORY CONSERVATION
  811.  
  812. -D00/-DO1/-D10/-D11 (Disk/Memory)
  813. These options allow you to choose where the compilation process takes
  814. place.
  815.      The first digits sets the position of the source of your AMOS program,
  816. and the second selects the destination.  Each digit can take one of only
  817. two values:
  818.  
  819. 0 = Compile into RAM     (Equivalent to the RAM icon from the accessory)
  820. 1 = Compile to disk      (Same as the Disk icon)
  821.  
  822. Here is a list of the four possible alternatives:
  823.  
  824. D00 (Source=RAM Dest=RAM)
  825. The compilation process is performed entirely in memory.  This option is
  826. very fast, but it also requires large amounts of memory.
  827.  
  828. D01 (Source=RAM Dest=DISK)
  829. This setting loads the entire source program into memory, and then copies
  830. the destination program onto the disk as it's being compiled.  Although
  831. there's a considerable saving in memory, it's much slower than the previous
  832. option.
  833.  
  834. D10 (Source=DISK Dest=RAM)
  835. Saves memory by reading each line of your AMOS Basic program from the disk
  836. as and when it's needed.  The compiled program is created in RAM for
  837. maximum speed.  Although the compilation process is faster than the D01
  838. option, the memory savings are significantly less.
  839.  
  840. D11 (Source=DISK Dest=DISK)
  841. This option should only be used when you are desperately short of memory as
  842. it's fairly slow.  It does however, consume just 70k of storage space,
  843. whatever the size of your program!
  844.  
  845. Examples:
  846.  
  847.      1>ACMP prog.AMOS -D11
  848.  
  849. compiles the new program onto the disk and places it into a file called
  850. prog.
  851.  
  852.      1>ACMP prog.AMOS -Oprog -D01
  853.  
  854. Loads prog.AMOS into memory and compiles it straight on the disk file prog.
  855.  
  856.  
  857. SETTING THE TYPE OF THE PROGRAM
  858.  
  859. -T0/-T1/-T2/-T3 (-Type)
  860. These options allow you to choose the type of the compiled program.  There
  861. are four possibilities:
  862.  
  863. -T0
  864. This option will automatically produce an icon along with your compiled
  865. program.  It's now possible to execute the compiled program directly from
  866. the Workbench by clicking on the new icon.
  867.  
  868. -T1
  869. Generates a program in standard CLI format.  The compiled program can be
  870. called straight from the command line by typing it's name.  You can also
  871. include parameters in the command line as well.  These can be read from
  872. your command line as well.  These can be read from your compiled program
  873. using the special COMMAND LINE$ function.
  874.      Note that apart from the icon, there's absolutely no difference
  875. between the CLI or the Workbench versions of your program.  So you can
  876. happily execute your Workbench programs from the CLI.
  877.  
  878. -T2
  879. Creates a CLI program which will automatically run in the background using
  880. multi-tasking.  You can also generate the same effect by executing a -T0 or
  881. -T1 program with the AmigaDos RUN command.
  882.      WARNING! On entry to your program, the current directory will be
  883. automatically switched to "SYS:".  As normal, you can change this directory
  884. by calling the simple DIR$ command at the start of your program.  For
  885. example:
  886.  
  887.      DIR$="Dh0:AMOS_Games/"
  888.  
  889. -T3
  890. Compiles a .AMOS program which can only be run from the AMOS editor.  Any
  891. attempt to execute this program from the Workbench or CLI will be doomed to
  892. failure.
  893.  
  894.  
  895. SETTING THE DEFAULT SCREEN
  896.  
  897. -S0 -S1 (-Screen)
  898. As a default, your compiled program will automatically create a standard
  899. AMOS screen for your graphics.  This screen will be displayed on your
  900. monitor during your program's initialisation phase, often leading to an
  901. unwanted flash effect.
  902.      The -S0 option deactivates this feature, and allows you start your
  903. program with a completely blank screen.
  904. WARNING! Don't forget to open a new screen BEFORE using any of the text or
  905. graphic commands, otherwise your program will immediately stop with a
  906. 'Screen not opened error'.
  907.      -S1 restores the screen system to normal.  A default AMOS screen will
  908. now be displayed whenever your program is executed.
  909.  
  910. -W0/-W1 (Workbench)
  911. This option prevents AMOS from erasing the current Workbench or CLI screen
  912. when your compiled program is executed.
  913.      You can now create your screen invisibly, without affecting the
  914. existing display in the slightest.  When your screen is ready for display,
  915. you can now switch it neatly into place with the AMOS TO FRONT command.
  916. Here's an example:
  917.  
  918.      Rem Compile with -S0 and -W1 options set
  919.      Rem e.g. acmp view.amos -S0 -W1
  920.      Rem Turn off screen updates
  921.      Rem Open a new screen
  922.      Screen Open 0,320,250,64,Lowres
  923.      Rem Draw a simple screen
  924.      For C=0 To 100
  925.        Ink Rnd(64): X1=Rnd(320): Y1=Rnd(200): Y2=Rnd(200)
  926.        Bar Min(X1,X2),Min(Y1,Y2) To Max(X1,X2),Max(Y1,Y2)
  927.      Next C
  928.      Rem Flick display into place
  929.      Amos to Front
  930.      Walt Key
  931.  
  932.      -W1 suppresses the display of the current AMOS screens, and leaves the
  933. old CLI or Workbench screens intact.  The effect is very similar to the
  934. AMOS TO BACK command from within AMOS Basic.  But the transition between
  935. the two screens is noticably smoother!  Expert users can exploit this
  936. feature to create standard CLI utility programs, although you'll have to
  937. write your own routines to output text to the CLI window.
  938.  
  939.      -W0 (the default) turns off the existing display before your program
  940. is run.  When you return to the Workbench or CLI, the contents of the
  941. screen window will be completely redrawn.
  942.  
  943. COMPILING LARGE PROGRAMS
  944.  
  945. -L (Use Long jumps rather than branches)
  946. The -L option is only required when you are compiling really large
  947. programs.  In these circumstances, the size of a program structure such as
  948. WHILE..WEND or IF..ELSE..ENDIF can exceed 32k.  So the compiler will be
  949. forced to use a JMP instead of the normal BRA instruction.  The compiler
  950. will now generate a 'Program Structure too long error', and you'll need to
  951. recompile your program with the -L directive.
  952. For example:
  953.  
  954.      1>ACMP LARGE_PROGRAM.AMOS -L
  955.  
  956.  
  957. CHOOSING THE DEFAULT OPTIONS
  958.  
  959. -Cconfiguration_file (Config)
  960. -C defines the name and location of the configuration file which will be
  961. used to hold the compiler's default settings.  This file MUST be available
  962. when the compiler is executed, otherwise the compilation will be aborted.
  963.      The default pathname is:
  964.  
  965.      AMOS_SYSTEM/Compiler_Configuration
  966.  
  967.  
  968. POSITIONING THE COMPILER LIBRARIES
  969.  
  970. -Fpathname (Tell the compiler the location of the AMOS_SYSTEM folder)
  971. The -F option allows you to specify the full pathname of the AMOS_SYSTEM
  972. folder.  In order to work, the compiler requires a number of library files
  973. to be available in the AMOS_SYSTEM folder.  These contain the machine code
  974. versions of each AMOS instruction.  Normally, the AMOS_SYSTEM folder will
  975. be found in the root directory of the current disk.  You can however, place
  976. it anywhere you like:
  977.      'pathname' is a standard Amigados file spec ending a ":" or "/"
  978. character.  The compiler takes ALL file names found in the configuration
  979. file, and replaces the original pathname with the new one.
  980.      One possibility is to copy the entire folder into a RAM disk.  This
  981. consumes a whopping 145k of memory, but results in blindingly fast
  982. compilation.  Here's the procedure:
  983.  
  984.      First copy the folder to the RAM disk with:
  985.  
  986.      1>Copy Df0:AMOS_System/To RAM:AMOS_System
  987.  
  988. You can now compile your program with the -F option like so:
  989.  
  990.      1>ACMP example.AMOS -CRAM:AMOS_
  991.      System/Compiler_Configuration -
  992.      FRAM:AMOS_System/
  993.  
  994. Although this looks very complex, it would be easy enough to write a script
  995. file containing all the relevant commands.  You could then call from the
  996. CLI using EXECUTE.  For example:
  997.  
  998.      1>EXECUTE RCMP example.amos
  999.  
  1000.  
  1001. ERROR HANDLING
  1002.  
  1003. -E0 -E1 (-Errors)
  1004. As a default, error messages are NOT copied into the compiled program.  So
  1005. if a problem occurs, or you press Control-C, the program will jump straight
  1006. back to the Workbench, CLI or AMOS Editor, as appropriate.
  1007.      The -E1 option includes the standard AMOS error messages along with
  1008. your compiled program.  If your program aborts with an error, the relevant
  1009. message will now be displayed on the screen.  Since the program is in pure
  1010. machine code, it is impossible to report the precise line number at which
  1011. the problem occured.  In order to find the position of the error, you'll
  1012. therefore need to test the interpreted version of your program from AMOS
  1013. Basic.
  1014.      Note: The compiler makes use of two DIFFERENT .Env files in the
  1015. AMOS_SYSTEM folder:
  1016.  
  1017. -E0 uses the RAMOS1_3.ENV file without error messages
  1018. -E1 takes the environment from AMOS1_3_PAL.ENV / AMOS 1_3_NTSC.ENV
  1019.  
  1020. BE CAREFUL! If you change the settings in one of the .ENV files, you MUST
  1021. also make exactly the same changes in all the other versions!
  1022.  
  1023.  
  1024. SUPPRESSING THE COMPILER MESSAGES
  1025.  
  1026. -Q (-Quiet)
  1027. This option will prevent all messages during the compilation process,
  1028. except any error reports.
  1029.  
  1030.  
  1031. COMPILING FROM DIRECT MODE
  1032. You can also compile your programs from AMOS Direct mode using exactly the
  1033. same system.  This can be achieved with the aptly named COMPILE
  1034. instruction:
  1035.  
  1036.      COMPILE command_string$
  1037.  
  1038. 'command_string$' specifies the name of the AMOS program to be compiled,
  1039. and can include any of the options from the previous CLI section.
  1040.      Occasionally this feature can be very useful, especially if you are
  1041. running short of memory.  You can now save a great deal of space by
  1042. removing the compiler accessory and compiling the program from Direct mode.
  1043. Before using this command, it's a good idea to close the default screen
  1044. with Screen Close 0.  This will force the compiler messages to be displayed
  1045. in the direct mode window, saving 32k of memory!
  1046.      Here are a couple of examples:
  1047.  
  1048.      AMOS>compile "prog.AMOS -D01 -T3"
  1049.  
  1050. compiles a file called 'prog' from the current disk in .AMOS format.  This
  1051. file can then be loaded into AMOS Basic and run straight from the editor.
  1052.  
  1053.      AMOS>compile "prog.AMOS -Oprog -T0"
  1054.  
  1055. This line compiles the program 'prog' and places the new machine code
  1056. version into the file 'prog'.  The T0 option automatically creates an
  1057. appropriate icon for your program.  If you select this icon from the
  1058. Workbench, the program will be executed immediately.
  1059.      See the chapter on THE COMPILER EXTENSION for more details.
  1060.  
  1061.  
  1062. CHAPTER 8: THE COMPILER ACCESSORY
  1063.  
  1064. COMPILER.AMOS is a standard AMOS program which can be loaded directly from
  1065. the AMOS interpreter.  Usually, you'll want to enter the compiler as an
  1066. accessory with the LOAD OTHER command (Shift F6).  You'll now be able to
  1067. access the compiler at a moments notice using RUN OTHER (F6).  Note that
  1068. the compiler only works with disk files.  So you'll need to save your
  1069. program onto the disk before compiling it.
  1070.      On entry to the accessory, you are immediately presented with the
  1071. following control panel.
  1072.  
  1073.                  +-------------------------------------+
  1074.                  |    A M O S    C O M P I L E R       |
  1075.                  +-------------------------------------+
  1076.                  | +-------+    +-------+   +-------+  |
  1077.                  | | R A M | -> | DISK  | : |  W B  |  |
  1078.                  | +-------+    +-------+   +-------+  |
  1079.                  | +-----------------------------+     |
  1080.                  | | COMPILE >>>>>>>>>>>>>>>>>>>> >    |
  1081.                  | +-----------------------------+     |
  1082.                  | +---------+  +------+    +-------+  |
  1083.                  | | E X I T |  |   ?  |    | >---< |  |
  1084.                  | +---------+  +------+    +-------+  |
  1085.                  +-------------------------------------+
  1086.  
  1087. Along the top you can see three large icons.  These activate the compiler's
  1088. memory conservation features and allow you to set the type of the compiled
  1089. program.  You may have a slightly different icon selection to that shown
  1090. here.  It all depends on the configuration you chose when installing the
  1091. compiler.
  1092.  
  1093.                     SOURCE     DESTINATION    TYPE
  1094.                        |            |           |
  1095.                    +-------+    +-------+   +-------+
  1096.                    | R A M | -> | DISK  | : |  W B  |
  1097.                    +-------+    +-------+   +-------+
  1098.  
  1099. Each option can be toggled between the several alternatives.  They can be
  1100. selected by simply moving the mouse pointer over the appropriate icon and
  1101. clicking once on the left mouse button.  A new icon will now flip neatly
  1102. into place to reflect the current setting.
  1103.  
  1104. SOURCE
  1105. The Source icon determines whether your program should be compiled either
  1106. from memory or directly from the current disk.  There are two
  1107. possibilities:
  1108.  
  1109.  +-------+  The Ram option loads the entire program into memory before
  1110.  | R A M |  it's compile, resulting in the fastest possible compilation.
  1111.  +-------+  It does however consume a fair amount of memory, so if your
  1112. program is large in size, or you are using an unexpanded machine, you may
  1113. be forced to select the Disk option instead.  This can be accessed by
  1114. clicking on the Ram icon.
  1115.  
  1116.  +-------+  The Disk feature conserves memory by reading each line of
  1117.  | DISK  |  your program straight from the disk as and when it's
  1118.  +-------+  required.  Although this system is considerably slower than
  1119. compiling from memory, it does avoid the need to load the whole program
  1120. into RAM.
  1121.      If you think you're running short of memory, you can get an instant
  1122. read-out of the amount available RAM by holding down the right mouse
  1123. button.
  1124.  
  1125. DESTINATION
  1126. The Destination icon controls the way the compiled program will be created
  1127. on the disk.  As with the Source icon, there are two possible settings.
  1128.  
  1129.  +-------+  This generates the compiled program into a separate memory
  1130.  | R A M |  area.  When the compilation is complete, the finished program
  1131.  +-------+  is saved directly into your new file.  Compiling to RAM is
  1132. extremely fast, but it does require a reasonable amount of memory in order
  1133. to work.  This won't be a problem if you've a megabyte or more of RAM, but
  1134. if you're using an unexpanded A500, you could easily get a
  1135. dreadful 'Out of memory error'.
  1136.      Don't panic though!  We've thoughtfully provided you with powerful
  1137. memory conservation system which can be selected by just clicking on the
  1138. Destination icon.  The RAM chip will be replaced by a picture of a disk.
  1139.  
  1140.  +-------+  The Disk option compiles your program straight onto the disk,
  1141.  | DISK  |  one piece at a time.  This uses a maximum of 70k of memory,
  1142.  +-------+  irrespective of the size of your program.  You can therefore
  1143. compile massive AMOS programs on even the smallest machine.  The only
  1144. limitation is the amount of space on your current disk!
  1145.      One obvious side effect of this system is that the compilation process
  1146. is fairly slow, especially if you don't have access to a hard disk.  In
  1147. extreme cases, it could take several minutes to generate the compiled
  1148. version of your program.
  1149.  
  1150. TYPE
  1151. This option has three possible states which can be toggled by clicking once
  1152. on the left mouse button.
  1153.  
  1154.  +-------+  Creates a program which can be run straight from the Amiga
  1155.  |  W B  |  Workbench by simply clicking on its icon.  An appropriate
  1156.  +-------+  icon will automatically be saved in a .info file with your
  1157. compiled program.  This icon can be redrawn using the IconEd utility found
  1158. in the Tools folder of your Workbench disk.
  1159.  
  1160.  +-------+  The CLI option compiles your programs into a form which can
  1161.  | C L I |  be executed immediately from the Amiga CLI or SHELL.  The
  1162.  +-------+  program can be run from the command line by typing its name.
  1163. For example:
  1164.  
  1165.      1>test
  1166.  
  1167. runs a program called Test.
  1168.      Note that apart from the .info file, CLI programs are identical to the
  1169. Workbench versions.
  1170.  
  1171.  +-------+  The .AMOS option generates a program which can only be
  1172.  |  AMOS |  accessed from inside AMOS Basic, just like the interpreted
  1173.  +-------+  versions.  Since the entire AMOS system is already available at
  1174. run-time, these programs are around 40k smaller than their Workbench or CLI
  1175. equivalents.  You can therefore execute quite large .AMOS programs even on
  1176. a standard A500.
  1177.      Compiled programs are stored in the form of a locked procedure.  This
  1178. procedure is loaded into the edit buffer and can be copied between programs
  1179. using the Block command.  The only difference between the compiled program
  1180. and a normal AMOS procedure is you obviously can't unfold it from the
  1181. editor.  A typical program listing would be:
  1182.  
  1183.      Rem Sets the size of the variable space. Standard AMOS instruction.
  1184.      Set Buffer 8:rem sets the current amount of variable space
  1185.      Rem call compiled program
  1186.      Proc_COMPILED
  1187.      Rem locked procedure
  1188.      Procedure_COMPILED
  1189.  
  1190.  +--------+    Once you've set up the various compiler options, you can
  1191.  | COMPILE >   start the compilation process by simply clicking on the
  1192.  +--------+    Compile button.  You'll now be prompted for the name of
  1193. the AMOS program to be compiled.  This is entered using a standard AMOS
  1194. file selector.  The final step is to choose the filename which will be used
  1195. to hold the compiled program.  Clicking on the OK button will automatically
  1196. choose a default.  This varies depending on the type of
  1197. your program.
  1198.      "AMOS" programs have C added to the original filename just before the
  1199. extension.  So "Test.AMOS" becomes "Test_C.AMOS".  CLI or Workbench
  1200. programs have the ".AMOS" suffix removed.  Therefore "Test.AMOS" would be
  1201. compiled as "Test".
  1202.      After the source and destination filenames have been entered,
  1203. compilation will commence.  If you make a mistake, the compilation can be
  1204. aborted by simply pressing Control-C.  An indication of the current
  1205. progress can be seen from the arrow icons to the right.  A new arrow will
  1206. be automatically highlighted after each stage of the compilation.  When the
  1207. last arrow has been reached, the compiler has completed its work, and your
  1208. program is ready for use.  The accessory will now list the size of the new
  1209. program in a small information line below the control panel.  Click on the
  1210. left mouse button to continue.
  1211.  
  1212.  +-------+
  1213.  |  EXIT |  Quits from the compiler accessory and returns you either the
  1214.  +-------+  the Workbench or the AMOS Editor as appropriate.
  1215.  
  1216.  +-------+
  1217.  |   ?   |  Displays the program credits.  This one's very important!
  1218.  +-------+
  1219.  
  1220.  +-------+  The Spanner icon forms the gateway to a separate Options menu
  1221.  | >---< |  which enables you to fine tune the compiler to your
  1222.  +-------+  particular needs.  Whenever the compiler is run, the current
  1223. setting are automatically read from the Compiler_Congiguration file in the
  1224. AMOS_SYSTEM folder.
  1225.      These settings can be changed at any time by simply clicking on the
  1226. relevant icon from the Options menu.
  1227.  
  1228.  
  1229. COMPILER PROGRAM SETUP
  1230.  
  1231.  +--------------------------------------------------------------------+
  1232.  |                       +--------------------------+                   |
  1233.  |                       |  Compiler program setup  |                   |
  1234.  |                       +--------------------------+                   |
  1235.  |                                                                      |
  1236.  |   - Include error messages?                                   No     |
  1237.  |                                                                      |
  1238.  |   - Create default screen?                                    Yes  |
  1239.  |                                                                      |
  1240.  |   - Send AMOS to BACK upon booting?                           No   |
  1241.  |                                                                      |
  1242.  |   - CLI programs to run in the background?                    No     |
  1243.  |                                                                      |
  1244.  |   - Long forward jumps (option -L for VERY long programs)?    No   |
  1245.  |                                                                      |
  1246.  +--------------------------------------------------------------------+
  1247.  
  1248. INCLUDE ERROR MESSAGES?
  1249. This feature allows you to include the standard AMOS error messages along
  1250. with your compiled program.  Depending on your selection, your program will
  1251. use one of two possible environment files.
  1252.      'Yes' loads the environment from the normal AMOS configuration file
  1253. along with the usual error messages.  Whenever an error occurs in one of
  1254. your compiled programs, an appropriate message will be displayed on the
  1255. screen.  Note that the environment will be taken from the AMOS1_3_PAL.ENV
  1256. file in the AMOS_System folder (or AMOS1_3_NTSC.ENV for NTSC users).
  1257.      'No' turns off the error messages and reads the environment from
  1258. RAMOS1_3.ENV instead.  If a problem occurs in your program, it will now
  1259. abort immediately and return straight to the Workbench or CLI.
  1260.  
  1261. WARNING!
  1262. It's important to ensure that both configuration files contain exactly the
  1263. same screen settings, otherwise your program display could change
  1264. unpredictably when you remove the error messages.
  1265.  
  1266. CREATE DEFAULT SCREEN
  1267. Normally, a standard AMOS screen will be created automatically for your
  1268. compiled program.
  1269.      'No' starts your program with a totally clean display.  It's
  1270. equivalent to using the -S0 option from the command line.  Note your
  1271. program MUST open a new before performing ANY output (print, fade, bob and
  1272. so on).  If you forget about this, the program will abort immediately with
  1273. a 'Screen not opened error'.
  1274.      'Yes' spontaneously generates a default screen for the compiled
  1275. program whenever it is run.
  1276.  
  1277. SEND AMOS TO BACK UPON BOOTING?
  1278. 'Yes' completely hides your current display, just as if you had included an
  1279. AMOS TO BACK instruction at the start of your program.  The screen can be
  1280. reactivated at any time with the AMOS TO FRONT command.
  1281.  
  1282. CLI PROGRAMS TO RUN IN THE BACKGROUND?
  1283. This option is only relevant if you are compiling your program as type CLI.
  1284.      The 'Yes' button forces the compiled program to detatch itself from
  1285. the CLI and run as a separate process under the Amiga's multi-tasking
  1286. system.  The same effect can be achieved by executing a normal CLI program
  1287. with the AmigaDos Run command.
  1288.  
  1289. LONG FORWARD JUMPS (OPTION -L FOR VERY LONG PROGRAMS)?
  1290. Forces the compiler to use JMP instructions rather than BRAnch commands in
  1291. the compiled program.  It's needed to allow program structures such as
  1292. IF..ELSE..ENDIF and WHILE..WEND to work in ranges over 32k.
  1293.      Toggle the 'Yes' option if you get a 'Program structure too long,
  1294. compile with -L option' message during compilation.  When you re-compile,
  1295. everything will be fine.
  1296.  
  1297.  
  1298. COMPILER SETUP
  1299.  
  1300.  +--------------------------------------------------------------------+
  1301.  |                       +--------------------------+                   |
  1302.  |                       |  Compiler program setup  |                   |
  1303.  |                       +--------------------------+                   |
  1304.  |                                                                      |
  1305.  |   - Copy all libraries onto RAM-disk?                         No     |
  1306.  |                                                                      |
  1307.  |   - Leave libraries on RAM-disk upon exiting?                 No   |
  1308.  |                                                                      |
  1309.  |   - Keep compiler program "ACmp" in memory upon exiting?      No   |
  1310.  |                                                                      |
  1311.  |   - Squash compiled program?                                  No     |
  1312.  |                                                                      |
  1313.  +--------------------------------------------------------------------+
  1314.  
  1315. COPY ALL LIBRARIES ONTO RAM-DISK?
  1316. If you've got an expanded machine, you can save a great deal of time by
  1317. copying all the compiler libraries onto a super-fast RAM disk.  The whole
  1318. process is completely automatic.  Note: This feature can only be used with
  1319. at least one meg of memory since the libraries consume around 145k of RAM.
  1320.      'Yes' instructs the compiler accessory to copy the compiler libraries
  1321. straight into the 'AMOS_Compiler_Temp' folder on the RAM disk.  If the RAM
  1322. disk is not installed, the option will be completely ignored.
  1323.      'No' deactivates the RAM disk, saving 145k of valuable memory.
  1324.  
  1325. LEAVE LIBRARIES ON RAM DISK UPON EXITING?
  1326. Stores the compiler libraries permanantly on the RAM disk.
  1327.      'Yes' is a VERY powerful option for users who have one meg of memory
  1328. and just a single disk.  Once the libraries have been installed, the
  1329. original compiler disk can be safely removed.  You can now place a new disk
  1330. containing your programs and data into the internal drive and compile away.
  1331. WARNING!
  1332. This system will only work if you've also elected to keep the compiler in
  1333. memory (see next option).  Otherwise, whenever you run the accessory,
  1334. you'll be asked to insert the compiler disk into the drive.  After the
  1335. program has loaded however, you can replace the compiler disk with your own
  1336. program disk as before.
  1337.      If you are compiling a Workbench program, the compiler will also need
  1338. to open the icon.library from the LIBS: folder.  It will therefore ask you
  1339. to insert your boot disk if you have removed it.  If this is inconvenient,
  1340. simply set the program type to CLI or AMOS.
  1341.      'No' forces the accessory to delete the entire contents of the RAM
  1342. disk when you return to the Editor.  This frees about 145k of memory for
  1343. use with your programs.  The next time you load the accessory the libraries
  1344. will automatically be copied onto the RAM disk.
  1345.  
  1346. KEEP ACMP IN MEMORY UPON EXITING?
  1347. This option is related to the previous one, and to the compiler extensions
  1348. commands.
  1349.      'No' tells the compiler accessory to perform a COMP DEL instruction
  1350. before returning to the Editor.  So the next time you run the compiler, it
  1351. will ask you to insert the original compiler disk.
  1352.      'Yes' keeps the compiler in memory until you quit AMOS Basic.  This
  1353. consumes approximately 27k of RAM.
  1354.  
  1355. SQUASH COMPILED PROGRAMS?
  1356. Selecting 'Yes' will compress your new program and save it straight onto
  1357. the disk.  The squashed program be will be automatically decompacted
  1358. whenever it's loaded from the CLI or Workbench.
  1359.      You can abort the compaction process at any time, by simply pressing
  1360. Control-C from the keyboard.  You'll now be returned straight to the
  1361. compiler accessory.  If there's not enough space on the disk, the squashing
  1362. will also be terminated in exactly the same way.
  1363.      Note: This option has no effect on programs compiled as type AMOS.
  1364.  
  1365.   +-------------------------------------------------------------------+
  1366.   |                                +--------------------------  +-----+
  1367.   |                                | Save this configuration    | EXIT|
  1368.   |                                +--------------------------  +-----+
  1369.   +-------------------------------------------------------------------+
  1370.  
  1371. SAVE THIS CONFIGURATION?
  1372. Saves the current Compiler_Configuration onto your working copy of the
  1373. compiler disk.  If the compiler disk is not available, you'll be asked to
  1374. replace it in one of the drives.  This option also saves the present status
  1375. of the Source, Destination and Type buttons on the control panel.  So you
  1376. can easily tailor the initial compiler settings to precisely your own
  1377. requirements.
  1378.  
  1379. EXIT
  1380. Returns to the main compiler menu.
  1381.  
  1382.  
  1383. CHAPTER 9: COMPILER EXTENSION COMMANDS
  1384. The AMOS compiler extension adds several new instructions to the existing
  1385. AMOS Basic system.
  1386.  
  1387. COMPILE (Compile a program from AMOS Basic.)
  1388.  
  1389. COMPILE command_string$
  1390.  
  1391. As its name suggests, this command enables you to call up the compiler
  1392. straight from your AMOS Basic programs.  It was originally designed to
  1393. allow the creation of the AMOS compiler accessory, but it can also be used
  1394. from Direct mode if required.
  1395.      If the compiler has not been previously loaded into memory, the
  1396. extension will immediately try to install it from the default path (usually
  1397. :AMOS_System/).  Also note that you'll need to define an 80 column hires
  1398. screen to display the various error messages.  For example:
  1399.  
  1400.      Screen Open 0,640,200,16,hires
  1401.  
  1402. If you're calling the COMPILE instruction from Direct mode, you can also
  1403. use the Direct mode screen for these messages.  Simply close screen 0 with:
  1404.  
  1405.      AMOS>Screen Close 0
  1406.  
  1407. 'command_string$' contains the name of the program to be compiled, along
  1408. with an optional list of compiler directives.  The format is identical to
  1409. that used by the ACMP utility.
  1410.      Here's a quick rundown of the more useful options:
  1411.  
  1412.      command_string$="program.amos [-Oobjectname][-Dnn][-Tn][-Q]"
  1413.  
  1414. 'program.amos' is the name of an AMOS program to be compiled.
  1415.      '-Oobjectname' specifies the filename to be used as the destination.
  1416. The default is simply the original name of your program without the ".AMOS"
  1417. extension.  If your filename includes spaces, you'll need to surround it
  1418. with a pair of single quotes.  For example:
  1419.  
  1420.      compile "'test.amos'-D11"
  1421.  
  1422. '-Dnn' activates the compiler's memory conservation features:
  1423.  
  1424.      -D00  =  From RAM to RAM (This is the default)
  1425.      -D01  =  From RAM to disk
  1426.      -D10  =  From disk to RAM
  1427.      -D11  =  From disk to disk
  1428.  
  1429. '-T' chooses the type of your compiled program.
  1430.  
  1431.      -T0   =  Workbench (default)
  1432.      -T1   =  CLI
  1433.      -T2   =  CLI with multi-tasking
  1434.      -T3   =  .AMOS
  1435.  
  1436. '-Q' suppresses all system messages generated by the compiler, except
  1437. errors.
  1438.  
  1439. Examples:
  1440.  
  1441.      AMOS>compile"prog.amos"
  1442.  
  1443. Compiles 'prog.AMOS' and stores the new version in the file prog.  This
  1444. file can now be executed from either the CLI or Workbench as required.
  1445.  
  1446.      AMOS>compile"prog.AMOS -T3"
  1447.  
  1448. Compiles your program in .AMOS using the memory to memory option.  After
  1449. the compilation is complete, you can load the new program straight from the
  1450. editor.
  1451.  
  1452.      AMOS>compile"prog.AMOS -Oprog -D11"
  1453.  
  1454. Creates a compiled program called 'prog' along with the appropriate
  1455. Workbench icon.  The -D11 option activates the memory conservation system,
  1456. and uses the absolute minimum of RAM.  If you are compiling onto floppy
  1457. disk, you may have to wait a couple of minutes for the process to complete.
  1458.      See COMPILING FROM THE CLI for full details of the available compiler
  1459. options.
  1460.  
  1461.  
  1462. COMPTEST (Carry out compiler tests)
  1463.  
  1464. COMPTEST
  1465. COMPTEST ON
  1466. COMPTEST OFF
  1467.  
  1468. AMOS Basic regularly carries out the following tests during the execution
  1469. of your programs:
  1470.  
  1471.   o  Sprites and Bobs are redrawn at their new positions.
  1472.   o  Menus are checked for the presence of the mouse.
  1473.   o  The Control-C keys are tested.
  1474.  
  1475. COMPTEST ON
  1476. Checks are only carried out before jump instructions such as GOTO or WHILE,
  1477. and time consuming commands like PRINT or WAIT.  This is the standard
  1478. system used by the AMOS Basic interpreter.
  1479.  
  1480. COMPTEST OFF
  1481. The COMPTEST OFF command stops the testing completely, and improves the
  1482. speed of your program by up to 10%.  this allows you to optimise time
  1483. critical sections of your compiled program for the maximum possible speed.
  1484. It's especially useful in programs such as fractal generators or 3D
  1485. routines, which need to perform vast numbers of calculations in a
  1486. relatively short space of time.
  1487.      WARNING! One side effect of COMPTEST OFF, is that the Control-C
  1488. feature is completely disabled.  So that if a problem occurs in one of your
  1489. programs, you'll be unable to get the AMOS Basic editor without completely
  1490. rebooting, it's therefore vital to SAVE your program onto the disk before
  1491. using this feature, as otherwise you could lose hours of valuable work!
  1492.  
  1493. COMPTEST
  1494. Performs a single test at a specific point in your program.  This command
  1495. would normally be used after a COMPTEST OFF to provide you with total
  1496. control over the entire testing process.
  1497.  
  1498.  
  1499. COMP LOAD (Load the main compiler software)
  1500.  
  1501. COMP LOAD ["path"]
  1502. In order to conserve memory, the compiler is only loaded from the disk as
  1503. and when you need it.  Amazingly enough, the actual compiler extension
  1504. consumes less than 2k of RAM, including the squasher routines!  This leaves
  1505. you with plenty of space for even the largest interpreted programs.
  1506.      COMP LOAD loads the full compiler utility into memory, consuming
  1507. around 27k of RAM in the process.  As a default, the compiler will be taken
  1508. from the ACMP file from within the AMOS_System folder of your current boot
  1509. disk.  A 'file not found' message will be returned if it's not available.
  1510.      The optional pathname allows you to load the compiler from anywhere on
  1511. you present system.  This feature is mainly intended for owners of hard
  1512. disks who wish to keep the compiler in a seperate folder such as C.
  1513.      Examples:
  1514.  
  1515.      AMOS>COMP LOAD
  1516.  
  1517. Loads the compiler into memory from the AMOS_SYSTEM folder.
  1518.  
  1519.      AMOS>COMP LOAD "Dh0:C/ACMP"
  1520.  
  1521. Loads the compiler from the C directory of your hard disk.
  1522.      The compiler remains in memory until you leave the AMOS Basic or call
  1523. the COMP DEL instruction.
  1524.  
  1525.  
  1526. COMP DEL (Restores the memory used by compiler)
  1527.  
  1528. COMP DEL
  1529. Removes the compiler from memory and frees about 27k of RAM for use by your
  1530. AMOS Basic programs.
  1531.  
  1532.  
  1533. =COMP HERE (Returns compiler status)
  1534.  
  1535. f=COMP HERE
  1536. COMP HERE returns a value of TRUE(-1) if the compiler is already installed
  1537. in memory, or FALSE(0) if it is not available.
  1538.  
  1539.  
  1540. =COMP ERR$ (Return last error message)
  1541.  
  1542. m$=COMP ERR$
  1543. This function returns the LAST error message generated by the compiler in
  1544. the string M$.  If there was no previous error, M$ will be loaded with an
  1545. empty string "".
  1546.  
  1547.  
  1548. =COMP SIZE (Return compiled program size)
  1549.  
  1550. I=COMP SIZE
  1551. The effect of the COMP SIZE varies depending on when it is called.  It
  1552. holds the size of the last successful compiled program.  If it's read
  1553. immediately after a compilation, it will contain the length of the program
  1554. in bytes.  The next time it's called, it will return the number of
  1555. instructions.  Any further accesses returns a value of zero.
  1556.  
  1557. RUN (Run a compiled program)
  1558.  
  1559. RUN "program name"
  1560. Actually, this isn't a new command at all!  It's just an extended version
  1561. of the original AMOS Basic RUN command.  But it's important to emphasise
  1562. that compiled programs can be chained together, just like interpreted
  1563. versions.  You can therefore easily split your program into several parts
  1564. which can be loaded straight from the disk as and when they are required.
  1565. This technique is widely used in commercial games.  Each level in the game
  1566. is now assigned to a seperate program on the disk and loaded separately,
  1567. saving vast amounts of valuable memory.
  1568.  
  1569.      RUN can be freely used in any of your compiled programs.  The only
  1570. limitation, is that interpreted or AMOS type programs can only be executed
  1571. from the AMOS System.  So you can't just run an interpreted program from
  1572. the CLI or Workbench and expect it to work.
  1573.  
  1574. Example:
  1575.  
  1576.      AMOS>Run"3d_demo_C.AMOS"
  1577.  
  1578.  
  1579. =COMMAND LINE$= (Read/Set command line parameters)
  1580.  
  1581. C$=COMMAND LINE$
  1582.  
  1583. COMMAND LINE$ is a new reserved variable which allows you to access the
  1584. contents of the CLI command line directly from your compiled program.
  1585.      =COMMAND LINE$ returns a string containing the entire list of
  1586. parameters which have been entered in the command line.  If they've not
  1587. been defined, you'll get an empty string ("") instead.
  1588.      NOTE: You are recommended to read the command line as soon as possible
  1589. after the start of your program, as it's held in a buffer used by the AMOS
  1590. Basic graphic instructions.  After the command line has been read, any
  1591. further calls will just return "".
  1592.  
  1593. Example:
  1594.  
  1595.      1> test one two three
  1596.  
  1597. Runs the compiled program 'Test' and loads COMMAND LINE$ with the string
  1598. 'one two three'.
  1599.  
  1600. COMMAND LINE$="strings"
  1601.  
  1602. This loads the command line with up to 256 characters of your own data.
  1603. It's normally used just before the RUN command to preserve vital
  1604. information between two chained programs.  (compiled or interpreted).
  1605.  
  1606. Example:
  1607.  
  1608.      Command Line$=Str$(SCORE) Run "Level2.AMOS"
  1609.  
  1610. Saves the score into the command line and then executes a new program
  1611. called 'Level2.AMOS' straight from the disk.
  1612.      You could now read the score at the start of Level2.AMOS program using
  1613. a line like this:
  1614.  
  1615.      SCORE=Val(Command Line$)
  1616.  
  1617.  
  1618. =SQUASH (Compact an area of memory)
  1619.  
  1620. L=SQUASH(address,Length,Flag,Ahead,Colour)
  1621.  
  1622. Compresses an area of memory into a fraction of its normal size.  The
  1623. squashing process can be aborted at any time by pressing Control-C.
  1624.      'Address' holds the address in memory of the data to be squashed.
  1625. Usually, the data will be taken from the previously reserved AMOS memory
  1626. bank, but you can also compress other memory areas with this system as
  1627. well.  But NEVER attempt to squash a sprite or icon bank.  This type of
  1628. data is not stored in one continuous memory block.  You can however, freely
  1629. squash all other banks including those containing samples of menus.
  1630.  
  1631. 'Length' specifies the number of bytes of data to be compacted.
  1632.  
  1633. WARNING!  The squasher will automatically overwrite your existing data with
  1634. the new version.
  1635.  
  1636. 'Flag' toggles the squasher between two modes:
  1637.  
  1638. Flag=0:   Sets SLOW MODE.  This is mainly intended for users of
  1639.           unexpanded machines and reserves the absolute minimum amount of
  1640.           space.  As the name suggests, the compression will take a while
  1641.           to complete.
  1642.  
  1643. Flag<>0:  Activates FAST MODE and compacts the data into a seperate
  1644.           memory area for the maximum possible speed.  In order to use
  1645.           this feature, you'll need enough RAM to hold a memory area
  1646.           twice as large as the zone to be squashed.  If you run out of
  1647.           space, AMOS will automatically flip back to SLOW mode.
  1648.  
  1649. If SLOW mode has been set, 'Ahead' specifies how far (in bytes) the
  1650. squasher will search ahead during the compaction process.  The higher the
  1651. figure, the greater the compaction and the slower the execution speed.  The
  1652. minimum is 256 (fast but efficient), and the maximum is 4096 (very slow).
  1653. A reasonable value to use is about 1024.
  1654.  
  1655. 'Colour' is the number of a colour (0-31) to be flashed on the screen while
  1656. the data is being squashed.  After your data has been compacted, the
  1657. squasher will return one of the following values:
  1658.  
  1659. L>0:      This indicates that the squash has been successful and holds
  1660.           new length of the compressed data.
  1661.  
  1662. L=0:      The squash was terminated with Control-C.
  1663.  
  1664. L<0:      The compression has been aborted because the squashed length
  1665.           turns out to be longer than the original.  This is very rare
  1666.           with most data, but samples will probably always return such
  1667.           values as they are hard to squash.
  1668.  
  1669.  
  1670. =UNSQUASH (Unpack a squashed memory area)
  1671.  
  1672. L=UNSQUASH(Address,Length)
  1673.  
  1674. This function restores a block of data which has been compressed with the
  1675. SQUASH instruction.
  1676.      'Address' holds the address of the first byte of the squashed data.
  1677.      'Length' specifies the number of bytes to be decompressed.  This
  1678. should be length of the packed data as returned by the previous SQUASH
  1679. command.
  1680.      Beware!  Unsquash completely overwrites the current data.  You MUST
  1681. therefore always reserve a bank of the original (unsquashed) length to hold
  1682. the new data.  You can now BLOAD the packed data at the beginning of this
  1683. bank, and call the UNSQUASH function.
  1684.  
  1685. Example:
  1686.  
  1687.      Rem
  1688.      Rem Squasher demo
  1689.      Rem This kind of picture is very difficult for squashers!
  1690.      Rem
  1691.      Screen OPen 0,640,200,2,Hires
  1692.      Colour 1,$FFF
  1693.      For N=0 To 80
  1694.        Circle Rnd(639),Rnd(199),Rnd(50)+1
  1695.      Next N
  1696.      Rem
  1697.      Screen Open 1,640,3*8,4,Hires
  1698.      Curs Off
  1699.      Screen Display 1,,220,,:Wait Vbl
  1700.      Rem
  1701.      Do
  1702.        Bell:Centre At(,1)+"Press any key to Squash"
  1703.        Wait Key
  1704.        Rem
  1705.        Screen 0:Screen To Front 0:Wait Vbl
  1706.        Timer=0
  1707.        S=Squash(Logbase(0),16000,-1,1024,17)
  1708.        Rem
  1709.        Screen 1:Screen To Front 1:Wait vbl
  1710.        Cls
  1711.        Centre At(,1)+"Picture squashed in"+Str$(Timer/50)+"seconds"
  1712.        Centre At(,1)+"Original size: 16000 bytes, squashed size:"+Str$(S)
  1713.        Centre At(,2)+"Press any key to unsquash the picture"
  1714.        Wait Key
  1715.        Rem
  1716.        Screen 0:Screen To Front:Wait Vbl
  1717.        L=Unsquash(Logbase(0),S)
  1718.        Rem
  1719.        Screen 1:Screen To Front 1:Wait Vbl
  1720.        Cls
  1721.        Centre At(,0)+"Picture restored!"
  1722.      Loop
  1723.  
  1724.  
  1725. CHAPTER 10: COMPILER VERSUS INTERPRETERS
  1726. As you probably know, your Commodore Amiga is only capable of running
  1727. programs in in internal language known as Machine Code.  Each machine code
  1728. is represented by a specific combination of one and zeroes (binary) inside
  1729. the computer.  If we had to write all our programs in binary, we'd
  1730. obviously be faced with an impossible task.
  1731.      We've therefore invented a range of other languages such as Basic, C,
  1732. and Pascal to make life easier for ourselves.  Before these high-level
  1733. languages can be run on your computer, they first need to translated into
  1734. machine code.  Over the years, a number of approaches have evolved.
  1735.      The original AMOS Basic system made use of a technique called
  1736. interpretation.  An interpreter takes each Basic instruction, one at a
  1737. time, and locates the equivalent piece of machine code in a special
  1738. dictionary.  Once its found the command in memory, AMOS then executes the
  1739. routine using the machine code version of the standard GOSUB.
  1740.      The major advantages of the interpretation process, is that it allows
  1741. your program to be stored as a simple list of Basic instructions.  this
  1742. means that your AMOS programs can be edited directly from the editor, and
  1743. then run immediately when required.  It's therefore possible for you to
  1744. develop large and powerful Basic programs with the absolute minimum of
  1745. effort.
  1746.      Despite its undoubted friendliness though, interpretation isn't
  1747. particularly efficient.  Every time AMOS encounters one of your
  1748. instructions, it has to jump immediately to the relevant bit of machine
  1749. code.  Although this process is extremely fast, It's certainly not
  1750. instantaneous.  So if your program contains a lot of small instructions, it
  1751. could be spending more time on the interpretation procedure than in running
  1752. your actual program.
  1753.      The worst offenders are programs which include a large number of
  1754. complex calculations, becuase each individual arithmatic operation needs to
  1755. be interpreted separately by the computer.
  1756.      The classic way of avoiding these problems is to use a compiler.
  1757. Instead of interpreting each instruction individually, a compiler takes the
  1758. entire program and translates it directly into a separate machine code file
  1759. on the disk.  After the program has been converted, it can then be run
  1760. straight from the Workbench or CLI.  This makes it possible to freely
  1761. distribute your programs to any Amiga user, regardless of whether thay have
  1762. a copy of AMOS Basic.  All you need on the disk is the compiled program and
  1763. a couple of standard Amiga libraries.  That's it!
  1764.      What's more, since the interpretation process is now sidestepped,
  1765. there's also a considerable speed improvement.  Obviously this varies
  1766. dramatically depending on the type of program you are compiling.  Some
  1767. programs are barely affected at all, whereas others execute an incredible
  1768. four times faster.  The biggest improvements are in programs which execute
  1769. a lot of calculations, such as simulations, 3D routines or business
  1770. utilities.
  1771.      The only serious drawback is that compiled programs tend to be rather
  1772. larger than the interpreted versions.  In practise, this isn't much of a
  1773. problem, since compiled programs are completely independant of the AMOS
  1774. Basic system, and the final size includes everything needed to run the
  1775. program on your Amiga.  This contrasts markedly with interpreted programs,
  1776. which can only be run from a separate interpreter such as AMOS Basic or
  1777. RAMOS.  Since RAMOS consumes a massive 80k or so of memory, the total size
  1778. of your interpreted program often works out to be considerably larger than
  1779. the compiled version.
  1780.      Here's a quick summary of the relative merits of compilers and
  1781. interpreters:
  1782.  
  1783. INTERPRETED PROGRAMS:
  1784.   o  Are small, compact and very easy to debug.
  1785.   o  Can be freely edited from AMOS Basic.
  1786.   o  Require a seperate interpreter such as AMOS or RAMOS in order to
  1787.      run.
  1788.   o  Are not very good at handling programs with lots of calculations.
  1789.  
  1790. COMPILED PROGRAMS:
  1791.   o  Are completely independant of the AMOS Basic system, and can be run
  1792.      directly from the Workbench or CLI.
  1793.   o  Executes up to four times faster than the interpreted versions.
  1794.   o  Cannot be examined or modified without the original interpreted
  1795.      program.
  1796.   o  Are significantly larger than interpreted programs.
  1797.  
  1798.  
  1799. CHAPTER 11: RUNNING A COMPILED PROGRAM
  1800. There are three possibilities:
  1801.  
  1802. WORKBENCH PROGRAMS
  1803. If you compiled your programs using the WB option, you will be able to
  1804. execute it straight from the Workbench by simply clicking on the
  1805. appropriate icon with the mouse.  As the program is loading, the mouse
  1806. pointer will flicker continuously.  Don't worry if the process takes
  1807. several seconds.  AMOS is simply unsquashing the various system routines.
  1808. WARNING! If you click on the icon twice, you could launch another copy of
  1809. the same program!
  1810.  
  1811. CLI PROGRAMS
  1812. These programs are created when you select the CLI option from the compiler
  1813. accessory.  They can be executed from the CLI by just typing their name.
  1814. For example:
  1815.  
  1816.      1>demo
  1817.  
  1818. This runs a program called demo from the current disk.  If the program you
  1819. wish to run is on another drive, you'll need to include the current
  1820. pathname like so:
  1821.  
  1822.      1>Df1:demo
  1823.  
  1824. The Amiga treats CLI programs exactly like any other machine code program,
  1825. so they can be called from within batch files or executed automatically on
  1826. startup.  See 'CREATING AN AUTOBOOT DISK' for more details.
  1827.  
  1828. Normally, AMOS will generate a standard screen for your graphics.  This can
  1829. be suppressed with the -S0 option during compilation.  You can also include
  1830. parameters.  These will be automatically loaded into the reserved variable
  1831. COMMAND LINE$ when your program is initialised.  For example:
  1832.  
  1833.      1> demo test
  1834.  
  1835. executes a compiled demo program called 'Test'.  When the program begins
  1836. the parameter test will be placed into the string COMMAND LINE$.
  1837.  
  1838. AMOS RUNNABLE PROGRAMS
  1839. These programs can be run directly from the AMOS Basic interpreter, and are
  1840. usually around 40k smaller than the equivalent CLI or Workbench versions.
  1841. If you've a megabyte or more of RAM, you'll often be able to hold both the
  1842. interpreted and compiled versions of the program in memory.  This will
  1843. speed up your development process enormously.
  1844.      In order to make use of this feature, you first need to compile your
  1845. programs in a special .AMOS format.  This can be accomplished from the
  1846. compiler accessory by setting the Type icon to AMOS.  You can now load your
  1847. compiled programs and run them straight from the editor.  The editor window
  1848. will contain the following lines:
  1849.  
  1850.      Set Buffer n:Rem where N is the current size of the variable area
  1851.      Proc_Complied
  1852.      Procedure_Compiled
  1853.  
  1854. The procedure_COMPILED is locked and contains your compiled programs.  Note
  1855. that the above program definition is taken from a file called
  1856. Header_AMOS.AMOS in the AMOS.System folder.  You can edit this file to
  1857. change the name of the compiled procedure to something more exiting.  For
  1858. example:
  1859.  
  1860.      Set Buffer 8
  1861.      Proc Amosteriods
  1862.      Procedure Amosteriods
  1863.  
  1864. WARNING! The procedure definition contained by the header holds a special
  1865. instruction used to execute the compiled program.  This should be left
  1866. exactly as it stands.  If you try to run the header program from the
  1867. interpreter .AMOS will immediately crash!
  1868.      The compiled program is stored in the editor buffer, and is treated
  1869. just like any normal AMOS program.  All memory banks are in the standard
  1870. format and can be loaded, saved or grabbed as required.  You can even
  1871. execute a compiled program as an accessory.  As an example, try compiling
  1872. the new sprite editor on the AMOS compiler disk.  Not only is there a
  1873. noticeable increase in the execution speed, but the testing process is
  1874. instantaneous.
  1875.  
  1876. EXITING FROM A COMPILED PROGRAM
  1877. The compiled program will automatically return you to the calling
  1878. environment after it has completed successfully.  You can however, abort
  1879. from the program at any time by holding down the Control and C keys.
  1880.  
  1881. ERROR MESSAGES
  1882. If you've compiled your program with the 'include error messages' or -E1
  1883. option from the command line, a standard AMOS error message will be
  1884. displayed when something goes wrong.  The format naturally depends on the
  1885. environment you are using:
  1886.  
  1887. WORKBENCH
  1888. The message will be displayed in a small alert box.
  1889.  
  1890. CLI
  1891. The error will be returned in the form of a normal CLI message.
  1892.  
  1893. AMOS
  1894. The error will be indicated on the INFO line of the AMOS Editor.
  1895.  
  1896. Note that the error messages are exactly the same as the interpreted
  1897. versions, except that there are no line numbers.  If you want to find the
  1898. exact position at which the error ocurred, you'll need to test the original
  1899. interpreted program from within AMOS Basic.  If you've omitted the error
  1900. messages, your program will simply quit and return in the event of an
  1901. error.
  1902.  
  1903.  
  1904. CHAPTER 12: CREATING AN AUTOBOOT DISK
  1905. The best way of distributing your work to your friends is to create a boot
  1906. disk for your compiled AMOS program.  This will allow people to execute
  1907. your programs by simply inserting your disk into the internal drive and
  1908. booting up their Amiga.  A good example of this technique is the Welcome
  1909. program used for updating and installing.
  1910.      The easiest method of generating a boot disk is to CHEAT!
  1911.  
  1912.   o  Make a copy of the original AMOS compiler disk and delete everything
  1913.      from the copy EXCEPT the following files and directories:
  1914.  
  1915.        C:
  1916.        DEVS:
  1917.        L:
  1918.        LIBS:
  1919.        S:
  1920.        Disk.info
  1921.  
  1922.      Obviously, you should not use the original compiler disk for this
  1923.      purpose!
  1924.  
  1925.   o  Compile your program onto this disk in the CLI or Workbench format.
  1926.  
  1927.   o  Load up AMOS Basic V1.3
  1928.  
  1929.   o  Run the AUTOBOOT.AMOS program from the Updater disk.
  1930.  
  1931.   o  Simply place the new boot disk into the internal drive, and choose
  1932.      your compiled program from the file-selector.  A new
  1933.      startup-sequence file will be automatically created for you on the
  1934.      disk.  Your program will then be loaded immediately whenever the new
  1935.      disk is booted on your Amiga.
  1936.  
  1937.  
  1938. CHAPTER 13: TECHNICAL DETAILS
  1939. In this section we'll be providing a fascinating glimpse inside the AMOS
  1940. Basic compiler.
  1941.  
  1942. IMPROVED GARBAGE COLLECTION
  1943. The problem of garbage collection arises because of the way AMOS Basic
  1944. handles strings.  Take the following program:
  1945.  
  1946.      Rem Garbage creator!
  1947.      Input A$:Rem input a string
  1948.      A$=A$+A$:Rem Add a second copy of the string onto the end
  1949.      B$=A$-"":Rem Remove all the spaces
  1950.      Do
  1951.        C$=Left$(A$,3)
  1952.        Print A$,B$,C$
  1953.      Loop
  1954.  
  1955. The above program may look pretty simple, but underlying all this casual
  1956. string manipulation, AMOS Basic is performing a frantic amount of activity.
  1957.      Whenever you assign some text to a string, the existing contents need
  1958. to be discarded, and space has to allocated for the new data.  Memory is
  1959. also needed to hold the immediate results generated by string operations
  1960. such as Left$, or "-".
  1961.      One unfortunate side effect of this process is that the variable
  1962. buffer quickly fills up with useless string data.  AMOS is then forced to
  1963. claw back the unused space by completely reorganising the entire variable
  1964. buffer.  In extreme cases, this garbage collection can take several seconds
  1965. to complete, leading to sudden and inexplicable delays in your programs.
  1966.      Luckily, there's a solution.  AMOS 1.3 now includes a brand new
  1967. garbage collector which executes an incredible 100 times faster than the
  1968. original version.
  1969.      The UltraFast Garbage Collection (TM) will only work if there's enough
  1970. continuous RAM to hold a complete copy of the variable buffer in memory.
  1971. If this memory is not available, AMOS will automatically revert to the Old
  1972. Garbage Collection (TM) system.
  1973.      Here's a program which demonstrates the speed gain:
  1974.  
  1975.      Rem
  1976.      Rem Garbage collection demo
  1977.      Rem
  1978.      Set Buffer 128
  1979.      NN=3000
  1980.      Dim A$(NN),B$(NN),C$(NN)
  1981.      For N=0 To NN
  1982.        Home:Print N
  1983.        AA$=Str$(N)+Str$(Rnd(Rnd(100)))
  1984.        A$(N)=AA$+"-"
  1985.        B$(N)=A$(N)+AA$
  1986.        C$(N)=B$-AA$
  1987.      Next N
  1988.      Rem
  1989.      Timer=0:Print Free:Print Timer
  1990.  
  1991. INSIDE THE AMOS COMPILER
  1992.  
  1993. MEMORY MANAGEMENT
  1994. The compiler only reserves precisely the memory it needs.  If there's not
  1995. enough memory, you'll get an 'Out of Memory error'.
  1996.  
  1997. DECODING THE COMMAND LINE
  1998. 1.   The command line is read and checked for all the allowable compiler
  1999.      options.  If an error is found, the compiler ignores the remainder
  2000.      of the text and jumps immediately to stage 2.
  2001. 2.   The default compiler options are now loaded from the configuration
  2002.      file.  Normally the options will be taken straight from the
  2003.      COMPILER_CONFIGURATION file in the :AMOS_SYSTEM folder, but this can
  2004.      be changed using the -C option from the command line.  The config
  2005.      file also contains the entire list of error messages used by the
  2006.      compiler.  These can be modified by simply editing the file with a
  2007.      standard ASCII text editor.
  2008. 3.   The default command line is loaded from the configuration file, and
  2009.      any options set.
  2010. 4.   The CLI command line is now checked yet again.  So any options you
  2011.      select from the command line will override the defaults in the
  2012.      configuration file.
  2013. 5.   The source file is opened.  If the SOURCE=RAM: option has been set,
  2014.      the file will be immediately loaded into memory.
  2015. 6.   Once the options have been set, the compiler reserves all the memory
  2016.      buffers it needs, and starts compiling your program.
  2017.  
  2018. THE COMPILATION PROCESS REVEALED
  2019. The AMOS compiler is a one-pass compiler.  So it only needs to read the
  2020. source code a single time to convert it into machine code.  That's why it's
  2021. so fast!
  2022.      The compiler works in the following way:
  2023.  
  2024.   o  First, the program header is copied into the compiled program.
  2025.      This varies depending on the type of your program. (AMOS/CLI/WB)
  2026.   o  The main program is converted into its machine code equivalent.
  2027.   o  Any procedures in your program are compiled one after another.
  2028.   o  The library routines are then copied into the compiled program, one
  2029.      at a time.  The compiler will only copy the instructions which are
  2030.      actually needed by your program.  So the size of a program depends
  2031.      on the number of different commands it uses.  If you use all the
  2032.      AMOS instructions, the size of your program will reach RAMOS
  2033.      proportions.
  2034.   o  The compiler now transfers the internal relocation table into the
  2035.      new program.  This allows the compiled programs to be executed from
  2036.      anywhere in the Amiga's memory.
  2037.   o  The contents of any strings used by the program are copied.
  2038.   o  The LABEL addresses are inserted into the compiled program.  These
  2039.      are required if your program uses gotos. (GOTO A$ for example)
  2040.   o  If the program is of type CLI or WB, the AMOS system files are now
  2041.      transferred. (+40k)
  2042.   o  The memory banks used by your program are installed into the
  2043.      compiled program.
  2044.   o  Finally, the object file is closed.  If you are compiling into
  2045.      memory, the new program file is automatically saved onto the disk.
  2046.      If the program is of type WB, a .info file is created for the icon.
  2047.  
  2048. Here's an example of the way the compiler converts a single instruction
  2049. into machine code:
  2050.  
  2051.      PLOT 320,100,1
  2052.  
  2053. becomes:
  2054.  
  2055.      move.l #1,-(a3)
  2056.      move.l #100,-(a3)
  2057.      move.l #320,-(a3)
  2058.      jsr Plot
  2059.  
  2060. PACKING A COMPILED PROGRAM
  2061. A compiled program (WB or CLI) can be compressed with any other compaction
  2062. utility you like (including PowerPacker or Larc).  Providing the new packer
  2063. respects hunks in the file, everything will be fine.  The only limitation
  2064. is that such a program cannot be called from another compiled program with
  2065. the RUN instruction.
  2066.  
  2067. AMOS 1.3 AND COMPILER NEW ZOOM ROUTINE
  2068. Your new AMOS1.3 program disk contains a memory bank file called ZOOM.ABK.
  2069. This holds a new fast zoom machine language routine similar to the one used
  2070. by the AMOS Sprite Editor.  So if you have used the existing ZOOM routine
  2071. in one of your programs, you'll have to chamge it like so:
  2072.  
  2073.      Load"Zoom.Abk",bank
  2074.  
  2075. Now load Screen Base into A0 before use:
  2076.  
  2077.      AREG(0)=Screen Base
  2078.      Call bank
  2079.  
  2080.  
  2081. CHAPTER 14: TROUBLESHOOTING
  2082.  
  2083. THE COMPILER GENERATES AN OUT OF MEMORY ERROR
  2084. The AMOS compiler comes complete with a range of memory conservation
  2085. features.  These can be activated from the compiler accessory by clicking
  2086. on the RAM or Disk icons towards the top of the control panel.  There are
  2087. four possibilities:
  2088.  
  2089. SOURCE    DESTINATION    COMMENTS
  2090.  RAM      RAM            Very fast but uses quite a lot of memory.
  2091.  DISK     RAM            Slower but consumes less space than RAM to RAM.
  2092.  RAM      DISK           Saves a fair amount of memory.  Relatively slow.
  2093.  DISK     DISK           Uses a maximum of 70k internal memory,
  2094.                          irrespective of the program.
  2095.  
  2096. If you select the DISK to DISK option, the only limit to the size of your
  2097. compiled program will be the amount of disk space.  If you run out of
  2098. memory, you should try each of the above options in turn.
  2099.      HINT: A status report of the currently available memory can be
  2100. displayed at any time by simply holding down the right mouse button from
  2101. the compiler accessory.
  2102.      If you still have problems, you'll need to reduce to size of your
  2103. program, or call the compiler direct from Direct mode.  See below.
  2104.  
  2105. YOU GET AN OUT OF MEMORY ERROR WHEN YOU TRY TO RUN AN AMOS FORMAT FROM AMOS
  2106. BASIC
  2107. One simple way of minimising the memory overhead is to remove the memory
  2108. banks used to hold your sprite, music or screen data from the main program.
  2109. These banks can be loaded separately from the disk during the programs
  2110. initialisation phase.  This reduces the size of the compiled program
  2111. significantly, saving you oodles of valuable memory.
  2112.      If you still run out of space, you'll need to remove everything from
  2113. memory and cram the text buffer down to the bare minimum, using the Set
  2114. text B. command from the AMOS Search menu.  You should now compile your
  2115. program from Direct mode with:
  2116.  
  2117.      AMOS>Screen Close 0
  2118.      AMOS>compile"program.AMOS -Oprogram_C.AMOS -D01 -T3"
  2119.  
  2120. This will compile 'program.AMOS' from the disk and save it under the
  2121. filename 'program_C.AMOS'.  You can now load the file straight into AMOS
  2122. Basic and run it in the normal way.  See the section on the 'Compiler
  2123. extension' for details of the various options.  On a one meg A500, you will
  2124. now be left with an amazing 600k or so to hold your compiled programs.
  2125. Hopefully, that should be more than enough!
  2126.  
  2127. CHAPTER 15: AMOS ASSEMBLER
  2128. The AMOS compiler also has an assembler allowing you to develop machine
  2129. code within AMOS.  The documentation for the AMOS Assembler is held in a
  2130. file called 'Asm_Doc.AMOS'.  This is a comment file and contains full
  2131. instructions for using the assembler.
  2132.      The assembler is ideal for development of hybrid AMOS and assembler
  2133. programs.  As you probably already know, AMOS is written in 100% assembly
  2134. language, so when you use an assembler for your programs main logic such as
  2135. controlling aliens or solving complex maths problems for example - your
  2136. program will be as fast if not faster than the top commercial programs
  2137. around.  to employ these techniques, commercial development can be both
  2138. costly and cumbersome.  But when you boot up AMOS you're sitting in one of
  2139. the most powerful, best value development systems for the Amiga.
  2140.      Assembly in AMOS even allows you to pass variables from AMOS to the
  2141. assembler with the ease.  Macros can be employed using the procedures and
  2142. functions of AMOS.  The assembler is very fast, has an independant label
  2143. bank from AMOS, full error checking telling you where and why the assembler
  2144. found an error and many more features all outlined in the document file.
  2145.      Development is incredibly fast, you change your source code and run it
  2146. immediately in the interpreted environment, carrying on in this cycle until
  2147. happy with your result.  When you're happy with the final assembled code in
  2148. your AMOS bank, you remove your assembly language source code from the
  2149. program you are developing and call the bank containing your machine code.
  2150. Alternatively the assembler is fast enough to assemble at run time in the
  2151. program with listing off.  In the near future, through the AMOS Club, the
  2152. internals of AMOS will be documented with AMOS Assembler macros showing you
  2153. how to call all the routines such as bob, sprite, joystick control etc.
  2154. These internal routines are the envy of many a software house who guard
  2155. their macros and routines from prying eyes, which are the basis of many of
  2156. the games they publish.  Their libraries evolve as they write more games,
  2157. so aren't as full featured and operating system legal as the AMOS internal
  2158. routines.  By registering and joining the AMOS Club you can gain access to
  2159. these amazing routines.
  2160.      The AMOS Assembler can be found on the AMOS Compiler Updater disk
  2161. (Assembler.AMOS).  An example of a program using the assembler is also on
  2162. this disk (Assembler_demo.AMOS)
  2163.  
  2164. END.
  2165.