home *** CD-ROM | disk | FTP | other *** search
/ AMOS PD CD / amospdcd.iso / 351-375 / apd373 / about_compiler_1.36 < prev    next >
Text File  |  1993-03-07  |  18KB  |  481 lines

  1. -----------------------------------------------------------------------------
  2.  
  3.                       AMOS BASIC VERSION 1.36 UPDATER
  4.  
  5.                               By François Lionet
  6.  
  7.                 AMOS Compiler (c) 1991 Europress Software Ltd.
  8.                   AMOS (c) 1991 Europress Software Ltd.
  9.  
  10. -----------------------------------------------------------------------------
  11.  
  12.                            Important copyright notes
  13.                           ---------------------------                     
  14.  
  15.      The AMOS Compiler 1.36 Updater is public domain. You can (and you
  16.      are encouraged to) copy and distribute it freely. It does not mean
  17.      the AMOS Compiler itself is public domain. Copyright remains on all
  18.      compiler system files.
  19.  
  20.      You need AMOS Basic V1.1, V1.21, V1.23, V1.3, V1.31, V1.32, V1.34
  21.      and AMOS Compiler V1.0 or 1.12 to make the adaptation.
  22.  
  23.  
  24. ------------------------------------------------------------------------------
  25.                     Move the mouse pointer to read the text.
  26. ------------------------------------------------------------------------------
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33. Foreword.
  34. -------------------------------------------------------------------------
  35.  
  36. Welcome to the third PD. update of the AMOS Compiler. This updater will
  37. save out a new AMOS Compiler version 1.36.
  38.  
  39. This update of the compiler brings only one new feature compared to the
  40. previous version (1.34) : compiled programs now work on a AA machine.
  41.  
  42. If you already own compiler V1.34, this will be the only modification
  43. since the last version.
  44.  
  45. If you own a previous version of the Compiler, you will find that a lot
  46. of work has been done to the code, and that a lot of problems have been
  47. removed from the compiler.
  48.  
  49. You have discovered quite a few problems with the compiler, even though we
  50. pumped the whole AMOS PD. library through it before its release! Each user has
  51. their own programming style, and the Compiler has to cope with all of them.
  52. We have also discovered that some problems were only due to tricky 
  53. programming habits. Please read the "pseudo-errors" chapter in this file!
  54.  
  55. We go on with our policy of PD. updates, and we hope that your bank account 
  56. likes it. For us, doing this is like saying a big thank you for all your 
  57. feedback.
  58.  
  59.  
  60. Cheers! François 01/02/1993
  61.  
  62.  
  63. Contents.
  64. ---------------------------------------------------------------------------
  65.  
  66.     * Enhancements to V1.34
  67.     * Bugs removed from V1.12
  68.     * Enhancements to V1.12
  69.     * Pseudo compiler errors.
  70.     * Quick problem reference list.
  71.     * How to create a bootable disc.
  72.     * Bugs removed from V1.0
  73.  
  74.  
  75. Enhancement to V1.34
  76. ------------------------------------------------------------------------
  77.  
  78. * Compiled programs now work perfectly on a AA machine. You can as usual
  79. flip between a AA workbench and the AMOS Program.
  80. The new method used on a AA machine makes it impossible to work under
  81. interrupts. That's why you will discover that it Amiga-A does not respond
  82. when a disc activity is taking place, but only when disc access is over.
  83.  
  84.  
  85. Bugs removed from V1.12.
  86. ------------------------------------------------------------------------
  87.  
  88. * Icons are now in replace mode when a program boots.
  89.  
  90. * CBLOCK now works on screens larger than 480 pixels.
  91.  
  92. * PRINT # used to send a CHR$(0) each time it encountered a semi column.
  93.   You could not access a printer properly.
  94.  
  95. * =DIR$ used to crash without disc.
  96.  
  97. * DIR$= does not leave a lock on the disc. The directory system works like it
  98.   does in AMOS 1.34. Please refer to this documentation.
  99.  
  100. * VAL() now stops on spaces when entering hexadecimal or binary numbers.
  101.  
  102. * VAL() now works fine in both Workbench and AMOS compiled programs. You
  103.   *MUST* read the pseudo-problems chapter about this!
  104.  
  105. * You can now have floating point numbers in a compiled .AMOS program.
  106.  
  107. * The annoying odd SET BUFFER bug is corrected : the compiler used to 
  108.   set buffer to 520 or over in a .AMOS program!
  109.  
  110. * A compiled program does not load the DISK FONT library upon running. It
  111.   only asks for it when you GET FONT for the first time. So if your program
  112.   does not use graphic fonts, you will gain memory (51k on a 2.0 system!)
  113.  
  114. * Close Workbench now works under WB 2.0.
  115.  
  116. * The requester now appears in the AMOS environment under WB2.0. Disc swaps
  117.   are correctly detected. It does not crash any more under WB1.3 as it 
  118.   did sometimes.
  119.  
  120. * Error trapping is now fully corrected. Quite a lot of bugs there! RESUME and
  121.   RESUME NEXT did not work in a GOSUB, or in a .AMOS compiled program.
  122.   The ERROR instruction now reports errors over 50.
  123.  
  124. * Def FN works fine under the compiler with floats.
  125.  
  126. * SET RAINBOW used to crash with illegal parameters.
  127.  
  128. * A FOLLOW left in the program does not crash the compiler.
  129.  
  130. * RANDOMIZE was bugging the compiled program pile, thus leading to crashes
  131.   later on. Very difficult bug to find.
  132.  
  133. * ICON BANKS are now detected by a compiled program.
  134.  
  135. * PRINT USING does not crash with an empty string.
  136.  
  137. * UNDER ON/OFF is no longer compiled as INVERSE.
  138.  
  139. * Compiled program's icons are not saved over each other.
  140.  
  141. * EVERY works fine. At last!
  142.  
  143. * A very bad bug caused the compiler to crash or report a "Label Not Defined"
  144.   when compiling certain programs.
  145.   If a program has an area of code that uses up exactly 510 bytes with no JSR
  146.   machine code calls being made, a relocation problem would occur. This was
  147.   a very rare situation which could vanish as quickly as it had appeared.
  148.   For example, you could make one line change to your code and it would
  149.   compile cleanly again! 
  150.  
  151.   
  152.   
  153.  
  154. Enhancements to V1.12.
  155. ------------------------------------------------------------------------------
  156.  
  157. All enhancements done to AMOS (new instructions, new directory system) have
  158. been ported into the compiler. A program exploiting these new facilities
  159. will compile.
  160.  
  161. Please refer to the "About_AMOS_1.34" documentation on the AMOS updater.
  162.  
  163.  
  164.  
  165.  
  166.  
  167. Pseudo Compiler bugs.
  168. -----------------------------------------------------------------------------
  169.  
  170. This chapter is crucial. If something goes wrong with your compiler, please
  171. read this first, and check to see if the problem cannot be corrected.
  172. In 99% of cases, it can.
  173.  
  174.  
  175.   Floating Point.
  176.   ---------------
  177. The old AMOS Compiler classic problem. 
  178.  
  179. Your program uses floating point numbers. It works fine under AMOS, but you
  180. get strange results once compiled (very large negative numbers, illegal
  181. function call etc...).
  182. All you need to do is insert the next line : 
  183.  
  184. A#=0.0
  185.  
  186. at the very beginning of your program, immediately after the SET BUFFER
  187. instruction. Do NOT insert it within a procedure, as it will not work.
  188.  
  189. Why?
  190.  
  191. The compiler explore a source code from the beginning to the end, 
  192. sequentially. To be fast, the AMOS compiler is a one-pass compiler.
  193. It means it actually creates the code during the source exploration.
  194. If the compiler encounters a =VAL() function in the code, without
  195. being aware of the presence of floating points in the program (without
  196. having encountered a floating point number before VAL() ) then it
  197. will create integer only code. And an integer value used as a float
  198. number gives really weird negative numbers.
  199.  
  200. That's why you must tell the compiler first "Watch out : I will use floats 
  201. in this program!
  202.  
  203.  
  204.   Global variables.
  205.   -----------------
  206. Another side effect of the one-pass technique can affect GLOBAL variables.
  207. The side effects can generate bizarre values as with VAL() above, or even
  208. a crash with strings.
  209.  
  210. It appears when you make a variable global AFTER you've assigned a value to it.
  211. Example of bad code:
  212.  
  213. A=5
  214. Global A
  215.  
  216. This worked under AMOS, as the verification process is two passes. It does not 
  217. work under the compiler. So the above code should read:
  218.  
  219. Global A
  220. A=5
  221.  
  222. Remember : always make your variable or arrays global BEFORE assigning ANY
  223. values to them.
  224. The best solution is to always group your global variables in the first lines
  225. of your program, and not to spread them all around your code. Example:
  226.  
  227. '----------------------------------------------
  228. ' Title
  229. '----------------------------------------------
  230. Set Buffer 20
  231. '
  232. ' If needed, to tell the compiler about floats
  233. A#=0.0
  234. '
  235. ' Now, we dimension the arrays
  236. Dim A$(10),B$(15)
  237. '
  238. ' Now we define global variables
  239. Global A$(),B$(),E,F#
  240. '
  241. ' And ONLY now, can we assign values...
  242. A$(0)="This is good programming!"
  243. B$(15)="Sure it is."
  244.  
  245.  
  246.   Extension not loaded when compiling.
  247.   ------------------------------------
  248. This annoying message sometimes appears when you compile programs that uses
  249. special extensions, like AMOS 3D, TOME, CTEXT, DUMP etc... 
  250.  
  251. The first thing to do is to check that the extension is correctly installed
  252. on your system. Load your normal AMOS, load the faulty program, and TEST it.
  253. You should not be reported any errors.
  254. If you have, then you should first install the extension, if you have it!
  255. Extensions are usually furnished with an install program. This program
  256. will save out the extension into your AMOS_System folder.
  257.  
  258. To finish the installation, you should load the CONFIG1_3.AMOS program
  259. under your normal AMOS, then choose "Load Default Configuration", and 
  260. type the name of the extension at the correct position in the extension list.
  261. Then save your extension.
  262.  
  263. DO NOT STOP HERE : Now choose "Load Other Configuration" and choose the
  264. file called RAMOS1_3.ENV in your AMOS folder. This configuration file
  265. is the one used by the compiler. Here too you must enter the name of the
  266. new extension in the extension list. If you don't, the compiler will not be
  267. aware of the presence of the new extension, and will report an "Extension
  268. not Loaded" error when compiling.
  269.  
  270. The compiler uses RAMOS1_3.Env when you compile a program with "No Errors"
  271. set in the Compiler options menu.
  272.  
  273.  
  274.   Size of the program.
  275.   --------------------
  276. Your program was compiling fine, and now the compiler crashes when 
  277. compiling. Or the compiled code crashes.
  278. Your program is quite big (60k of CODE, means you need a 60k editor
  279. buffer to hold it).
  280.  
  281. The compiler default setup is tuned to work with programs up to 70-80k of 
  282. code. To run faster, the compiler does not check overwriting its buffers. So
  283. if your program is too big, then it simply writs into non-reserved memory.
  284. This can cause an immediate crash, a late crash (surprise, surprise), or a
  285. strange object code.
  286.  
  287. You should run the program called:
  288.  
  289.     Compile_Large_Programs.AMOS
  290.  
  291. This program can be found on your updated AMOS_Compiler disc. It will alter
  292. the compiler configuration so that the compiler can cope with bigger AMOS
  293. creations.
  294.  
  295. The altered configuration file will allow you to compile programs as large
  296. as 160K of code (which is REALLY enormous).
  297.  
  298. If you are a hard-worker, and your program reaches this size, then
  299. you should use a text editor to modify the "compiler_configuration" file
  300. in your AMOS system. This file is in plain ascii text, and gives a full
  301. explanation about the process.
  302. At the same time, you can have fun personalising your AMOS Compiler messages.
  303.  
  304.  
  305.   Memory problems.
  306.   ----------------
  307. Your compiled program runs nicely during a certain amount of time, then 
  308. it returns to Workbench. If you compile with error messages, you get a
  309. "Out Of Memory" error. If, in your program you display the amount of 
  310. free memory, you get quite a high value, like 30k.
  311.  
  312. Unfortunately, a real out of memory has occurred, there is nothing
  313. that can be done about it. 
  314. The memory of your Amiga, is like a piece of Swiss cheese. each time 
  315. a program wants some memory, the system creates a hole in the cheese.
  316. The whole of memory consists of free, then reserved, then free, then
  317. reserved, chunk of bytes.
  318. When you boot your machine, everything is tidy. All the reserved memory
  319. lies in the bottom of the memory map, and the free areas in the top.
  320. But your program will reserve, and free more and more memory when it is 
  321. running. It will then free small parts in the bottom. After a while, the
  322. number of small parts (from 8 bytes to a couple of k) increase considerably.
  323. If you want, say a 60k bank, the system cannot use all these small parts
  324. of free memory in the bottom. Even a 50k chunk is not enough.
  325.  
  326. There is NOTHING we can do to prevent it. That's the way it goes with a
  327. multitask machine. We can only give you tricks to avoid problems:
  328.  
  329. * Always leave a reasonable amount of free mem. 50k should be the minimum. It 
  330.   is not safe to run a program on an Amiga with less than 20k. It can crash 
  331.   at any moment.
  332.  
  333. * If you need big chunks of memory, reserve them once and for all at the
  334.   beginning of your program. 
  335.  
  336. * The same applies to screens. Try, as far as possible, to open all screens
  337.   at the beginning, and keep them opened. Hide them if needed.
  338.  
  339.  
  340.   Chaining compiled programs problem.
  341.   ------------------------------------
  342. If you've written two AMOS programs and want to make the first one load and
  343. run the second you may find that, although the two programs run OK separately,
  344. the second one just refuses to be launched by the first.
  345.  
  346. This problem also comes from memory limitations. When you run a second program
  347. from a first one, there is a moment when the following occupies memory at the
  348. same time:
  349.  
  350.     1 The first program code and screens.
  351.     2 The second program being loaded.
  352.  
  353. Although we have made it as clever as possible, during a small moment, 
  354. running a second program from a first, AMOS will ask for more memory than
  355. the biggest of the two programs. Not very much more (around 50k).
  356.  
  357. You can though, do something to avoid this problem. Since the display screens
  358. are directly transferred from one program to another, nothing is erased in
  359. display memory. So you can remove the following items before chaining:
  360.  
  361.     * Erase all opened screens.
  362.     * Erase any bob banks.
  363.     * Clear blocks out.
  364.     * Set the sprite buffer to only 16 lines.
  365.  
  366. This way you reduce the size of remaining reserved memory during the load.
  367.  
  368. The problem can also be caused by the "memory problem" we have just
  369. seen before. If the first program created a lot of garbage in memory, and if
  370. the second is very big, then it might not be possible to reserve a chunk of
  371. continuous memory big enough to load the code.
  372.  
  373. To prevent this further you could cut down each program's code into smaller
  374. sections which chain each other.
  375.  
  376.  
  377. Quick AMOS_Compiler problem reference (Problem, Solution): 
  378. --------------------------------------------------------------------------
  379.  
  380. P: The floating point numbers give odd results once compiled.
  381. S: Insert A#=0.0 at the top of your program.
  382.  
  383. P: My compiled program holds odd values in global variables.
  384. S: Remove all assignments to variables before turning them into global.
  385.  
  386. P: My compiler crashes.
  387. S: The program is too large, run "Compile_Large_Programs.AMOS"
  388.  
  389. P: My compiled program crashes.
  390. S: If the program is large, run "Compile_Large_Programs.AMOS"
  391. S: Remove all assignments to string variables or arrays before turning them
  392.    into global.
  393.  
  394. P: I get an Extension not loaded error when compiling, but it worked 
  395.    fine under AMOS.
  396. S: Install the extension name into RAMOS1_3.ENV configuration file.
  397.  
  398. P: My compiled program returns to Workbench.
  399. S: In most cases your program is failing to find a file. First compile your
  400.    program with error messages. Then try it from an OPENED CLI, or from
  401.    the Workbench. An error message will then be returned. Make sure you 
  402.    are in the correct directory and that you have copied all the files.
  403. S: If you compile your program with the "CLI Programs to run in the
  404.    background" option selected, then the default directory upon booting
  405.    will be "SYS:", and NOT the directory you booted from.
  406.  
  407. P: I have created a bootable disc but the program returns to Workbench.
  408. S: If you try your compiled program on a bootable disc, the RAM DISC will
  409.    not be created as it may be under your normal AMOS interpreter. If your
  410.    compiled program access the ram disc it will simply create an error
  411.    and escape out. Make sure the system configuration is exactly the same
  412.    when you run your compiled program.
  413. S: You program could not load the disc fonts, or the disc font library.
  414.    Copy the Font: folders and the Libs:Discfont.library onto your bootable
  415.    disc. Have a look at the next chapter, "How to create a bootable
  416.    disc".
  417.  
  418.  
  419.  
  420.  
  421. How to create a bootable disc, simply.
  422. ----------------------------------------------------------------------
  423.  
  424. Your program is now ready, you want to create a bootable disc. Here is
  425. a simple and reliable way to proceed. 
  426.  
  427. * Do a DISK-COPY of your AMOS Basic Programs disc
  428.  
  429. * With a disc editor, delete ALL the files and folders, except for the
  430.   following directories:
  431.  
  432.     C
  433.     L
  434.     Devs
  435.     S
  436.     Libs
  437.     
  438. This way, you have a blank disc, with all system file correctly installed,
  439. and with a proper startup-sequence.
  440.  
  441. * Now compile your program and save it with the name : "AMOS1.3" on this
  442.   disc. It will run automatically when booted. Clever isn't it?
  443.  
  444.  
  445.  
  446. Major problems corrected in V1.12 from V1.1.
  447. ----------------------------------------------------------------------------
  448.  
  449. * For / Next loops in a sub-routine do not mess other For / Next loops
  450.   up.
  451.  
  452. * Title Bottom compiles.
  453.  
  454. * Priority ON / OFF compiles.
  455.  
  456. * HAM interlaced screens can now be opened.
  457.  
  458. * =PORT() used to wait for characters.
  459.  
  460. * Compiler.AMOS now works fine with CLI programs.
  461.  
  462. * Compiler shell skips sub-directories in AMOS_System folder.
  463.  
  464.  
  465. The future of AMOS Compiler.
  466. ----------------------------------------------------------------------------
  467.  
  468. The AMOS Compiler will constantly be updated so that it keeps up-to-date with
  469. new trends on the Amiga scene. For the latest AMOS update information
  470. contact:-
  471.                                 Anne Tucker
  472.                        The Official AMOS PD. Library
  473.                              1 Penmynydd Road,
  474.                                   Penlan
  475.                                   Swansea
  476.                                  West Glam
  477.                                   SA5 7EH
  478.                              Tel: 0792 588156
  479.  
  480. -----------------------------------------------------------------------------
  481.