Guest User

Untitled

a guest
Jun 13th, 2013
491
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 149.99 KB | None | 0 0
  1. Version 4.0, Build 4733
  2. -----------------------
  3. * BUG fix: the optimizer generated wrong code for subtraction of a variable from
  4. a constant. This has been corrected.
  5.  
  6. * BUG fix: overlay code caused "legacy" virtual instructions to be generated,
  7. instead of the instructions from the new set.
  8.  
  9. * The CMake build scripts were updated to reflect the changes in recent versions
  10. of CMake.
  11.  
  12. * In Quincy, the bottom panel may close automatically when it looses focus and
  13. re-open when it gains focus. This allows to keep a large edit window and still
  14. access the build/log windows with a single click. (Note: this functionality
  15. can be disabled in the applocation options.)
  16.  
  17. * In Quincy, code snippets may now optionally also expand on a space character
  18. (previously, only the TAB character was supported).
  19.  
  20. * A compilation problem with the ARM7 and Thumb2 cores, in combination with
  21. recent releases of the GNU "newlib" chain, has been corrected.
  22.  
  23.  
  24. Version 4.0, Build 4548
  25. -----------------------
  26. * The instruction set of the Pawn abstract machine has been revised and cleaned
  27. up. This release is therefore not compatible with previous releases. AMX files
  28. built with an old version of the Pawn compiler (before 4.0) will not run with
  29. the current abstract machine, and AMX files built with the current compiler
  30. will not run with the old abstract machine.
  31.  
  32. The Pawn language itself has also changed in the area of handling arrays with
  33. symbolic subscripts and handling packed versus unpacked arrays. The scripts
  34. need to be adjusted to the new syntax to compile in version 4.0.
  35.  
  36. See the separate "Pawn Porting Guide" for instructions for porting scripts and
  37. host applications from Pawn 3.x to Pawn 4.0.
  38.  
  39. * The Pawn abstract machine now supports three sets of instructions:
  40. - The "core" set is the minimal set of instructions that an abstract machine
  41. must implement. If you need to mininmize the footprint of the Pawn abstract
  42. machine (e.g. on an embedded system on a small micro-controller), use this
  43. set. A Just-In-Time compiler will typically also implement the core set.
  44. - The "supplemental" set adds macro instructions to the core set. A macro
  45. instruction replaces two or more of the core instructions by a single one.
  46. This reduces the size of the script and makes it run quicker as well (by
  47. reducing the overhead of decoding the instructions). For a Just-In-Time
  48. compiler, it is usually redundant to support this, because the macro
  49. instructions are typically translated to the same native code as the
  50. original sequence of core instructions.
  51. - The "full" instruction set is a superset that adds "packed" instructions to
  52. the supplemental+core instruction set. Packed instructions decrease the
  53. size that the compiled script takes. It is mostly useful on embedded systems
  54. (with a small micro-controller) that run a script from RAM (but have enough
  55. ROM to contain a full abstract machine).
  56.  
  57. * The interface to public functions in the abstract machine has changed slightly:
  58. functions that allocate memory inside the abstract machine now return only a
  59. single pointer. Previous versions returned two pointers: one pointer to access
  60. the data, and one pointer to pass to the abstract machine (a "virtual" pointer).
  61. The manual has been updated for this; see also the "Pawn Porting Guide".
  62.  
  63. * The interface in the abstract machine to native functions has changed: native
  64. functions now get passed addresses that it can use directly. Converting
  65. addresses through amx_GetAddr() is no longer needed; in fact, that function
  66. no longer exists. See also the "Pawn Porting Guide" for details.
  67.  
  68. * The Pawn compiler now generates 32-bit, 64-bit or 16-bit AMX files (for the
  69. abstract machine). A new command-line option indicates the cell size. There
  70. is no more need to create two versions of the Pawn compiler if you wish to
  71. support both 32-bit and 64-bit scripts.
  72.  
  73. * The "enum" keyword is removed from the Pawn language. Instead, "const" now
  74. declares either single constants or enumerated lists. In most cases, you can
  75. just replace "enum" with "const", but note that the very first constant in
  76. the enumerated list must be initialized (it does not default to zero).
  77.  
  78. For example:
  79. const a = 10 // single constant
  80.  
  81. const Ping: { // constant list, default tag is "Ping"
  82. b = 1,
  83. c,
  84. Pong: d // tag override
  85. }
  86.  
  87. * In the language, the syntaxes for packed and unpacked strings have changed.
  88. A packed string now uses the syntax:
  89. "this is a packed string"
  90. And unpacked string is now enclosed between two pairs of single quotes:
  91. ''this is an unpacked string''
  92. The left-most quotes may also be back-quotes (for similarity with TeX):
  93. ``this is also an unpacked string''
  94.  
  95. * For literal arrays and array initialization, the syntax has also changed.
  96. Square brackets now mean unpacked arrays and braces (curly brackets) meand
  97. packed arrays. In a multi-dimensional array, only the last dimension may
  98. be packed.
  99.  
  100. In practice, this means that in most cases the braces must be replaced by
  101. brackets. For example, to declare and initialize an array with four cells,
  102. you now use:
  103. new rect[4] = [ 1, 2, 3, 4 ]
  104.  
  105. For packed arrays, you use braces both in the declaration of the array size
  106. and in the initialization. For example:
  107. new packed{10} = {'a', 'b', 'c' ... }
  108. The above declares an array of ten characters (these fit in three cells on a
  109. 32-bit configuration).
  110.  
  111. * The "char" keyword is gone, see above for the new way to declare packed
  112. arrays.
  113.  
  114. * Previous versions of Pawn used enumerations and tags to simulate a
  115. light-weight variant of structures. This has been replaced by a more direct
  116. way to declare "symbolic indices" in arrays. An array can now be declared
  117. as:
  118. new rect[.left, .top, .right, .bottom]
  119. The array can then only be indexed with one of the declared symbolic fields,
  120. such as in:
  121. rect[.bottom] = rect[.top] + 15
  122. Since the only valid index is a symbolic field, the brackets may be omitted,
  123. giving the shorter equivalent:
  124. rect.bottom = rect.top + 15
  125.  
  126. Symbolic indices may specify a tag for the field, and may also indicate a
  127. (pseudo-)array. Please see the "Language Guide" for details.
  128.  
  129. * To make the new way to specify symbolic indices more practical, the "#define"
  130. preprocessor directive now also supports definitions that are delimited with
  131. square brackets. This means that definitions do not have to fit on a single
  132. line. An example of such a declaration:
  133. #define PRODUCT[
  134. .code,
  135. .description{20},
  136. Float: .price
  137. ]
  138.  
  139. Later, this definition can be used to declare an array, for example:
  140. new product[PRODUCT]
  141.  
  142. * There are many minor improvements in Quincy, which enhance its usability.
  143. For example, when hoovering over a warning or error message, a balloon pops
  144. up with a description text for the message, and the relevant line in the
  145. source code is marked at the same time.
  146.  
  147. * Quincy has also obtained a symbol browser. This browser gets its data from
  148. the XML reports that are generated by the compiler. The symbol browser also
  149. extracts details from the documentation comments, and shows these in the
  150. pop-up balloons when appropriate.
  151.  
  152.  
  153. Version 3.3, build 4127
  154. -----------------------
  155. * The entire Pawn toolkit is now licensed under the Apache license, version 2.
  156. The Apache license is a very liberal license (permitting use in commercial
  157. projects), but it contains a patent clause. The previous license (zLib/libpng)
  158. did not have a patent clause.
  159.  
  160. * wxQuincy, a minimalistic IDE distributed in the Linux autopackage and TAR files
  161. now comes with source code. The IDE has been enhanced with a multiple-document
  162. interface.
  163.  
  164. * The compiler is now a little better at guessing the TAB size in case of mixed
  165. indentation with TABs and spaces. This avoids the warning "loose indentation"
  166. to be reported erroneously.
  167.  
  168. * Keep the stack 8-byte aligned in the ARM7 assembler versions of the abstract
  169. machine (some ARM compilers require this).
  170.  
  171. * amxFile uses the newest version of minIni.
  172.  
  173. * Quincy (Microsoft Windows version) now detects FTDI virtual ports (for remote
  174. debugging); it supports up to 15 user help files and it supports host-specific
  175. help files. Quincy now also has the ability to insert accented characters
  176. (extended ASCII), and a new "repeat star in multi-line comments" option.
  177.  
  178. * BUG fix with strings with an escape character followed by a single line
  179. comment (preprocessor parser error).
  180.  
  181. * BUG fix in expressions with chained relational operators and constant operands.
  182.  
  183. * BUG fix in the optimizer: removed redundant calls to malloc().
  184.  
  185. * BUG fix related to passing arrays based on an enumeration to a function.
  186.  
  187. * BUG fix in auto-completion in Quincy, related to non-alphabetic characters
  188. ('_' and '@').
  189.  
  190.  
  191. Version 3.3, build 4097
  192. -----------------------
  193. * The Pawn compiler can now take a configuration file with specific settings for
  194. an environment. New command line option: -T.
  195.  
  196. * The Linux distribution now comes with a minimalistic IDE, called wxQuincy.
  197.  
  198. * Uncrustify replaces "artistic style" as the code beautifier for Quincy.
  199.  
  200. * BUG fix: minor bug correction in missing comma in initialler of 2-dimensional
  201. array.
  202.  
  203. * Modifications in Quincy: better detection of read-only paths (or drives), an
  204. option to save the file in a different location without aborting the compile,
  205. a message in the "build log" that signals that a source file was changed since
  206. last build (and thus needs rebuilding), a window to view strings received over
  207. the serial line.
  208.  
  209. * Improvements for GraphApp terminal (for Linux).
  210.  
  211.  
  212. Version 3.3, build 4058
  213. -----------------------
  214. * Improvements in documentation comments, among which creating an "auto-summary"
  215. from the phrase in a comment.
  216.  
  217. * Moved from libffi to Dyncall for the "process and libary control" module.
  218. Dyncall is easier to build, and easier to integrate in a product.
  219.  
  220. * The interface to the debugger (from Quincy) is improved, especially for
  221. scripts built from multiple source files. It is now also possible to set
  222. break-points while debugging (previously, you either needed to leave the
  223. debugger to set a breakpoint and restart the debugging session, or to set
  224. the breakpoint by typing it in the debugger console).
  225.  
  226. * Quincy now has auto-completion of known function names and words that it
  227. looks up from the current source file.
  228.  
  229. * Quincy now uses an improved GREP utility (GNU GREP, with a modification, see
  230. the "grep.txt" file in the archive).
  231.  
  232. * BUG fix: a regression in handling multi-dimensional arrays.
  233.  
  234. * BUG fix: amx_GetString() could terminate a string with a double zero byte,
  235. possibly exceeding the maximum array size with one byte.
  236.  
  237. * BUG fix: the code generator used 17-bit signed values for packed opcodes
  238. (should be 16-bit).
  239.  
  240.  
  241. Version 3.3, build 4026
  242. -----------------------
  243. * "exit" state functions are now also supported (in addition to "entry" state
  244. functions).
  245.  
  246. * The call.pri and jump.pri opcodes have been removed, because they made a
  247. buffer-overrun attack possible.
  248.  
  249. * Trailing commas are now allowed in the initialization data of arrays. For
  250. example, the comma behind the closing brace of the second sub-array in the
  251. following declaration is allowed (but optional). The commas behind the digits
  252. 2 and 4 are allowed too (and also optional).
  253. new arr[2][2] = {
  254. { 1, 2,},
  255. { 3, 4,},
  256. }
  257.  
  258. * The macro substition processor now recognizes the "#" character for
  259. "stringizing" a parameter. For example, if you have the definition
  260.  
  261. #define log(%1) #%1
  262.  
  263. Then the expression log(test) will result in "test".
  264.  
  265. Note that concatenation of literal strings requires an ellipsis in Pawn (which
  266. is different than C/C++). So to combine the parameter with literal strings,
  267. use a syntax like:
  268.  
  269. #define log(%1) "logging: " ... #%1 ... "\n"
  270.  
  271. The stringize operator is only available in the replacement text of a macro.
  272.  
  273. * Support for the "thousands" separator (a comma) in numbers.
  274.  
  275. * When a source file contains indenting with both spaces and tab characters, and
  276. no explicit tab size is given, the compiler now makes an educated guess for
  277. the tab space to use. This reduces warnings about "loose indentation".
  278.  
  279. * SECURITY FIX: the CALL.pri and JUMP.pri instructions were removed, because
  280. one could use them to force a jump out of the virtual sand box of the abstract
  281. machine and call arbitrary code that is carefully laid out in the data section
  282. of the script.
  283.  
  284. * The handshake of the debugger in a remote-debugging configuration is a little
  285. faster. That is, the debugger finds the remote device/host faster. Remote
  286. debugging is typically used with embedded systems.
  287.  
  288. * Better support for ncurses, which is now also the default for Linux (if it
  289. is installed).
  290.  
  291. * for the amxProcess module, the dyncall library now replaces the libffi
  292. library, because dyncall comes with ports for Unix/Linux, Macintosh and
  293. Windows (libffi only supported Unix-like systems). The amxProcess module
  294. now also compiles without dyncall, but with reduced functionality.
  295. See http://www.dyncall.org/ for details on dyncall.
  296.  
  297. * The "binreloc" module is now optional when compiling pawnrun and pawndbg
  298. under Linux; binreloc is part of the "autopackage" developer tools.
  299.  
  300. * A portable INI file parser in the amxFile extension module.
  301.  
  302. * Support for code snippets and balloon "info tips" in Quincy, as well as
  303. supporting info-tips in the debugger for the current value of variables.
  304.  
  305. * Quincy supports workspaces (light-weight projects). A set of open files and
  306. the currently selected compilation options can be saved in a workspace, for
  307. quickly switching between projects.
  308.  
  309. * Various BUG fixes and improvements in the Pawn debugger (pawndbg) for working
  310. with Quincy.
  311.  
  312. * BUG fix: the ternary operator ("a ? b : c") had a bug when "b" and "c" were
  313. arrays of different lengths. This bug was reported by Bailopan on the Pawn
  314. forum.
  315.  
  316. * BUG fix: amxFile had an error in the file CRC calculation.
  317.  
  318. * BUG fix: function uuencode() in amxString was broken.
  319.  
  320. * BUG fix: when basing a one-dimensional array on an enumaration and using the
  321. ellipsis ("...") in the initialler to initialize the complete array to a
  322. value, the ellipsis would drop out immediately and fail to fill the remainder
  323. with the given value/sequence.
  324.  
  325. * BUG fix in amxString: valstr() failed on large numbers.
  326.  
  327. * BUG fix: a string like "\\" was not accepted by the Pawn compiler (double
  328. backslash at the end of a string).
  329.  
  330. * BUG fixes in amxpool (minor bugs).
  331.  
  332. * BUG fix: indexing an undeclared symbol made the compiler abort with an
  333. "assertion failed" message. This has been corrected.
  334.  
  335. * Various other bug fixes, and many improvements in Quincy.
  336.  
  337.  
  338. Version 3.3, build 3930
  339. -----------------------
  340. * New native functions fattrib() and filecrc() in the amxFile module.
  341.  
  342. * On enum declarations, a "terminating" comma is now optional if there is only
  343. one constant per line.
  344.  
  345. * Concatenation of literal strings (using "...") in the lexer, see the Language
  346. Guide for details.
  347.  
  348. * Increased maximum line length for script files in the compiler (it is now
  349. dynamically allocated).
  350.  
  351. * Implement a true LRU scheme in the overlay pool manager, also add an option
  352. to mark blocks as "protected" (not swapped out).
  353.  
  354. * Various improvements in the Quincy IDE, including updated documentation.
  355.  
  356. * Minor fix in pawnrun.c: event-driven programs without main() now also work.
  357. Previously, pawnrun required a script to have a function "main()", even if
  358. that function were just empty.
  359.  
  360. * BUG fix in one of the new (packed) opcodes. The bug occurred in the "C"
  361. versions of the abstract machine only. The assembler implementations were not affected.
  362.  
  363. * BUG fix: enum field size was not taken into account when implicitly passed to
  364. a function (default value of a parameter of a function, using "sizeof").
  365.  
  366. * BUG fix: skipping lines on the imput (in the Pawn compiler) did not work with
  367. UTF8 scanning (a static variable was overwritten).
  368.  
  369. * BUG fix in amx.c: when calling amx_Exec() with the flag to continue from the
  370. point that the abstract machine encountered a "sleep" instruction, it should
  371. also reload the overlay (a nested call to the AMX could have kicked the
  372. sleeping function out of the pool).
  373.  
  374. * BUG fix: support array assignment of a two-dimensional array into part of a
  375. three-dimensional array.
  376.  
  377. * Added opcode "PICK", for copying multi-dimensional arrays.
  378.  
  379. * Minor corrections in ARM7 assembler syntax (RealView assembler).
  380.  
  381. * BUG fix: stack not reset correctly for native function returning SLEEP.
  382.  
  383. * BUG fix: overlays and user-defined operators did not mix.
  384.  
  385. * BUG fix: the compiler dropped on an assertion in parsing a native function
  386. that returns an array.
  387.  
  388.  
  389. Version 3.3, build 3875
  390. -----------------------
  391.  
  392. * The error system is now more helpful in the common case of a mistyped symbol
  393. name: it tells you the name of a known symbol whose name closely matches.
  394.  
  395. * The compiler now generates "position-independent code", which makes it easier
  396. to run code from ROM or to load portions of the code as overlays. Old compiled
  397. scripts are transformed automatically to position-independent code (except
  398. for the JIT's, which still use physical code addresses).
  399.  
  400. * Now that that is mentioned, the abstract machine has hooks and special opcodes
  401. to load overlaid functions and the Pawn compiler can optionally create tables
  402. suitable for this purpose. The Implementer's Guide has a new appendix on using
  403. overlays. Overlays allow the creation of relatively large scripts in a memory
  404. constrained environment (it is used on embedded systems with a hard upper
  405. limit on the amount of RAM for a script, for example).
  406.  
  407. * The compiler also generates "packed instructions", where the opcode and its
  408. parameter are packed in a single cell.
  409.  
  410. * amxFile has the new functions frename() and fstat(). Function fstat() returns
  411. the size and the time stamp of a file. In contrast to flength(), this
  412. function does not need to open the file to get its size.
  413.  
  414. * amxTime has a new function cvttimestamp() to convert Unix timestamps (number
  415. of seconds since midnight of January 1, 1970) to date and time fields. In
  416. addition, function settimestamp() was documented and declared in the header,
  417. but not implemented. This has been corrected.
  418.  
  419. * amxString now contains the function strcopy(), which copies a packed string
  420. into another packed string and an unpacked string into another unpacked
  421. string. To convert strings between packed and unpacked strings, you can still
  422. use the functions strpack() and strunpack().
  423.  
  424. * Support for array comparison, with a syntax and restrictions similar to array
  425. assignment. Comparing two arrays is convenient when using arrays as
  426. light-weight structures. Only the "==" and "!=" are implemented, just like
  427. the comparison of structures in C/C++.
  428.  
  429. * There are new P-code interpreters for the ARM7 architecture. This
  430. implemenation gives a significant performance boost compared to the C version,
  431. especially because it manages to map all pseudo-registers to ARM registers.
  432. The ARM7 core is implemented both in GNU AS syntax and in ARM assembler
  433. syntax, in the files amxexec_arm7_gas.s and amxexec_arm7.s respectively.
  434.  
  435. * Jacob Dall sent patches to avoid a few common calling-convention issues on
  436. Microsoft Windows.
  437.  
  438. * Opcode checking has become stricter: when initializing an abstract machine,
  439. the abstract machine tests the parameters of branch instructions and of
  440. instructions that access data in the data segment or the stack/heap.
  441.  
  442. * BUG fixes for Big Endian processors: one was in loading the debug information
  443. and another in the "getch" code (for Linux/MacOS platforms). Both were
  444. reported by Jim Schimpf on the Pawn forum.
  445.  
  446. * BUG fix: the garbage collector dereference a pointer before checking for its
  447. validity. This bug was found by Jason Hughes and reported on the Pawn forum.
  448.  
  449. * BUG fix: amx_FindNative() used binary search on function names, but the
  450. native table is sorted on SYSREQ IDs rather than names. This bug was reported
  451. by "faluco" on the Pawn forum.
  452.  
  453. * BUG fix: the printf() function in the "console" module did not handle "%%"
  454. correctly. It should print a single "%".
  455.  
  456. * BUG fix: under particular circumstances (including a file with stock functions
  457. at the bottom of the file, and not using that particular stock function), the
  458. debug information might not refer to the correct file. This bug was signaled
  459. by Jean-Robert Laffineur.
  460.  
  461. * BUG fix: the debug information always included all public functions, even
  462. those that were not implemented.
  463.  
  464. * BUG fix: "loo" reported a bug that turned out to be in the "termwin" module
  465. (the "Microsoft Windows" graphical console). This bug occurred with scripts
  466. that use events, and especially keyboard events.
  467.  
  468. * BUG fix: when using recursive functions, the stack depth check was sometimes
  469. completely wrong and no indication for recursion was given.
  470.  
  471. * BUG fix: the libcall() function in the "Process" module pushed (on some
  472. environments) the parameters in reversed order.
  473.  
  474. * BUG fix: the JIT attempted to access memory before that memory was allocated.
  475. This bug was reported by Bailopan on the Pawn forum.
  476.  
  477. * Other fixes and improvements, notably a list of minor fixes posted by
  478. Sųren Hannibal and numerous bug reports by Bailopan.
  479.  
  480.  
  481. Version 3.2, build 3664
  482. -----------------------
  483.  
  484. * BUG fix: using user-defined operators with the compiler option -O2 (for using
  485. macro instructions) could produce code that the abstract machine finds
  486. "invalid". Actually, the code is good, but the abstract machine sees a
  487. combination of instructions that it does not expect.
  488.  
  489. * The Linux autopackage now uses autopackage version 1.2. This should make the
  490. Linux setup more robust.
  491.  
  492. * BUG fix: The function libcall() in the amxProcess extension module pushed the
  493. parameters in the wrong order under Microsoft Windows (when the module was
  494. built with Borland C++ and perhaps with other C/C++ compilers too).
  495.  
  496. * BUG fix: when the conditional operator is used in combination with functions
  497. returning arrays, the heap was restored twice (once too often). In particular
  498. the expression
  499. a ? test1() : test2()
  500. where test1() and test2() are both functions that return an array, had the
  501. effect that both the "true branch" and the "false branch" allocate space for
  502. the return value on the heap, and the heap is restored for the total of
  503. test1() and test2() at the end of the expression. However, only one of the
  504. branches is taken, so the heap is incremented for either test1() or test2(),
  505. but restored for both.
  506.  
  507. This bug was reported by Bailopan on the Pawn forum.
  508.  
  509. * BUG fix: the heap checking (overrun and underrun) was incorrect in the JITs.
  510. This made heap underflows go by mostly undetected. This bug was found by
  511. Bailopan, when he investigated the bug with the conditional operator.
  512.  
  513. * The expression "++a" in a statement like "return ++a" was optimized
  514. incorrectly by the peephole optimizer, because it considered the expression
  515. result as "unused". This also occurred in the statements "sleep" and "exit".
  516. This bug was reported by Bailopan on the Pawn forum.
  517.  
  518. * BUG fix: "nametable" field in the AMX header was swapped twice on Big Endian
  519. architectures. This bug was reported by Pekka Nikander on the Pawn forum.
  520.  
  521. * There is a new build macro to remove the default implementation of
  522. amx_Callback(). A patch from Markus Schaber, on the Pawn forum.
  523.  
  524. * The Abstract Machine core that uses computed gotos ("labels as values") is
  525. now also used for the Intel C/C++ compiler (ICC). The Intel compiler supports
  526. the GNU GCC extension. This change was suggested by Markus Schaber on the Pawn
  527. forum.
  528.  
  529. * The AMX API functions amx_PushArray() and amx_PushString() now accept NULL for
  530. the "amx_addr" parameter. This is convenient, because amx_Release() can free
  531. heap memory for multiple allocations at once.
  532.  
  533. * The compiler now adds a warning for the expression
  534. showval (a > 0) ? 1 : 2
  535. because this is interpreted as calling showval() with the parameter "a > 0",
  536. like in:
  537. (showval(a > 0)) ? 1 : 2
  538. What was intended is:
  539. showval((a > 0) ? 1 : 2)
  540.  
  541. * On Microsoft Windows, there is a second pre-compiled debugger that splits the
  542. debugger output from the script output. This debugger is intended to be used
  543. from an IDE like Quincy.
  544.  
  545. * The definition of native functions has changed so that "params" is now a
  546. "const" parameter. This gives some protection against inadvertedly changing
  547. the stack in the abstract machine.
  548.  
  549. * Improved support for running scripts in ROM. In this configuration, the P-code
  550. of the script resides in ROM and the data/stack/heap is in RAM. The abstract
  551. machine must be configured specifically for running scripts in ROM, because
  552. various optimizations (such as relocating jump addresses) no longer work.
  553.  
  554. * Various minor improvements to the Pawn debugger and the Quincy IDE.
  555.  
  556. * Various minor optimizations and minor fixes. Some related to Macintosh
  557. support, others to the Linux Autopackage. A few error/warning messages in the
  558. compiler were made more precise/accurate too.
  559.  
  560.  
  561. Version 3.2, build 3636
  562. -----------------------
  563.  
  564. * Performance of the compiler has improved, due to a faster "memory file"
  565. interface. The new interface was donated by the AMX Mod X team
  566. (http://www.amxmodx.org).
  567.  
  568. * BUG fix: for "optimize level" 2 and when using GCC or the assembler core, the
  569. SYSREQ.N instructions were not replaced correctly by SYSREQ.ND. Mostly, it
  570. failed to replace the instruction; when it did replace the instruction, it
  571. did so at the wrong position, leading to a crash. This problem did not occur
  572. with the ANSI C version of the abstract machine.
  573.  
  574. * amxProcess now loads libffi dynamically, so that it works with both version
  575. 1.20 and version 2.00-beta. Version 1.20 is the only release that can still be
  576. downloaded separately, and which is needed for GCC versions before 3.4;
  577. see http://sources.redhat.com/libffi/.
  578. libffi is only used for the Linux version of amxProcess; the Microsoft Windows
  579. version uses its own code.
  580.  
  581. * Better checks for unreachable code, including a test for code following an
  582. infinite loop.
  583.  
  584. * If no AMXLIB environment variable is set, pawnrun and pawndbg now look for
  585. the add-in modules in the same path as where they reside themselves. This
  586. change makes it easier to run Pawn "out of the box" on Linux machines.
  587.  
  588. * When making an array without specifiying the dimensions, but where the element
  589. count at the lowest dimension is the same for all, the compiler now "counts"
  590. this size, rather than setting the lowest dimension as "variable length".
  591.  
  592. An example for this situation is the declaration:
  593. new my_array[][] = { {1,0}, {2,1}, {3,1} }
  594. No dimensions are given, but the new compiler determines that the minor
  595. dimension is 2 (and the major dimension is 3). Previous compilers set the
  596. minor dimension to 0 --meaning "variable".
  597.  
  598. * BUG fix: #elseif handling did not work. Bug reported and patched by "rain" at
  599. the Pawn forum.
  600.  
  601. * A minor compiler bug (which surfaced when you would change the file output
  602. stage) was reported by Bailopan on the Pawn forum, including a suggested fix.
  603.  
  604.  
  605. Version 3.2, build 3599
  606. -----------------------
  607.  
  608. * Constants (fields) in an enumeration may now be redeclared in other
  609. enumerations, provided that all enumerations have a tag. When arrays are
  610. declared with these enumeration tags for the index, the same constant
  611. name may refer to different elements in different arrays.
  612.  
  613. * The directive "#pragma depricated" now allows for a comment on the directive
  614. line. This comment is appended to the warning message (warning 234). This
  615. feature was requested on the Pawn forum by "Greenberet" and Felix Kollmann.
  616.  
  617. * New extension module amxProcess, bringing process control and a "foreign
  618. function interface" (meaning that you can call functions from dynamically
  619. loaded DLLs in Microsoft Windows or shared libraries in Unix/Linux). There
  620. is an example script, gtkcalc, that uses the amxProcess module to create a
  621. simple GUI via gtk-server (see http://www.gtk-server.org/).
  622.  
  623. * Pawn now uses autopackage 1.0.10, which fixes a problem with the zsh shell
  624. (Linux/Unix).
  625.  
  626. * BUG fix in handling the "precision" (i.e. the maximum width) of string
  627. parameters in printf() and strformat() (from the amxCons and amxString
  628. modules respectively).
  629.  
  630. * BUG fix in using a state function before its definition, when this usage
  631. occurs from a fall-back state.
  632.  
  633. * BUG fix: the "@" character was not allowed in macro definitions (while the
  634. documentation stated that they were). They are now allowed.
  635.  
  636. * BUG fix: the retail binaries crashed when an extension module invoked a
  637. public function on an event, and that extension module was in a DLL. The
  638. cause was that the DLL contained its own copy of amx_Exec(), but possibly
  639. one that was compiled differently from the amx_Exec() in the main program.
  640. The fix is to let the main host program pass in a pointer to the correct
  641. amx_Exec() to use. This bug was reported by Loo on the Pawn forum.
  642.  
  643. * BUG fix: when compiling with -O2, an invalid assembler instruction
  644. occasionally popped up. Reported by Brad Benjamin.
  645.  
  646. * BUG fix: the OP_SYSREQ_N was not handled correctly in the assembly-optimized
  647. version of the AMX. This opcode is only generated when the optimization level
  648. (of the Pawn compiler) is set to 2.
  649.  
  650. * BUG fix in amxCons in relation with amxString: when strformat() forwards to
  651. amx_printstring() and the format string contains a %s, amx_printstring() is
  652. re-entered, but the redirected output functions were not passed through.
  653.  
  654.  
  655. Version 3.1, build 3541
  656. -----------------------
  657.  
  658. * The debugger now allows for a "split-screen" build, meaning that the debugger
  659. output goes to a simple console window/terminal (or "DOS box") and the
  660. console output produced by the script goes through a second emulated terminal
  661. (termwin for Microsoft Windows, or term_ga for GraphApp).
  662.  
  663. * Minor improvements in the termwin pseudo-terminal, mostly concerning lay-out.
  664.  
  665. * For warning 203 (symbol is never used), the reported line number is now the
  666. line of the declaration of the symbol. For warning 204 (symbol is assigned a
  667. value that is never used), the line number is the one at which the latest
  668. assignment appears.
  669.  
  670. * When the "sleep" instruction is used, the compiler now flags this in its stack
  671. usage report. The stack usage may not be accurate in such case, because the
  672. sleep instruction often permits re-entrancy (this depends on the host
  673. application).
  674.  
  675. * Quincy now checks for updates once a week. It downloads the PAD file for Pawn
  676. and parses it using TinyXML. You can turn this feature off.
  677.  
  678. * Relevant modifications from the Quincy 2005 project (http://quincy.codecutter.org)
  679. were merged into the "Quincy for Pawn" project.
  680.  
  681. * The Windows installer now registers the file extensions .p and .pawn and
  682. associates these with Quincy.
  683.  
  684. * BUG fixes related to the JIT (it had not been updated in a while).
  685.  
  686. * BUG fix: a declaration like new array[1000][1000][1000] created invalid code
  687. because the total array size exceeds 4 GiB. A check for this limit was
  688. missing. Reported by Bailopan on the Pawn forum.
  689.  
  690. * BUG fix: calling a public function from within a script (where the public
  691. function lacks a forward declaration) crashed the compiler. Reported by
  692. Bailopan on the Pawn forum.
  693.  
  694. * BUG fix: the amx_StrParam() macro copied one character too few to the newly
  695. allocated string. Reported by Peter W.
  696.  
  697. * BUG fix: a script having zero native functions still required amx_Register()
  698. to be called. This bug was fixed earlier, but it surfaces again... Reported
  699. by Peter W.
  700.  
  701.  
  702. Version 3.1, build 3526
  703. -----------------------
  704.  
  705. * The setup program failed to put the documentation (PDF files) in the
  706. "Documentation" sub-menu in the Start / Program Files menu.
  707.  
  708. * Quincy was modified so that it would work when installed in a path with a
  709. space character. In addition, the settings are now stored in an INI file,
  710. which resides in the same location as the Quincy.exe file. I prefer INI
  711. files, because they allow multiple installations of a program (in different
  712. directories) with different configurations.
  713.  
  714. * The modifications done by Allen Cronce for the Mac OS-X port were merged with
  715. the main sources. Apart from the port, the modified source code also features
  716. bug fixes related to the Endianness of the debugging information, so it is
  717. relevant to all users of Big Endian architectures (and who wish to use the
  718. debugger).
  719.  
  720.  
  721. Version 3.1, build 3522
  722. -----------------------
  723.  
  724. * Quincy, a C++ IDE written by Al Stevens and published in Dr. Dobb's Journal,
  725. is now adapted for Pawn. This is a Windows IDE, featuring an editor and a
  726. debugger.
  727.  
  728. * Remote file uploading functionality in the Pawn debugger (for hosts that
  729. support remote debugging).
  730. Warning: For remote debugging, port 1 now refers to COM1 in Windows (and
  731. ttyS1 in Linux); in previous releases you had to select port 0 for COM1.
  732.  
  733. * State variables are now available. Just like local variables have a
  734. function-local scope, state variables have a scope restricted to a state
  735. (or a set of states) --but they may be used across functions that implement
  736. that state. The documentation is up to date.
  737.  
  738. * Keyword "state" is now also an operator; it returns "true" if the automaton
  739. is in the indicated state.
  740.  
  741. * Macro-instructions for common repeated sequences, for more compact code and
  742. quicker execution. The new compiler option "-O" sets the optimization level.
  743. The JIT does not support these macro instructions, and scripts that may need
  744. to run on the JIT must therefore be compiled with -O1 (standard optimization),
  745. which is also the default setting.
  746.  
  747. * Support for re-entrant events in handling the "sleep" instruction.
  748.  
  749. * Added a delay() routine in amxTime.
  750.  
  751. * Added file matching and counting routines: fexist() (replaces the old
  752. exist() function) and fmatch(). These routines allow wild-cards, similar to
  753. those in the Unix shells.
  754.  
  755. * The Path to the XSL stylesheet is now stored into the report, and the
  756. stylesheet information is embedded in the XSL file. The generated report can
  757. therefore be viewed directly (with a browser).
  758.  
  759. * Dynamically loaded extension modules are looked up from the path in the
  760. "AMXLIB" environment variable. This is especially useful for applications
  761. that have a "plugins" directory, for contributed extensions in the form of
  762. Pawn extension modules.
  763.  
  764. * There is improved support for compiling scripts for execution from read-only
  765. memory.
  766.  
  767. * Native and public functions can be marked "depricated", to help upgrading to
  768. new scripting environments.
  769.  
  770. * To avoid a frequent error: (typing) error in the name/signature of a public
  771. function, the compiler now issues a warning if no forward declaration exists
  772. for a public function. The idea is that the (implicitly included) include
  773. file that the host application supplies, contains forward declarations for
  774. all public functions.
  775. Warning: this may require that you add forward declarations to existing
  776. header files.
  777.  
  778. * The BinReloc package used for Pawn is now version 2.0 (see
  779. www.autopackage.org). This package allows the Pawn compiler to be installed
  780. in any path; it will always find the required include files in directories
  781. that are relative to the path to the executable.
  782.  
  783. * The compiler uses strlcpy() and strlcat() as safe alternatives for strncpy()
  784. and strncat(). As not all compilers include these functions in their C
  785. library, the source code comes with standard implementations in the file
  786. lstring.c.
  787.  
  788. * Fixed several bugs related to the order in which automatons were used and
  789. declared.
  790.  
  791. * BUG fix: the generated code for the entry function (state machines, or
  792. "automatons") had the wrong stack convention.
  793.  
  794. * Minor corrections in macros (for masking absence of terminal support) in the
  795. console support (amxcons.c).
  796.  
  797. * BUG fix in strmid() concerning short destination strings.
  798.  
  799. * BUG fixes in the string packing routine (used a.o. by strcat()).
  800.  
  801. * CMakeLists.txt for the compiler: minor path-related fix
  802.  
  803. * BUG fix in amxjitsn.asm, where the JIT code was split into two different
  804. sections for no good reason (probably predating the "mprotect" support code
  805. in amx.c). Bug reported and fixed by David "BAILOPAN" Anderson.
  806.  
  807. * BUG fix: arrays used in logical expressions were not check for full indexing
  808. (as they should). Specifically, after declarating "new series[10]" an
  809. expression like "if (series || 0)" would compile without errors. Bug
  810. reported and fixed by David "BAILOPAN" Anderson (my fix is somewhat
  811. different, to catch more cases).
  812.  
  813. * BUG fix: the #error directive ignored the parsing state, so an #error
  814. directive folded inside #if 0 ... #endif still fired. Reported by "chop".
  815.  
  816. * BUG fix: the tagof operator used as a default value for function arguments
  817. took the tag of a variable, but not of an expression. Reported and fixed by
  818. Jonathan on the Pawn forum.
  819.  
  820. * BUG fix in recursion detection.
  821.  
  822. * BUG fix for the sleep opcode: the STK and HEA registers were not updated in
  823. the AMX structure (ANSI C and GNU C versions only; the assembler versions
  824. were correct). Reported and fixed by "chop".
  825.  
  826. * BUG fix: the "JIT" flag was erased under specific conditions in amx_Init().
  827.  
  828. * BUG fix: memory block for the JIT code must be aligned under Linux.
  829.  
  830. * BUG fix: structure packing was incorrect for GCC. Also removed "far"
  831. pointers from the definitions of the debug structures.
  832.  
  833. * Warning: The fixed point function fixedstr() is renamed to strfixed() to be
  834. in line with the string functions strval() and valstr(). Similarly,
  835. floatstr() is renamed to strfloat().
  836.  
  837.  
  838.  
  839. Change log for older releases
  840. -----------------------------
  841.  
  842. 28/07/2005 BUG fix for the "switch" opcode in the JIT, in the situation
  843. where only the "default" case was present (no other
  844. cases, which means that the switch was actually
  845. redundant). This bug found and fixed by Bailopan, and
  846. reported on the Pawn forum.
  847. BUG fixes for debugging symbols in 64-bit mode, found and fixed
  848. by Bailopan and reported on the Pawn forum.
  849. Fixes in the CMakeList.txt file for compiling under Linux/UNIX.
  850.  
  851. 22/07/2005 The compiler has native support for states and automatons.
  852. Implementing finite state machines is thereby easier,
  853. and the compiler helps in checking that the state
  854. machine is coherent. See the language guide for details.
  855. Several bugs related to arrays and enumerations have been
  856. fixed. Some of these bugs were (also) reported by
  857. Vic Viper on the forums.
  858. Yet one more Big Endian bug was found and fixed.
  859. Robert Daniels found and fixed a problem related to
  860. 3-dimensional arrays with a variable last dimension.
  861. His fixes have been merged in the main source.
  862. A 64-bit bug found by Bailopan was fixed. Compact Encoding
  863. should now also work with 64-bit cells.
  864. There are three new native function modules: one with string
  865. manipulation functions, one with simple network packet
  866. exchange functions and one with time/date functions.
  867. A general purpose way to accept event sources has been
  868. implemented in the "pawnrun" example program and in
  869. several of the native function libraries. With this
  870. interface, a native function library can "register"
  871. a public function that it will call upon a specific
  872. event. See pawnrun.c and the modules "amxCons.c"
  873. (@keypressed) and amxTime.c ("@timer") for details and
  874. examples.
  875. The debug protocol has changed completely. The old debug opcodes
  876. are replaced by a single new opcode: BREAK. The debug
  877. information is now appended to the AMX file, instead of
  878. being intermixed with the normal opcodes. The rationale
  879. of the new design is improved performance when running
  880. scripts with debug information, and the ability to
  881. do remote debugging.
  882. The console debugger has been enhanced to support states and to
  883. allow debugging over a serial line (RS-232), provided
  884. that the host application supports the protocol too.
  885. The screen lay-out was improved as well.
  886. The Linux compiler now uses the BinReloc package from
  887. www.autopackage.org to locate the include files and the
  888. configuration file. This should be more robust than the
  889. earlier hack.
  890. The peephole optimizer was improved. After finding an
  891. optimization, it now recurses over all rules to find
  892. (more) optimizations on the adjusted code.
  893. Documentation comments have been improved (and now include the
  894. automatons and the transitions). The lay-out has been
  895. improved as well.
  896. New #pragma "amxlimit" lets the compiler verify that the script
  897. fits the abstract machine after compilation. This is
  898. useful for embedded devices with little memory for
  899. scripts.
  900.  
  901. 18/03/2005 Small is renamed to Pawn. Changing the name has been requested
  902. regularly, by various individuals, because searching
  903. for information on the "small" scripting language (on
  904. the Internet) was not exactly easy. The word "Small"
  905. is fairly common. The new name, "Pawn" should improve
  906. the odds that when you search for "Pawn scripting",
  907. you will get information on the language. Together with
  908. the product name, names of utilities and executables
  909. changed as well.
  910. Warning: when your host application relies on the name
  911. of the compiler to be "sc.exe" or "sc", you must either
  912. rename the executable after it is built, or you must
  913. adjust your host application to run "pawncc.exe" or
  914. "pawncc" instead.
  915. The compiler is now built as a shared library/DLL. The compiler
  916. command line program is now just a driver for the
  917. library (except for the 16-bit version of the compiler).
  918. The abstract machine can now support the JIT and the assembler
  919. core together. In earlier releases, you had to choose
  920. for either the JIT or the assembler core. As the JIT
  921. does not support the debugging hook, the new scheme
  922. allows you to build the abstract machine such that you
  923. debug your scripts using the assembler core and run the
  924. final version using the JIT.
  925. Warning: the initialization of the JIT has changed (but
  926. only slightly). Host applications that use the JIT must
  927. set the AMX_FLAG_JITC flag before calling amx_Init().
  928.  
  929. 16/03/2005 BUG fix: when introducing version 7 of the binary file format
  930. I accidentally accessed the binary file directly instead
  931. of passing through sc_resetbin(). This made in-memory
  932. compilation impossible.
  933.  
  934. 12/03/2005 BUG fix: declaring a global array variable with a symbolic
  935. constant (for the array size) before that symbolic
  936. constant is defined itself, could result in a hang
  937. (or a significant compilation delay).
  938. Documentation fix: the documentation for enumerations in
  939. relation to explicit tags and array indices was
  940. incorrect.
  941. Global variables may now be declared both public and stock.
  942. Functions must still be either public or stock (or
  943. neither); note that there is not much use for public
  944. stock functions, as functions can be "forward declared"
  945. and variables cannot.
  946.  
  947. 28/02/2005 The debug information format and the debug hook have changed
  948. dramatically. The existing 5 opcodes for the debug hook
  949. FILE, LINE, SYMBOL, SRANGE and SYMTAG are now redundant,
  950. and replaced by a single new opcode: BREAK. Other
  951. opcodes that previously called the debug hook, such as
  952. CALL, RETN, and STACK, no longer call the debug hook.
  953. The information for (local and global) variables is no longer
  954. mixed in the executable code, but now appended to the
  955. file in a separate chunk. There is a new component,
  956. amxdbg.c, with functions that parse the debug
  957. information and can look up functions, line numbers and
  958. variables, given an address.
  959. Warning: all code that uses a debugging hook must be adapted.
  960. The new debugging hook strategy has the following
  961. advantages:
  962. - the debug hook can be set up on an "as-needed" basis:
  963. when you want to break out of a "hung" script, you
  964. can set up a debug hook while the script is still
  965. running;
  966. - even with the debug hook installed, the hook is a lot
  967. quicker because there are less opcodes that call the
  968. hook and the amount of data that needs to be parsed
  969. and passed on is lower;
  970. - the presence of debug information does not influence
  971. the performance of the script execution as much (but
  972. scripts without debug information and bounds checking
  973. will still run quicker that those with those checks);
  974. - the new method is more suitable for remote debugging,
  975. especially over slow links.
  976. There is also a disadvantage (apart from increased
  977. complexity of the debugger and the compiler): when an
  978. assertion fails it only gives the code address of
  979. failure --to get the matching file & line number, you
  980. need to look them up using the debug information.
  981.  
  982. 22/02/2005 The estimate of stack usage has become more precise. In the
  983. older version, the estimate could be too low, because
  984. stack usage due to parameter passing was not taken into
  985. account.
  986. The XML report (script documentation) was enhanced with a list
  987. dependencies for each function; the dependency
  988. information is the inverse of the referral information.
  989.  
  990. 17/02/2005 The method of passing parameters to public functions has
  991. changed. In the past, these were passed to amx_Exec();
  992. when arrays or strings had to be passed, you had to
  993. allocate space, copy the array/string and release the
  994. space after amx_Exec() returns. In the current method,
  995. there are the functions amx_Push(), amx_PushArray() and
  996. amx_PushString() which you call before calling
  997. amx_Exec(). The required data is allocated and copied
  998. implicitly; you must still release the allocated space,
  999. however.
  1000. Function amx_Execv() is now gone, as there is no more use for
  1001. it.
  1002. The 16-bit version of the AMX DLL (AMX16.DLL) now has all
  1003. functions as "FAR PASCAL" (which is standard), rather
  1004. than "__cdecl". The 32-bit version of the AMX DLL
  1005. (AMX32.DLL) declares the exported function amx_Exec()
  1006. now as "__stdcall". This should be transparent to the
  1007. compiler.
  1008.  
  1009. 8/02/2005 Support for the JIT in FreeBSD and OpenBSD is improved. A few
  1010. fixes were implemented. These were reported by Laurent
  1011. on the Small forum.
  1012. Merged in changes by Allen Cronce, for the support for Mac-OS.
  1013. The project file for Metrowerks Codewarrior was updated
  1014. as well.
  1015.  
  1016. 4/02/2005 BUG fix: there was an incorrect assertion in the parser which
  1017. would break an expression like "a[0] = a[1] = a[2] = 0"
  1018. (unless you build the Small compiler without
  1019. assertions). This bug was reported by "kexz" on the
  1020. Small forum.
  1021. BUG fix: a self-assignment warning was issued in a special case
  1022. of an assignment of an array element into another
  1023. element of the same array. This bug was reported by PM
  1024. on the Small forums.
  1025. BUG fix: 64-bit support used the wrong shift counts in
  1026. generating byte offsets from cell offsets. This was
  1027. reported by BAILOPAN on the Small forum.
  1028. Better portability to 64-bit cells, for example by storing the
  1029. full 64-bit function pointer to a native function in
  1030. the internal native function table. P-code files with
  1031. a 64-bit cell size have a different "magic" value
  1032. (or "signature") in the header. Most of these
  1033. modifications were described by BAILOPAN on the Small
  1034. forum.
  1035. BUG fix: the peephole optimizer could not handle long symbol
  1036. names (i.e. over 21 characters) for local variables.
  1037. This bug was reported by BAILOPAN on the Small forum.
  1038. BUG fix: constants passed into functions that accept a variable
  1039. argument list (such as printf) caused a crash. This bug
  1040. was also reported by BAILOPAN on the Small forum.
  1041. BUG fix: when a field in an enumeration had the same name as
  1042. another symbol (name conflict/symbol redefinition), the
  1043. compile crashed instead of reporting the error. This
  1044. bug was reported by "Stu" on the Small forums.
  1045.  
  1046. 31/01/2005 BUG fix: the implementation of the "SWITCH" opcode in the
  1047. abstract machine would not work correctly when a cell
  1048. is 16-bit. This bug was reported by "chop" on the
  1049. Small forum.
  1050. BUG fix: in AMXJITSN.ASM (the JIT compiler in NASM format),
  1051. one symbol was incorrectly exported, which made the
  1052. file produce a linker error when used with GCC on
  1053. Cygwin. This bug was reported by Laurent on the Small
  1054. forum.
  1055. BUG fix: in amx_Execv(), the number of parameters was forwarded
  1056. to the main function amx_Exec() in a way that was
  1057. incompatible with 16-bit architectures. This was
  1058. reported by Pierre de Vos, who is porting Small to the
  1059. Atmel ATmega128 controller.
  1060.  
  1061. 18/01/2005 Corrections merged from Embryo, the adaption of Small from the
  1062. Enlightenment team.
  1063. The command line parsing in the Small compiler was modified to
  1064. be more flexible (and perhaps slightly more conforming
  1065. to what is common with GNU programs).
  1066. A simple "script arguments" native function library was
  1067. developed. This library provides general purpose
  1068. "command line argument" parsing functions. It is
  1069. somewhat in between of argc/argv and the getopt()
  1070. library.
  1071. A few bugs were fixed in the Microsoft Windows "terminal",
  1072. especially related to scrolling and resizing.
  1073. BUG fix: in the "switch" statement was fixed a bug would occur
  1074. if an expression between the parentheses of the switch
  1075. had a side effect. This bug was reported on the Small
  1076. forum by Lajos Molnar, and analysed by BAILOPAN.
  1077. The NASM version of the assembler core of the abstract machine
  1078. would not assemble under Cygwin. This has been fixed.
  1079. The error was reported by Lexx on the Small forum.
  1080. BUG fix: the "#pragma unused" directive did not accept symbol
  1081. names with digits, underscores or "@" characters. This
  1082. bug was reported by "chop" on the Small forum.
  1083.  
  1084. 3/01/2005 The pre-build LIBSC DLL was missing an export, making the DLL
  1085. unuseable (you would have to rebuild the DLL to use it).
  1086. The self-installing setup had the version number wrong (it still
  1087. said 2.5).
  1088. The README.TXT was not up to date. The version packed in the
  1089. product came from a different directory than the one
  1090. I kept up to date.
  1091. There is a #section directive that hides all symbols declared
  1092. "static" (the #section directive simulates a file
  1093. switch). This was low on my wish list, but a recently
  1094. introduced feature in the compiler required it.
  1095.  
  1096. 22/12/2004 The JIT-compiler was translated to NASM by G.W.M. Vissers. This
  1097. makes the JIT available in Linux, and probably other
  1098. Unix-like operating systems. The port was initially done
  1099. for the free MMORPG "Eternal Lands" (by a member of the
  1100. team of the game).
  1101. Modifications for better support of FreeBSD and OpenBSD.
  1102. The Small compiler now allows multiple source files on the
  1103. command line. The compiler combines all sources to
  1104. build a single output file.
  1105. Improved the report file and the ability to extract
  1106. "documentation comments". The toolkit now comes with
  1107. a matching XSL file and an accompanying stylesheet.
  1108. These allow the report file to be directly readable in
  1109. a web-browser.
  1110. Constants that are part of an enumeration are now flagged as
  1111. such, this those constants to be grouped with the
  1112. enumeration definition in the report (XML documentation).
  1113. The argument comparison for forwardly declared functions (with
  1114. the actual implementation) was improved.
  1115. The tags of array indices are also now checked for arrays passed
  1116. as arguments to functions.
  1117. I increased the maximum number of function arguments to 127 (it
  1118. was 64, and this turned out to be too little for some
  1119. users!).
  1120. BUG fix: an object code generation flaw in the Watcom C/C++
  1121. compiler caused the abstract machine to crash after
  1122. calling a native function for the second time. The code
  1123. generation problem has be circumvented by rewriting the
  1124. expression to do exactly the same thing in a slightly
  1125. different way.
  1126. There is a GraphApp terminal as an example terminal. This
  1127. terminal supports UTF-8 natively. It also supports
  1128. wide characters, if compiled as such. Look at
  1129. http://enchantia.com/software/graphapp/ for information
  1130. on the cross-platform library GraphApp.
  1131. The DLL versions of the abstract machine (AMX16.DLL and
  1132. AMX32.DLL) now use the "termwin" terminal, which allows
  1133. for font scaling and coloured text.
  1134. BUG fix: the NASM version of the abstract machine core did not
  1135. set the "debug event code" on a "line" event.
  1136. The documentation was improved, especially regarding compilation
  1137. on Linux and Unix-like platforms. There is a new section
  1138. on CMake, a cross-platform "makefile" generator utility.
  1139.  
  1140.  
  1141. 22/07/2004 Functions can return arrays. The size of the array that is
  1142. returned must be fixed (functions returning
  1143. variable-length arrays are not supported).
  1144. The warning "function uses both `return' and `return <value>'"
  1145. is now an error.
  1146. The compiler writes extra information related to the
  1147. declarations of constants, variables and functions to
  1148. the report file, and it now also supports documentation
  1149. comments. The toolkit comes with an XSL stylesheet to
  1150. create a HTML file from the report file (which is in
  1151. XML format).
  1152.  
  1153. 25/06/2004 Warning messages can be disabled individually (compiler option
  1154. -w).
  1155. I added the makefiles for FreeBSD contributed by Raphael
  1156. Raimbault to the standard distribution. In general,
  1157. FreeBSD support has been improved.
  1158. Adam D. Moss contributed a modified version of the makefile
  1159. for the abstract machine for Linux. If have called this
  1160. "makefile.linux" (because it seems more complete) and
  1161. my original "makefile_asm.linux" (because my version
  1162. compiles the assembler implementation of the core
  1163. executive).
  1164. Arrays whose size is declared with an "enum" symbol now allow
  1165. initialization by field size. In addition, the "sizeof"
  1166. and "tagof" operators look at the size and tag of the
  1167. enumeration element. This allows Small to mimic (simple)
  1168. structures with arrays.
  1169. BUG fix: when generating debug information, the compiler still
  1170. assumed that it was always writing to file (instead of
  1171. possibly writing to memory).
  1172. Two new preprocessor directives: #error, which is similar to the
  1173. same directive in C/C++, and #tryinclude, which fails
  1174. silently if the include file cannot be found.
  1175.  
  1176. 26/03/2004 Expressions in preprocessor directives were not preprocessed
  1177. themselves. A bug found by "SniperBeamer".
  1178. The "#elseif" directive was (finally) implemented. It allows
  1179. you to chain conditionally compiled sections more
  1180. easily. Note that in contrast to C/C++, it is called
  1181. "#elseif", not "#elif".
  1182. A few modules for the abstract machine are enhanced for Unicode
  1183. and UTF-8 support.
  1184. In AMXCONS.C, create the terminal "late", meaning that if a
  1185. script does not use a terminal, it does not pop up.
  1186. Better support for having an abstract machine that uses both
  1187. fixed and floating point calculations. The format
  1188. string of the native printf() function uses %f for
  1189. floating point, %q for fixed point and %r for either
  1190. floating point or fixed point (if floating point is
  1191. not available).
  1192. A new include file "rational.inc" allows you to write a script
  1193. using "rational numbers" and leave it to the abstract
  1194. machine as to whether this means "floating point" or
  1195. "fixed point".
  1196.  
  1197. 25/03/2004 Fixed a syntax problem where the conditional operator
  1198. interferes with tagnames, in an expression like:
  1199. new bool:a=(b<10)?true:false
  1200. Here "true:" is seen as a tagname, rather than as the
  1201. second part of the "? :" operator. Adding whitespace
  1202. fixes the matter, of course. The expression:
  1203. new bool:a=(b<10)?true : false
  1204. gives no problems.
  1205. The current compiler requires that tagnames in a
  1206. conditional expression appear between paranteheses,
  1207. like in:
  1208. new plain:a=(b<10)?(plain:true):(plain:false)
  1209. This bug was found by "PM", who posted it on the Small
  1210. forum.
  1211. Names of native functions were still truncated to 19 characters
  1212. even though the new binary file format no longer
  1213. imposes a length restriction on external names. This
  1214. limit is now removed. Another bug found by "PM", and
  1215. posted on the Small forum.
  1216. The logical operators did not force the tag to "bool:" (which
  1217. they should, according to the documentation).
  1218. A few type-casts were added, to allow the source to be compiled
  1219. as C++ source.
  1220.  
  1221. 15/03/2004 The file SCLIB.C, that compiles the "Small compiler" to a
  1222. single object file for embedding into an application,
  1223. was updated to include the new files. At the same time,
  1224. it was renamed to LIBSC (for conformance with Linux).
  1225. In addition, the library file can now be compiled as a
  1226. DLL (without needing a change in the source code) and
  1227. the DLL supports the functionality required by
  1228. RUNDLL32.EXE.
  1229. The example "SRUN" files (implementation examples for the
  1230. abstract machine) have been cleaned-up a bit and
  1231. another example, for the JIT compiler was added. The
  1232. function amx_InitJIT() is now finally documented.
  1233. The syntax for declaring an increment for a constant in an
  1234. enumeration has changed. The old syntax:
  1235. enum {
  1236. first : 10,
  1237. second : 5,
  1238. }
  1239. has become:
  1240. enum {
  1241. first[10],
  1242. second[5],
  1243. }
  1244. I need this changed syntax for a new feature that I
  1245. intent to implement. In addition, I have accidentally
  1246. used the new syntax on various occasions, so it may
  1247. be more intuitive than the old syntax.
  1248.  
  1249. 3/3/2004 I added a -v switch to the compiler to set the verbosity. For
  1250. the moment, this does not change much: -v0 disables the
  1251. copyright banner and -v2 displays extra stack/heap
  1252. usage information; -v1 is the default.
  1253. The declaration and initialization of simple variables (single
  1254. cell) to constant values is significantly optimized:
  1255. from 3 opcodes to one opcode. This makes declaring a
  1256. new variable a light-weight operation.
  1257.  
  1258. 29/02/2004 The maximum number of dimensions for arrays has been increased
  1259. to 3. Hopefully, increasing it further now involves no
  1260. more than changing a constant.
  1261. As an example for how the Small abstract machine can be
  1262. extended, I have added a simple general purpose garbage
  1263. collector in a separate C file (AMXGC.C). The
  1264. "Implementor's Guide" discusses the interface and gives
  1265. an example of use, using the "Better String library"
  1266. (http://bstring.sourceforge.net/) for creating the
  1267. "garbage".
  1268. Basic support for UTF-8 is now also in the abstract machine.
  1269. The new functions amx_UTF8Get() and amx_UTF8Put()
  1270. extract or store a single (wide) character in UTF-8
  1271. encoding. The new function amx_UTF8Check enables you to
  1272. verify whether some input string is in valid UTF-8.
  1273. All functions return an error code. All functions use
  1274. a strict interpretation of the UTF-8 syntax.
  1275.  
  1276. 23/02/2004 The compiler is now able to translate "extended" ASCII files
  1277. (i.e. 8-bit ASCII) to Unicode by using a codepage
  1278. mapping file. Only characters in unpacked strings or
  1279. in character constants are translated. Appropriate
  1280. mapping files can be found on
  1281. ftp://ftp.unicode.org/Public/MAPPINGS/.
  1282. In the compiler, the option "-c" no longer sets the
  1283. character size (there were bugs in this setting, so
  1284. I doubt that anyone ever used it). It now sets the
  1285. codepage for translation.
  1286. Robert Daniels provided fixes for bugs related to Big Endian
  1287. processors (I introduced these new bugs when adding
  1288. the "symbol names" table to the header in the AMX file
  1289. format.
  1290. Robert Daniels also gave a fix for an error that has been in
  1291. the toolkit much longer: several core functions had
  1292. to peek/poke into the data section of an abstract
  1293. machine, but they did not take the possibility of
  1294. "cloned" abstract machines into account.
  1295.  
  1296. 17/02/2004 The parser stack is now "growable". In earlier releases it had
  1297. a fixed size.
  1298. A memory leakage was fixed; the leakage was related to a double
  1299. declaration of a native function.
  1300. The compiler now accepts UTF-8 files on input. It translates
  1301. non-ASCII characters (that are encoded in UTF-8) to
  1302. Unicode characters in unpacked strings. See the manual
  1303. for details.
  1304. The compiler allows character codes to be entered with a
  1305. hexadecimal escape (in addition to the existing decimal
  1306. escape): '\x82' is the same as '\130'.
  1307. Unicode support uncovered a few bugs in the handling of unpacked
  1308. strings in the "core" and "console" modules: checking
  1309. whether a string is packed or unpacked did not work for
  1310. characters above 255. This is now fixed, and it also
  1311. led to a new predefined constant in the compile:
  1312. "ucharmax".
  1313. The LINE opcode now allows a debug hook function to cause the
  1314. program to "sleep". Previously, a "sleep" mode could
  1315. only be started from a native function or via the
  1316. "sleep" statement of the Small language.
  1317.  
  1318. 5/02/2004 For arrays with 2 dimensions, the major dimension no longer
  1319. needs to be explicitly specified when there are
  1320. initiallers. The compiler can now count the number of
  1321. items itself.
  1322. "Johnny got his gun" reported the bug that the compiler signals
  1323. the expression "var = !var" as a self-assignment. This
  1324. bug applied to most unary operators. (It is now fixed.)
  1325. A new extension library (native function library) comes with
  1326. the toolkit: file input/output. Text files (plain ASCII
  1327. and UTF-8) and binrary files are supported.
  1328. There is a new terminal implementation: "termwin". This
  1329. terminal emulates a console on Microsoft Windows; its
  1330. primary feature is that you can have several of these
  1331. consoles at the same time and that it supports Unicode.
  1332. For the purpose of Unicode, the functions amx_GetString() and
  1333. amx_SetString() got an extra parameter, for interpreting
  1334. the source or destination string (on the "C" side) as
  1335. a "wchar_t" string.
  1336. Anthalir gave an update to the FreeBSD support. His changes
  1337. were merged into the main branch.
  1338.  
  1339. 16/01/2004 When you compile with option -d2, the compiler now gives you
  1340. an estimate of stack/heap usage. Even without this
  1341. option, the compiler will warn you when the stack/heap
  1342. area is too small. The stack/heap determination does
  1343. not work in the presence of recursive functions.
  1344. When you do not use the return value of a function, you mostly
  1345. do not need to enclose the function's arguments in
  1346. parantheses. That is, the snippet below is now a valid
  1347. Small program:
  1348. -----------------------------------------------------
  1349. main()
  1350. printf "Hello world\n"
  1351. -----------------------------------------------------
  1352. The manual has been updated to use this "friendlier"
  1353. syntax where possible.
  1354. The RET and RETN opcodes of the abstract machine now check
  1355. whether the "return address" (on the stack) lies inside
  1356. the code segment. This makes buffer overrun exploits
  1357. much less likely (perhaps impossible). This address
  1358. check is also done in "no debug" mode (unlike array
  1359. bounds checking, for example).
  1360. Opcode SYSREQ.D is now fully implemented. When calling a native
  1361. function, the "callback hook" function looks up the
  1362. function address. If it has found it, it may store this
  1363. address in the code stream and change the opcode from
  1364. SYSREQ.C to SYSREC.D. The SYSREQ.D calls the native
  1365. function directly, avoiding any overhead from the
  1366. callback hook.
  1367.  
  1368. 9/01/2004 The compiler generates the intermediate (assembler) file in
  1369. memory. This is faster and cleaner: compiling a .AMX
  1370. file now no longer overwrites (and deletes) the .ASM
  1371. file, if one exists.
  1372. When you do not use the result of a function call, you may now
  1373. omit the parantheses around the function's parameters.
  1374. That is, you can say:
  1375. printf "Hello world\n"
  1376. This syntax may make Small source code a little
  1377. friendlier to read, especially for novice users.
  1378. The changes of FUTURE Interactive, to support a 64-bit cell,
  1379. were merged into the main branch.
  1380.  
  1381. 30/12/2003 I switched to the zLib license for the toolkit. The original
  1382. license was already quite similar to the zLib license,
  1383. and in retrospect, the clauses that I added are not
  1384. very useful.
  1385. I changed the regression test suite to a REXX script (instead
  1386. of the older DOS "batch" file). REXX is available on
  1387. many platforms, so I hope that the regression suite
  1388. will be more useful to those users that do not run
  1389. Microsoft Windows (or DOS). By the way, I use Regina
  1390. REXX (see http://regina-rexx.sourceforge.net/).
  1391.  
  1392. 19/12/2003 Sųren Hannibal proposed the use of a private implementation
  1393. for strdup(), to make it easier to use other memory
  1394. allocators (than standard malloc()).
  1395. More options for fixed/floating point value formatting in the
  1396. printf() function (width/number of decimals)
  1397. The console functions (AMXCONS.C) were redesigned and now have
  1398. improved VT100 & Win32-console support. New native
  1399. functions are gotoxy(), wherexy(), clreol(), clrscr()
  1400. and setattr().
  1401. The toupper() and tolower() from the "core" library now also
  1402. work with accented characters using ANSI fonts
  1403. (Microsoft Windows).
  1404. New opcodes SYMTAG and SYSREQ.D. SYMTAG is for the debugger,
  1405. it allows a debugger to choose a display format based
  1406. on the "tag" of a symbol. (It was added mostly for
  1407. displaying fixed/floating point values.) SYSREQ.D is
  1408. to optimize the performance of native function
  1409. callbacks.
  1410. The ".AMX" file format changed: it now has a separate "symbol
  1411. name" table, so that the name length limit of 19
  1412. characters for "public" or "native" symbol names no
  1413. longer applies. The run-time (AMX.C) reads modules
  1414. with the previous file format as well. The compiler
  1415. only generates files in the new format, though.
  1416. The file header is now also padded to the requested "symbol",
  1417. alignment. This way, the code and data sections are
  1418. also automatically aligned to the chosen alignment.
  1419. The Small debugger now uses the console functions in AMXCONS.C
  1420. for output. This gives (almost) automatic recognition
  1421. of the proper "terminal" support. The debugger is also
  1422. improved in its display of fixed/floating point values.
  1423. Hard limits (number of files, number of breakpoints,
  1424. number of watches) have been removed.
  1425.  
  1426. 24/11/2003 The preprocessor was "fixed". One problem were various match
  1427. and replacement errors (for parametrized macros),
  1428. another problem was its slow operation.
  1429. There were "tag mismatch" errors related to the user-defined
  1430. assignment operator. These have been fixed.
  1431. AMX.C now contains various conditionally compiled sections. If,
  1432. for example, you only need to call the function
  1433. amx_Register() from an extension module, you can save
  1434. of 10 kBytes of code by compiling AMX.C with the macro
  1435. AMX_REGISTER defined. This strips out all other
  1436. functions in AMX.C.
  1437. The floating point support module got a few more native
  1438. functions: floatsqroot(), floatpower(), floatlog(),
  1439. floatsin(), floatcos(), floattan() and n_floatabs().
  1440. In addition, I documented the floating point support
  1441. in an "application note" (just like the fixed point
  1442. library).
  1443.  
  1444. 20/11/2003 The fixed point module was corrected to have accurate rounding
  1445. behaviour; for example 2.0 / 3.0 now is 0.667 instead
  1446. of 0.666. These rounding rules apply to both the
  1447. multiplication and the division operators and functions.
  1448. The documentation for the fixed point library is now
  1449. separate from the "user manual". In addition, I added a
  1450. power, a square root and an absolute value function to
  1451. the library (plus a useful "multiply, then divide"
  1452. function which avoids loss of precision in the
  1453. intermediate result).
  1454. Another error was also fixed in the library: the ANSI C version
  1455. of fixed point multiplication was prone to an
  1456. intermediate overflow bug. (I didn't catch this bug
  1457. earlier, because for most compilers there is an
  1458. optimized version for this function that uses 64-bit
  1459. arithmetic.) In addition, there are a few minor
  1460. corrections in the include file.
  1461.  
  1462. 10/11/2003 In AMXCONS.C, I changed the definition of getstring() so that
  1463. the buffer size is now in "cells" rather than
  1464. characters. In practice, this makes it much easier to
  1465. use getstring(). It is, however, not compatible with
  1466. earlier releases.
  1467.  
  1468. 5/11/2003 AMXCONS.C, the example "console" interface was extended with
  1469. an improved ANSI/VT100 terminal support and a native
  1470. Win32 console interface. New native functions are:
  1471. clrscr() clear screen
  1472. clreol() clear up to the end of line
  1473. gotoxy(x, y) set text cursor position
  1474. setattr(f, b) set foreground and background colours
  1475. I added a check for invalid "AMX" addresses in the
  1476. amx_StrParam() macro, to "fortify" native functions
  1477. against tampered ".AMX" files.
  1478. The new function amx_StrError() gives a descriptive error
  1479. string for an error code.
  1480. Frank Condello updated the project files for CodeWarrior, to
  1481. compile Small on the Macintosh. These files are found
  1482. in a subdirectory.
  1483.  
  1484. 1/11/2003 The Implementor's Guide was extended again, with notably a
  1485. much improved section on writing native functions,
  1486. including how to bind methods from a C++ class to
  1487. Small.
  1488. Under Microsoft Windows and Linux, extension modules can now
  1489. also be made as a DLL or shared library. The abstract
  1490. machine will automatically load the DLLs/shared
  1491. libraries that are required for the script that you
  1492. run. This allows you to create general purpose, plug-in
  1493. extension modules that you make available to an
  1494. implementation of the Small run-time without needing to
  1495. recompile this run-time.
  1496. The example extension modules that come with the toolkit were
  1497. adapted to make them suitable for dynamic loading.
  1498. To unload all DLLs & shared libraries after running the code,
  1499. you should call the new function amx_Cleanup(). When
  1500. dynamic loading of extension modules is disabled (or
  1501. not available), this function does nothing.
  1502. There is also an AMXEXPORT macro to use for extension modules
  1503. that are compiled as a DLL/shared library.
  1504. There were a few fixes in the CMake configuration files. I
  1505. renamed the Linux makefile back to "makefile.linux"
  1506. instead of "makefile.unx".
  1507.  
  1508. 20/10/2003 Savas Savvides (from StockWiz.com) found a bug in the array
  1509. bounds-checking of Small: negative array indices were
  1510. not caught. This was fixed.
  1511. A bug in address range checking was fixed. The bug classified
  1512. array accesses to an array at the very end of the data
  1513. section (so a global array variable) as invalid. This
  1514. was a classic "off by one" error. It occurred rarely,
  1515. though, because there is usually "string literal data"
  1516. at the end of the data section.
  1517. The definition of MAX_PATH was made more platform-independent;
  1518. the definition of POSIX is now used when available.
  1519.  
  1520. 14/10/2003 Some opcodes now do a bit more checking on the environment:
  1521. block moves/compares/fills now check the validity of
  1522. the memory ranges of the destination & source arrays;
  1523. RET and RETN check whether the return address lines
  1524. inside the "code space" of the abstract machine.
  1525. A memory leak in the compiler was fixed (related to functions
  1526. that take optional values on any of the arguments).
  1527. Failure to mark a symbol "public" in the NASM version of the
  1528. abstract machine core made this file not usable. This
  1529. was easily fixed.
  1530.  
  1531. 8/10/2003 I thought Small was fairly well documented, but re-reading a
  1532. few less common sections proved me otherwise: parts
  1533. of the documentation is outdated and several features/
  1534. functions were undocumented. Especially the
  1535. "Implementors Guide" was corrected and expanded.
  1536. I cannot say that the documentation is now fully
  1537. correct and comprehensive, but the situation is at
  1538. least "better".
  1539. The compiler now tries to include the file "default.inc" from
  1540. the include directory (not from the current directory);
  1541. this fails silently if the file does not exist. The
  1542. default.inc file may be used to include other "standard"
  1543. include files (console.inc, core.inc, ...) or an
  1544. application-specific include file. This may avoid the
  1545. common error of a script-writer forgetting to include a
  1546. file (especially if user-defined operators are used).
  1547.  
  1548. 3/10/2003 The GNU GCC and assembler versions of the Abstract Machine
  1549. now have alternative "non-debug" versions of a few
  1550. opcodes, to avoid checking for the "debug hook" flag
  1551. every time that particular opcode comes by.
  1552. The "#subst" directive was renamed to "#define". I feel that I
  1553. have made an error to keep the "#define" directive
  1554. (which declares only numeric constants) and add a new
  1555. "#subst" directive that is actually far more similar to
  1556. what #define does in C/C++. In addition, the syntax of
  1557. #subst is a superset of that of the old #define in
  1558. Small, so old scripts continue to compile.
  1559. While "renaming" #subst to #define, I added the #undef
  1560. directive.
  1561.  
  1562. 29/09/2003 The report file is now in XML format. This probably makes it
  1563. easier to integrate it into other applications.
  1564. For the #include directive, it is in most circumstances no
  1565. longer necessary to enclose the filename in quotes or
  1566. in angle brackets.
  1567. There is a syntax for "literal strings" (and also for "literal
  1568. characters", but this is less important). A literal
  1569. string does not recognize "control characters" (which
  1570. are what C/C++ calls "escape sequences").
  1571. The default control character ("escape character") is now a
  1572. backslash (instead of the caret). I used the caret
  1573. earlier, because DOS/Windows uses the backslash as a
  1574. directory separator. The backslash is so common as a
  1575. "special character" in Unix and other programming
  1576. languages, that I now feel that choosing the caret was
  1577. a wrong choice.
  1578. For backward compatibility, you can create a SC.CFG file
  1579. and add the command line option "-^".
  1580.  
  1581. 18/09/2003 An "enum" can now also be given an explicit tag. If an explicit
  1582. tag is absent, the name of the enumeration will be
  1583. de default tagname (this is the old behaviour).
  1584. When there are three warning error messages referring to the
  1585. same line (or to the same multi-line expression), the
  1586. compiler now halts with a fatal error. This situation
  1587. is mostly due to the parser being unable to recover
  1588. from an earlier error.
  1589. The user-defined assignment operator is now implemented. This
  1590. operator allows you to implement your own coercions;
  1591. for example: from integer to IEEE 754 floating point
  1592. (and vive versa).
  1593. The assignment operator is also called for function
  1594. arguments that are passed "by value".
  1595.  
  1596. 15/09/2003 The peephole optimizer is now recursive. This allows the
  1597. optimizer to re-evaluate the code after initial
  1598. optimizations. In addition, I have added a few rules.
  1599. Some minor corrections in AMXEXECN.ASM so that it works better
  1600. with older versions of NASM. In addition, with GCC,
  1601. the assembler version was never used, due to an
  1602. incorrect conditional compilation ("#ifdef") test.
  1603.  
  1604. 8/09/2003 Many bug fixes. Over the last year, several bugs (and fixes!)
  1605. were reported on the Small forum. Apart from a few that
  1606. I could not reproduce, these have been fixed in this
  1607. release. Thanks go to "chop", Chris Jones, Nacho,
  1608. Lajos Molnar, "John", Jeppe Oland, RTaylor/Akira,
  1609. Stephane Denis, James Haley, and probably many others.
  1610. A new operator "tagof", which will be useful for functions with
  1611. plurally tagged arguments.
  1612. New functions in the Abstract Machine: amx_FindNative(),
  1613. amx_GetNative() and amx_NumNatives().
  1614. The floating point support file (FLOAT.C) was changed to no
  1615. longer require dynamic memory (malloc/free). In
  1616. addition, a new rounding mode was added, which mimics
  1617. the way that C/C++ "truncate" floating point numbers to
  1618. integers (on a type cast).
  1619.  
  1620. 1/09/2003 The Small compiler now has a preprocessor. The preprocessor
  1621. matches text patterns and replaces them with other
  1622. patterns. The syntax for the patterns differs from
  1623. both the C/C++ preprocessor and from the "regular
  1624. expression" syntax, though (Small's preprocessor was
  1625. inspired by TeX macros). The Small manual was updated.
  1626. From a high-level description of the implementation of a
  1627. LINT-like tool, I got enough information to add two
  1628. more warning messages to the Small compiler:
  1629. "unreachable code" and "self-assignment".
  1630. The Small compiler creates "compact" P-code files by default,
  1631. but it cannot cope with input files whose "compact"
  1632. encoding would in fact be larger than their "plain"
  1633. encoding. (The problem lies in the "in-place" unpacking
  1634. in the abstract machine.) I prematurely fixed this
  1635. problem by generating a fatal error for those rare
  1636. cases, and requiring you to (re-)compile such input
  1637. files with "plain" encoding.
  1638. The sizeof operator now gives the number of elements in an
  1639. array. This means that for a two-dimensional array, it
  1640. can return the number of rows or the number of columns
  1641. (depending on the syntax of the sizeof operand).
  1642.  
  1643. 26/08/2002 An experimental "destructor" operator is implemented. The "~"
  1644. operator is automatically called when a variable drops
  1645. out of scope.
  1646. A few performance optimizations in the generated pseudo-code,
  1647. especially for "for" loops.
  1648. A bug where the "function should return a value" was not given
  1649. is fixed. This ocurred in a situation where you said
  1650. "new myvar = myfunc()" where "myfunc()" does not return
  1651. a value.
  1652. The "expand" function now also uses the stack space while
  1653. expanding. This hopefully solves the (already rare)
  1654. cases where the expand function got short of buffer
  1655. space. Bug reported by Robert Daniels.
  1656. Maurizio Ferraris reported a bug where the compiler crashed
  1657. when it tried to recover from a symatic error in a
  1658. particular context.
  1659. Frank Condello donated a Macintosh port of the compiler and
  1660. abstract machine. His changes were merged with this
  1661. release. In addition, there is a separate directory
  1662. with additional source code and a CodeWarrior project.
  1663.  
  1664. 19/08/2002 Native functions can now also force a "sleep", simply by
  1665. returning AMX_ERR_SLEEP.
  1666.  
  1667. 6/08/2002 To avoid the problem of structure fields being aligned
  1668. differently by different compilers, the header format
  1669. was changed to exploit "natural" alignment. Even
  1670. compilers that do not support "#pragma pack()" should
  1671. not have the good alignment. The changed header lay-out
  1672. is the main reason that this release got version number
  1673. 2.0.
  1674. There is a new compiler option, -A, and a new #pragma, "align",
  1675. which allow you to align variables on a boundary that
  1676. is an arbitrary power of 2. These tricks are sometimes
  1677. convenient (or necessary) with native functions that
  1678. use SIMD instructions. These changes are based on
  1679. code donated by Stephane Denis.
  1680. New functions amx_Clone() and amx_MemInfo(), both to support
  1681. cloned abstract machines.
  1682. For using bit masks as light-weight sets, the "enum"
  1683. instruction supports automatically multiplying by 2 of
  1684. all constants.
  1685. As an optimization, the compiler now generates a "halt"
  1686. instruction at address zero, so that the "RET" and
  1687. "RETN" instructions do not have to check for a special
  1688. zero address.
  1689. Dan Andersson found a bug in the JIT, which has now been
  1690. corrected. The JIT has also been brought up to date; it
  1691. now supports the "sleep" instruction.
  1692. As suggested by Stephane Denis, amx_Exec() now verifies that
  1693. all native functions used in a script are actually
  1694. registered, before executing any of the script.
  1695. The debugger can now optionally use the Unix "readline" package
  1696. for a more convenient command line. Due to the design
  1697. of the readline package, it requires that you build the
  1698. application, with the same compiler as the one that was
  1699. used to create the readline DLL or shared library. As
  1700. such, I recommend that you only use the "readline"
  1701. package with Unix/Linux or Microsoft Visual C/C++.
  1702. One could easily make mistakes with floating point variables
  1703. and the user-defined operators without any warning from
  1704. the compiler. For example, in several situations,
  1705. forgetting a "float:" tag on a variable declaration
  1706. gives no warning but generates completely wrong code.
  1707. Therefore, I have modified the floating point support
  1708. to use "strong" tags, i.e. "Float:". You may need to
  1709. modify your scripts if you work with the new include
  1710. files "float.inc" and "console.inc". You can look up
  1711. the "strong tags" issues in the language guide.
  1712.  
  1713. 6/05/2002 Oops, skipping compound blocks in the first pass, introduced
  1714. at 25/02/2002, caused several regression failures; in
  1715. retrospect, the compiler really needs to scan every
  1716. statement in the first pass, to record the function
  1717. and variable usage.
  1718. Maurizio Ferraris donated a modification of the compiler that
  1719. gives it support for multiple "include" directories.
  1720. BUG fix: there was a peculiar parsing error that started with
  1721. a call to an undefined function, continued with the
  1722. compiler confusing code with data declarations, and
  1723. ended with the compiler generating faulthy code without
  1724. any error/warning message whatsoever (bug reported by
  1725. Maurizio Ferraris).
  1726. BUG fix: when you use "#pragma ctrlchar" halfway a program,
  1727. the second pass uses the new "ctrlchar" value right
  1728. from the start, which causes trouble if include files
  1729. depend on the original (or default) value. (This issue
  1730. was brought to my attention by Florian Zschocke.)
  1731. BUG fix: the AMX function amx_GetAddr() could return success
  1732. on a negative address (bug reported by Robert Daniels).
  1733. BUG fix: when re-defining a function with more parameters than
  1734. the previous definition, the compiler could crash when
  1735. it tried to compare the parameter lists of the old and
  1736. the new definitions; the compiler didn't check the
  1737. length of both lists (bug reported by Robert Daniels).
  1738.  
  1739. 25/02/2002 BUG fix: when the conditional operator has unindexed arrays as
  1740. its second and third operands, the "variable type"
  1741. of the resulting expression should also be an array.
  1742. (Bug found by Linus Nuber.)
  1743. To increase the performance of the compiler, compound blocks
  1744. are skipped in the first pass (the Small compiler is
  1745. a two-pass compiler).
  1746.  
  1747. 14/02/2002 The manual is split in half: there are now two "Small booklets":
  1748. one covering the language and one for implementing
  1749. Small in applications. Much of the information from the
  1750. README.TXT is now the the ``Implementor's Guide''.
  1751. The new Implmentor's Guide also got a section on calling
  1752. public functions (other than "main()") and passing
  1753. parameters (both numeric and string parameters).
  1754.  
  1755. 13/02/2002 BUG fix: the JULIAN.SMA example program had an error in the
  1756. check for dates in the month February (bug reported
  1757. by Jan Vooijs).
  1758.  
  1759. 12/02/2002 "chop" found a series of bugs in the Small compiler and the
  1760. abstract machine:
  1761. BUG fix: the functions strpack() and strunpack in AMXCORE.C
  1762. check the validity of the memory range for the
  1763. destination string. However, the number of bytes that
  1764. were checked was far too small: the checking code
  1765. confused sizes of bytes and cells.
  1766. BUG fix: the functions amx_StrLen() and amx_GetString() in
  1767. AMX.C, the functions amx_StrPack() and amx_StrUnpack()
  1768. in AMXCORE.C and the function printstring() in
  1769. AMXCONS.C all had a problem with determining packed
  1770. strings, in case you use characters above ANSI 127.
  1771. The manual also had an error in the "ispacked()"
  1772. function in the chapter ``Assorted tips'' had the
  1773. same error.
  1774. BUG fix: in the Small debugger (SDBG.C) a check for an
  1775. available breakpoint entry was missing a semicolon.
  1776. BUG fix: chained operators did not work correctly with
  1777. user-defined relational operators, because the operator
  1778. functions garbled the ALT register. The ALT register is
  1779. now saved around the call.
  1780. BUG fix: a global variable being used prior to its definition
  1781. was not flagged correctly; it also caused a code
  1782. generation error.
  1783.  
  1784. 7/02/2002 BUG fix: The AMX DLLs apparently had problems when being used
  1785. with Microsoft Visual C/C++, due to a calling
  1786. convention mismatch (failure to save/restore some
  1787. registers).
  1788. Clem Vasseur proposed a binary search for the opcode lookup
  1789. in the compiler. This has been implemented.
  1790.  
  1791. 5/12/2001 Linus Nuber found that double-character user-defined operators
  1792. and debug information (options -d2 or -d3) do not go
  1793. well together: the size of a SYMBOL opcode may overflow
  1794. the size that the compiler initially estimated and this
  1795. causes the function to be generated at the wrong
  1796. address.
  1797.  
  1798. 30/11/2001 As per the request of Linus Nuber, I changed the way that the
  1799. compiler options are set and reset. Now the -C, -P and
  1800. -; options can have a "+" or "-" suffix that sets or
  1801. clears the desired option; without suffix, the option
  1802. is toggled. With this, you can set your default options
  1803. in the configuration file (SC.CFG) and toggle the
  1804. option on the command line.
  1805.  
  1806. 27/11/2001 "Compact encoding" of the .AMX file has become the default; use
  1807. the "-C-" compiler option to return to the old (plain)
  1808. encoding.
  1809.  
  1810. 23/11/2001 BUG fix: Linus Nuber found a code generation bug in the case
  1811. where a user-defined operator was called with a
  1812. constant on either size, such as "1.5 * 2.5" with
  1813. operator*(float:a, float:b).
  1814.  
  1815. 20/11/2001 BUG fix: Gilad Novik found that unused public variables would
  1816. be stripped from the compiled file and their addresses
  1817. re-used by other global variables (or array literals),
  1818. but that the public variable was still listed in the
  1819. file header.
  1820. BUG fix: when you ask for "sizeof x" and "x" is an array of
  1821. indeterminate size, you get a warning. The warning did
  1822. not occur if the "sizeof" expression appeared in the
  1823. default value of a function argument (in a function
  1824. definition). The lack of the warning makes the "sizeof"
  1825. default value error prone, the warning makes it safer.
  1826.  
  1827. 8/11/2001 The manual was updated to include the changes since the last
  1828. public release of the Small toolkit.
  1829. The performance of the compiler was enhanced.
  1830.  
  1831. 30/10/2001 You may specify a hard "index" for a native function, which
  1832. omits the native function from the compiled .AMX file.
  1833. For this to work, you need to implement your own native
  1834. function dispatcher; see the manual.
  1835. As per the suggestion of Stephane Denis, I used the more
  1836. specific integer types int16_t and int32_t in structure
  1837. definitions. These are defined in the ISO C99 standard.
  1838.  
  1839. 9/10/2001 The default value of a function parameter can now be the
  1840. "sizeof" of another parameter of the same function.
  1841. This is convenient to pass the sizes of array
  1842. parameters to the function without requiring the
  1843. programmer to explicitly pass the size.
  1844. The new SC_LIGHT macro allows you to exclude non-essential
  1845. components of the Small compiler upon recompilation.
  1846. These components are: the cross-reference report (-r
  1847. option), parsing of "response files" and the default
  1848. configuration file ("sc.cfg"). More may follow (for the
  1849. moment, the peephole optimizer is considered
  1850. "essential").
  1851.  
  1852. 10/09/2001 BUG fix: getproperty() of the "core" native function set read
  1853. contents from a memory block after freeing it.
  1854. BUG fix: a bit of code that writes the AMX file header still
  1855. assumed that a cell is always 32-bit.
  1856. BUG fixes: in the symbol name handling of user-defined
  1857. operators. There were several bugs; the operator that
  1858. suffered the most from these is probably the unary
  1859. minus operator.
  1860.  
  1861. 28/08/2001 BUG fix: defining the % operator would often introduce an error
  1862. in the symbol table. Cause: the % character is special
  1863. for sprintf() functions that the compiler uses to
  1864. construct symbol names.
  1865. BUG fix: Linus Nuber reported a bug where functions that were
  1866. called before their definition would be marked as
  1867. "unused" and stripped from the compiled code.
  1868. BUG fix: Clem Vasseur noted that on a fatal error, the local
  1869. variable table was not cleared; this then subsequently
  1870. fires an assertion in the exit code.
  1871. A prototype mismatch (of sc_error()) between the source and the
  1872. header files was also reported by Clem Vasseur.
  1873.  
  1874. 27/08/2001 BUG fix: Dario Sacca sent in a fix for an error in the
  1875. assembler implementation of the abstract machine. In
  1876. the debug hook for the line opcode, the "frame" offset
  1877. was not updated correctly.
  1878. New compiler option: -r, to generate a cross reference report.
  1879. The report lists all constants, global variables and
  1880. functions and tells what function is accessing them.
  1881. Stock functions that are never used are still in the
  1882. report. Native functions that are never used are not
  1883. in the report. The report file is intentionally
  1884. formatted in a minimal way, to make it easier to have
  1885. it parsed by other programs (call tree, cross-reference,
  1886. etc).
  1887.  
  1888. 8/08/2001 BUG fix: Linus Nuber was surprised to find that the version
  1889. uploaded 5 August no longer accepted user-defined
  1890. operators that were declared as stock. This
  1891. embarrassing bug is fixed. (Oh, and a silly error in
  1892. the Linux include file, also reported by Linus Nuber,
  1893. was fixed too.)
  1894. BUG fix: Odie Calima found a few more global variables that
  1895. needed to be cleared on exit.
  1896.  
  1897. 3/08/2001 BUG fix: Robert Daniels found a code generation bug in the
  1898. situation where a "for" loop contains a variable
  1899. declaration in its first expression and a break in its
  1900. body. This is now fixed.
  1901.  
  1902. 23/07/2001 The debugger got a minor improvements (quiker redraw of the
  1903. screen in termibal emulation mode).
  1904. Using a "&" where a "&&" is probably intended, or a "|" where
  1905. a "||" makes more sense, is now detected by the
  1906. compiler. (Actually, the compiler already issued a
  1907. warning for this, but it did it dumbly and too often;
  1908. now, when the compiler warns for a possibly unintended
  1909. bitwise operator, it is very likely indeed an error.)
  1910.  
  1911. 16/07/2001 The general purpose DLL calling functions have been implemented
  1912. fully and documented in the manual.
  1913.  
  1914. 2/07/2001 Stock variables: if no function accesses a global variable,
  1915. this variable gets stripped from the compiled output
  1916. file, and without warning if that variable was declared
  1917. "stock".
  1918. BUG fix: a bug in appending implicit extensions to #include
  1919. files was fixed.
  1920. Functions and global variables can be declared "static", which
  1921. restricts their scope to the current file.
  1922.  
  1923. 25/06/2001 BUG fix: if you omitted the colons on cases in a switch
  1924. statement, the compiler hung. This was corrected. (Bug
  1925. found by Joe Hansche.)
  1926. The detection of unused functions has improved. Specifically,
  1927. if function is called only by other functions which
  1928. are never used, that function is marked unused as well.
  1929. BUG fix: a script that was edited under DOS/Windows and
  1930. compiled under Linux, would give error "invalid line
  1931. continuation" for a "//" style comment. This was
  1932. corrected.
  1933.  
  1934. 27/04/2001 BUG fix: Stéphane Bouteille corrected another error that had to
  1935. do with Big Endian memory layout (in amx_Exec()).
  1936. I added "strong" tags in addition to the current "weak" tags.
  1937. See the manual for the differences.
  1938.  
  1939. 17/04/2001 I added a -S<value> option to the compiler to set the size
  1940. of the stack+heap (what you would otherwise need to
  1941. do with #pragma dynamic).
  1942. The Small compiler now parses a SC.CFG file with default
  1943. options (if that file exists). If the executable of
  1944. the compiler is called "SC16.EXE" or "a.out", then the
  1945. configuration file will be "SC16.CFG" and "a.cfg"
  1946. respectively.
  1947. The DLL version of the abstract machine got two new native
  1948. functions: loaddll() and freedll(). The calldll()
  1949. function that was already present could only call into
  1950. DLLs that had already been loaded.
  1951.  
  1952. 10/04/2001 Added a swapchars() core function that swaps all bytes in a
  1953. cell (so the low byte becomes the high byte).
  1954. More new native functions are a set of date and time functions
  1955. in AMXTIME.C and TIME.INC.
  1956. Dieter Neubauer made a 16-bit version of the Small tools
  1957. (meaning that a cell is 16-bit, instead of 32-bit).
  1958. His changes were merged in the original distribution.
  1959.  
  1960. 5/04/2001 BUG fix: Raymond Holz found that the Small compiler returned 0
  1961. after a "fatal error", where a return value of 2 would
  1962. be expected.
  1963. BUG fix: Linus Nuber found that accented characters were
  1964. treated as either negative values or as positive
  1965. values, depending on the C compiler used to build the
  1966. Small compiler.
  1967. Linus Nuber also found that the compilation instructions in
  1968. the README.TXT were inadequate for the Linux platform.
  1969. The README.TXT is corrected and a few details in the
  1970. Small compiler were adjusted (for Linux) as well.
  1971.  
  1972. 23/03/2001 BUG fix: Linus Nuber found a bug in default array parameters
  1973. that were tagged as const. As an optimization, the
  1974. compiler does not copy such arrays to the heap, but the
  1975. compiler DID try to remove them from the heap.
  1976.  
  1977. 12/03/2001 Overloaded operators are (finally) "operational". The manual
  1978. is updated to show how this new feature works.
  1979. The compiler supports literal values with a fractional part,
  1980. but you must enable this support specifically: Small
  1981. can interpret these so-called "rational numbers" as
  1982. either fixed point or as floating point numbers. Again,
  1983. see the manual for details.
  1984. For your convenience, I updated the FIXED.INC and FLOAT.INC
  1985. include files. The pre-compiled SRUN.EXE (Win32)
  1986. includes the "float.cpp" module.
  1987.  
  1988. 5/03/2001 BUG fix: native functions strpack() and strunpack() mixed up
  1989. the source and destination strings.
  1990. Maintaining correct tags became inconvenient at times; I
  1991. therefore introduced the "default tag" override "_:".
  1992. This token removes any tag from its operand (on the
  1993. right).
  1994.  
  1995. 23/02/2001 BUG fix: the code generation for the INC.I and DEC.I opcodes
  1996. was wrong (the compiler encoded one parameter).
  1997. BUG fix: code generated for an expression like "array[index]++"
  1998. was wrong: the loading of the expression result
  1999. garbled the address of the array cell to increment
  2000. subsequently.
  2001.  
  2002. 19/02/2001 Relational operators now always set a "bool" tag on their
  2003. expression result
  2004. Native functions may have an "alias" name. This lifts the
  2005. limitation of 19 characters for a native function.
  2006.  
  2007. 15/02/2001 On a fatal error, the Small compiler now forces a jump back
  2008. through the main function, rather than aborting the
  2009. program. This allows for easier embedding of the
  2010. compiler in an application.
  2011.  
  2012. 25/01/2001 The "sleep" instruction is implemented, but quite differently
  2013. than the partial implementation (of 19/12/2000). The
  2014. sleep instruction takes an optional expression (like
  2015. the "return" and the "exit" instructions) and ends the
  2016. abstract machine in a way that it can be restarted. The
  2017. tagname of the expression of "sleep" is also saved (in
  2018. the ALT register), so that you can attach a "meaning"
  2019. to the expression.
  2020. The changes from the earlier (partial) implementation
  2021. are that I used the HALT opcode rather than the SLEEP
  2022. opcode (and I subsequently removed the SLEEP opcode).
  2023. The HALT opcode needed modification to support a
  2024. restart of the AMX.
  2025. The AMX file format now saves exported tagnames (tagnames that
  2026. are used on the "sleep" and "exit" instructions) and
  2027. the abstract machine has three new functions:
  2028. amx_NumTags()
  2029. amx_GetTag()
  2030. amx_FindTagId()
  2031. The SRUN sample is adapted for the "sleep" instruction, but
  2032. simply ignores it. The SDBG sample ignores the sleep
  2033. instructions as well, but prints an informative message
  2034. when it occurs.
  2035. Due to optional semicolons, the end of an expression is now not
  2036. always easy to detect. Quite often, an error in an
  2037. expression can only be flagged when the end of the
  2038. expression has been found. As a result, an error is
  2039. now sometimes flagged one or more lines below the line
  2040. that really contains the error. This has been fixed
  2041. by giving both top and bottom line numbers between
  2042. which the error was found.
  2043.  
  2044. 28/12/2000 The DBG_LINE opcode can now abort the abstract machine. This
  2045. makes it possible to have a simple debug hook that
  2046. breaks out of "hung programs" (infinite loops). The
  2047. SRUN sample shows how to set this function up.
  2048.  
  2049. 19/12/2000 Sųren Hannibal implemented a "sleep" opcode to have a
  2050. light-weight multi-tasking of abstract machines.
  2051. Preliminary support for the sleep is in this version
  2052. (basically I copied just Sųren's changes).
  2053. BUG fix: adding a "tag" to a constant declared with a #define
  2054. caused an error message with a garbled symbol name.
  2055. (Bug found by Sųren Hannibal.)
  2056. A few minor memory leaks were fixed.
  2057.  
  2058. 12/12/2000 BUG fix: the conditional operator generated wrong code if the
  2059. "false" expression was a constant. (Bug found by Linus
  2060. Nuber.)
  2061. Variables and function arguments can now be declared "const".
  2062. Two typical uses are declaring a public variable
  2063. const (so only the host application can modify them)
  2064. and declaring array arguments const (arrays are always
  2065. passed by reference).
  2066.  
  2067. 4/12/2000 BUG fix: the import library for Microsoft Visual C/C++ for
  2068. AMX32.DLL had an incorrect definition for amx_Exec().
  2069.  
  2070. 24/11/2000 BUG fix: public functions should not allow default values for
  2071. their parameters, as their is no way that you can set
  2072. the defaults from the C/C++ side.
  2073. Unused parameters of public functions do not issue a warning
  2074. anymore; public functions often have a "required"
  2075. interface, so an unused parameter cannot be simply
  2076. deleted.
  2077. Parameters of a function may have multiple tags between braces.
  2078. This allows the function to accept a selection of
  2079. parameter "types". For an example of the syntax:
  2080. native Move({sprite,actor,weapon}:animob, x, y)
  2081. Function "Move()" can take as its first parameter a
  2082. handle tagged as "sprite", "actor" or "weapon". You can
  2083. use this on non-native functions too. Inside the
  2084. function, the parameter "animob" has the tag that is
  2085. first in the list (so "sprite" in this example).
  2086. BUG fix: after an earlier fix, SDBG now removed symbolic
  2087. information for static variables too early. (Bug found
  2088. and corrected by Linus Nuber.)
  2089.  
  2090. 18/11/2000 BUG fix: the "not" operator did not work in the Assembler
  2091. code of the abstract machine (AMXEXEC.ASM), due to
  2092. an "aggressive" optimization (by me, probably).
  2093.  
  2094. 14/11/2000 BUG fix: an expression like "if (1==1)" gives a warning about
  2095. a test that is always true, but then continues to
  2096. generate faulthy code. (Bug found by David Burgess.)
  2097. BUG fix: the SDBG debugger did not remove symbols for static
  2098. variables, causing a new one to be declared for every
  2099. call to a function containing the static declaration.
  2100. (Bug found by Linus Nuber.)
  2101.  
  2102. 1/11/2000 BUG fix: AMXEXEC.ASM can now finally be assembled with MASM
  2103. without using the "code segment" trick. This was
  2104. important because Visual C/C++ 6.0 returns incorrect
  2105. addresses for data declared in the code segment.
  2106.  
  2107. 26/10/2000 The Small compiler is now a two-pass compiler; prototypes are
  2108. no longer needed.
  2109. An internal problem, where the end of an expression could not
  2110. be determined (due to optional semicolons) in the
  2111. presence of a "preprocessor" directive, was fixed.
  2112. Array arguments with a default value are now copied to the heap
  2113. if the default value is used. This *fixes* the problem,
  2114. rather than trying to forbid it (as in the release of
  2115. 9/10/2000). The issue, by the way, was pointed out
  2116. by Sųren Hannibal mid July (I may be slow, but I am
  2117. persistent).
  2118. The new function amx_Execv() allows programming languages other
  2119. than C/C++ use the AMX DLLs. It is limited to up to
  2120. four parameters, however (this is easy to change if
  2121. you ever need more).
  2122. A bug where a recursive function provoked a warning about a
  2123. missing return value was fixed.
  2124.  
  2125. 19/10/2000 The SDBG debugger prints the return value of functions. The
  2126. integrated debugger in the DLL also supports a few
  2127. function keys:
  2128. F1 = Help
  2129. F3 = List (refresh screen)
  2130. F5 = Go
  2131. F8 = Step (trace into functions)
  2132. F10 = Next (step over functions)
  2133. A new "interface function" in the compiler, sc_error(), lets
  2134. you intercept error/warning messages that are produced
  2135. by the compiler (if you statically link the compiler as
  2136. a "library function").
  2137.  
  2138. 09/10/2000 BUG fix: using the -C and -d2 compiler options together caused
  2139. wrong encoding.
  2140. The debugger is integrated in the AMX DLLs. If you compile
  2141. with debug information, the debugger will launch
  2142. automatically. The AMX DLLs support a subset of the
  2143. ANSI terminal escape codes, so that it has a slightly
  2144. better interface.
  2145. The AMX DLLs have two new native functions: iswin32() allows
  2146. you to check whether you are running with the 16-bit
  2147. or 32-bit DLL and calldll() allows you to call any
  2148. DLL function (provided that it has a standard calling
  2149. convention).
  2150. Array arguments with a default value may not be modified (as
  2151. arrays are always passed by reference, and allowing
  2152. this would change the default value).
  2153. Updated documentation.
  2154.  
  2155. 27/09/2000 Definition of "interface functions" (called by the compiler)
  2156. allows to compile the Small compiler as a "library".
  2157. See the README.TXT file for details.
  2158. To use the Small compiler as a linkable library, a set of macro
  2159. definitions allow for a drastic reducal of namespace
  2160. polution (by global variables and functions).
  2161. A function may be declared as a "stock" function, which means
  2162. that if it isn't used, it may be stripped from the
  2163. compiled program (without warning). This way, you can
  2164. make "library" functions in header files.
  2165.  
  2166. 11/09/2000 A bug was fixed concerning the use of #endinput within an
  2167. #if ... #endif section; the compiler did not reset
  2168. the "#if" nesting level on #endinput. (Bug reported
  2169. by Jim McGinty from Artran, Inc.)
  2170. Expressions like "1 <= var <= 10" are now allowed. The result
  2171. of such an expression is 1 if all conditions hold, and
  2172. zero otherwise. The "chained relational expressions"
  2173. feature was copied from BCPL.
  2174. New opcodes SWAP.pri/alt, which are needed for chained
  2175. relational expressions.
  2176. New opcode PUSHADDR, which optimizes passing a variable by
  2177. reference.
  2178. By generating better pseudo-code for the "for" instruction, the
  2179. "Sieve of Erathosthenes" runs approximately 10% faster
  2180. (w/o print), and so will typically all small "for"
  2181. loops.
  2182. To better cope with the ever expanding lists of error/warning
  2183. messages and peephole optimizer sequence strings, these
  2184. strings are now compressed. They are still compiled as
  2185. literal strings in the executable, but a separate
  2186. utility, SCPACK, preprocesses the files and compresses
  2187. the strings.
  2188.  
  2189. 14/08/2000 Semicolons are now optional by default. This may give, in your
  2190. existing programs, warning 218 ("old style prototypes
  2191. used with optional semicolumns"). Use the "forward"
  2192. keyword to forward-declare functions; use the "/;+"
  2193. compiler option to "require" semicolons.
  2194. As per suggestion of Sųren Hannibal, you may now mix positional
  2195. and named parameters in a function call, with the
  2196. restriction that all positional parameters must precede
  2197. all named parameters. Thus a call like:
  2198. getproperty(123, .value = 456)
  2199. would now be valid.
  2200.  
  2201. 24/07/2000 A large set of bugs, reported by Sųren Hannibal, were fixed.
  2202. These include:
  2203. * code generation error for function arguments that are
  2204. passed to sub-functions by reference and that were
  2205. passed by reference themselves too;
  2206. * code generation error for labels (for "goto");
  2207. * literal arrays passed to functions were always
  2208. flagged as "not the same size as the formal argument"
  2209. * missing "#endif" at the end of the main file was not
  2210. (always) detected
  2211. * reaching end-of-file while inside a /* ... */ style
  2212. comment was undetected
  2213. * address 0 is a valid address, so the fix in the
  2214. release of 17/07/2000 for amx_Exec() actually
  2215. introduced an error.
  2216.  
  2217. 19/07/2000 As per the suggestion of Sųren Hannibal, the NO_OPTIMIZE
  2218. macro is replaced by a command line option in the
  2219. compiler (-d3).
  2220.  
  2221. 17/07/2000 Underscores between digits in a number are now allowed. This
  2222. may improve readability of large integers (for
  2223. example: 1_234_567) and for literals used in fixed
  2224. point expressions.
  2225. #pragma library is now (finally) working. This allows you to
  2226. give a tag to each native function to which
  2227. (dynamically loaded) library it belongs. The abstract
  2228. machine has functions to extract the library names that
  2229. it needs to load.
  2230. amx_Exec() will no longer start executing from address 0 if you
  2231. feed it with a program without a main() and ask to run
  2232. the "main" entry function.
  2233. The DBG_CALL event now tells to which address it is about to
  2234. jump, so a stack trace can be built. In addtition, you
  2235. will get a DBG_CALL event for the entry point (so that
  2236. the stack trace is never empty).
  2237. The sample debugger was extended with stack trace commands and
  2238. an option to print a one-dimensional array as a string.
  2239.  
  2240. 26/06/2000 A code generation bug (found by Dark Fiber) in the last update
  2241. was fixed.
  2242.  
  2243. 29/05/2000 Three bug corrections in the initialisation of the staging
  2244. buffer (that will teach me to easily change data
  2245. structures from "fixed size" to "grow as needed").
  2246. Support for public variables (in addition to public functions).
  2247. Since the manual is not yet up to date, here is a
  2248. summary:
  2249. * Only simple (global) variables can be public, no
  2250. arrays
  2251. * To create a public variable, "public" replaces "new":
  2252. public myvar;
  2253. * Alternatively, the '@' prefix works as well:
  2254. new @myvar;
  2255. * To access public variables from a C/C++ program, use
  2256. the new AMX functions:
  2257. amx_NumPubVars()
  2258. amx_GetPubVar()
  2259. amx_FindPubVar()
  2260. amx_GetPubVar() and amx_FindPubVar() return the
  2261. address of the variable relative to the AMX; use
  2262. amx_GetAddr() to get a pointer to the cell
  2263. There was (still) a problem with the stack clean-up. I don't
  2264. know what I was thinking three months ago when I made
  2265. my first fix, but I probably only tested the 32-bit
  2266. version.
  2267. Someone sent me a bug report concerning a prototype mismatch
  2268. that I misclassified. I found it again by accident,
  2269. corrected the bug that the example demonstrated and
  2270. added it to regression testing.
  2271. The BCPL manual from Martin Richards pointed out that when you
  2272. have statements end implicitly on a line end, but still
  2273. allow expressions to wrap over multiple lines, there
  2274. may be a problem with unary operators. I tested a few
  2275. cases and, indeed, found an error.
  2276.  
  2277. 22/03/2000 Bug correction in the dynamic growth of the staging buffer.
  2278. Bug correction in the stack handling of amx_Exec(), which did
  2279. not remove arguments from the "abstract machine" stack.
  2280. If you ran the same AMX program over and over again
  2281. (without reloading it), you would slowly eat up the
  2282. AMX stack.
  2283. While correcting the above mentioned bug, I also added code to
  2284. clean up the stack "the hard way" on a run time error.
  2285. The extra local variable required for this also lets
  2286. me verify (with an assertion) that the normal route
  2287. indeed cleaned up the stack correctly.
  2288. Bug correction in the assembler version of the AMX: when
  2289. compiling with a stack-oriented parameter passing
  2290. convention, it must also save the value of EBX.
  2291.  
  2292. 13/03/2000 Using symbolic constants in the "case" statements of a "switch"
  2293. could cause the label to be interpreted as a tagname.
  2294. Marc Peter converted the JIT to use __cdecl calling convention
  2295. and added (minimal) support for the SRANGE instruction
  2296. at the same time. This means that you can now use the
  2297. JIT with Borland or Microsoft's compilers.
  2298. Dark Fiber contributes an AMX extensions with high quality
  2299. pseudo-random numbers, plus a simple card game as a
  2300. non-trivial example script in Small.
  2301.  
  2302. 17/02/2000 An attempt to assign a value to a constant (or any expression
  2303. that is not an lvalue) inside a test, resulted in an
  2304. assertion failure or a crash.
  2305. The compiler let invalid prototypes pass, while complaining on
  2306. correct prototypes.
  2307. Logical expressions with && and || operators were never
  2308. identified as "constant expressions", even if the
  2309. operands on either side were constants. This prevented
  2310. such logical expressions to be used in preprocessor
  2311. expressions.
  2312. The "loose indentation" warning works nicely if you use only
  2313. TABs or only space characters to indent a line, but if
  2314. you use a combination, the warning fires even if there
  2315. is no reason. To lift this problem, the current release
  2316. introduces the -t option and the "tabsize" pragma (with
  2317. which you can set the tab size).
  2318. Years ago the compiler was changed to align all opcodes to 4
  2319. byte boundaries, to increase the speed of the virtual
  2320. machine at the expense of larger compiled files. The
  2321. current release introduces a -C switch with which the
  2322. compiler writes the output file in a more compact
  2323. encoding, at the cost of slightly longer load times.
  2324.  
  2325. 16/12/1999 Marc Peter corrected a problem in the JIT.
  2326. Path names with embedded spaces caused the compiler to fail if
  2327. you compiled with the -d2 option.
  2328. Bernard Fouche ported the sources to Linux. Based on his
  2329. changes and comments, the portability of the compiler
  2330. and the abstract machine have been improved.
  2331. Symbol names now have 31 significant characters. Native and
  2332. public names still have a maximum of 19 significant
  2333. characters.
  2334.  
  2335. 19/11/1999 Bug correction in the "for" loop concerning local variables at
  2336. the same scope as the "for" loop (found by Joe Felton).
  2337. amx_Exec() can now take NULL for the parameter for the script's
  2338. return value.
  2339. New function "random()" in AMXCORE.C.
  2340.  
  2341. 12/11/1999 Some changes for Greg Garner's module for floating point
  2342. support.
  2343. Two more "interface" function for the compiler. These functions
  2344. allow you to set "pre-defined" tag names and constants.
  2345. AMXCONS.C includes two more native functions to read a
  2346. character or a string from the keyboard.
  2347.  
  2348. 2/11/1999 Fixed minor annoyances in the compiler like failures to find
  2349. the include path on non-DOS platforms.
  2350.  
  2351. 25/10/1999 Warning message for local variables that "shadow" a function
  2352. or a variable at an earlier scope (by having the same
  2353. name, they make the earlier symbol inaccessible).
  2354. Warning message for the infamous "dangling else" problem.
  2355. Bug correction: functions with upper case letters were not
  2356. assembled correctly (bug found by Greg Garner).
  2357. New control character "^e" which has value 27 ("escape").
  2358.  
  2359. 12/10/1999 The abstract machine is now also available as a DLL for
  2360. Microsoft Windows. Both 16-bit and 32-bit DLLs are
  2361. provided (including source).
  2362.  
  2363. 1/10/1999 Semicolons to end each statement can now be made optional with
  2364. the compiler switch "-;" or with:
  2365. #pragma semicolon false
  2366. The assembler implementation of the abstract machine now also
  2367. supports __stdcall declaration. See the README for
  2368. information on compiling.
  2369. There are now two "fixed point" libraries: binary (18:14) and
  2370. decimal (three decimal digits). The decimal fixed
  2371. point library may be more "exact" when working in "real
  2372. live" calculations (which are often based on a decimal
  2373. base).
  2374.  
  2375. 27/08/1999 Bug correction: parameters passed to a Small function (called
  2376. with amx_Exec() were not stored at the correct
  2377. location (bug found & corrected by Marc Peter).
  2378. Marc Peter's JIT underwent radical changes: on the "Towers of
  2379. Hanoi" benchmark the increase of performance is 80%,
  2380. see the history log in JIT.ASM for details.
  2381.  
  2382. 23/08/1999 The assembler version of the abstract machine (by Marc Peter)
  2383. now also compiles with Microsoft Visual C/C++ 5.0 and
  2384. 6.0.
  2385. Bug correction: using the assembler abstract machine in a
  2386. program with a default calling convention of __stdcall
  2387. resulted in a crash.
  2388.  
  2389. 20/08/1999 Mark Peter's Just-In-Time compiler is now integrated with
  2390. the standard release. The JIT gives yet another
  2391. major increase in performance.
  2392.  
  2393. 18/08/1999 The assembler version of the abstract machine (by Marc Peter)
  2394. now also compiles with Borland C++ 5.0.
  2395. Updated documentation; better lay-out too.
  2396.  
  2397. 31/07/1999 Small supports two-dimensional arrays. See the manual for
  2398. the precise syntax and usage of this new feature.
  2399.  
  2400. 18/07/1999 Plus debugging opcodes for the size and dimensions of an
  2401. array.
  2402.  
  2403. 2/07/1999 Trailing spaces are ignored when concatenating lines with
  2404. a \ at the end of the line.
  2405.  
  2406. 7/06/1999 Updated the Assembler AMX (by Marc Peter) for the new
  2407. opcodes (e.g. the SWITCH opcode and associated
  2408. case table).
  2409. Bug correction: the compiler could "ignore" a fatal error
  2410. in a rare condition, leading to a crash or random
  2411. output.
  2412. Bug correction: overflowing the stage buffer issued the
  2413. wrong error message ("cannot read from file").
  2414.  
  2415. 24/05/1999 The switch statement was redesigned: the minor improvement
  2416. is the support for ranges (e.g. "case 1..8:"), the
  2417. major change is the fastly improved code generation.
  2418.  
  2419. 10/05/1999 The compiler has an option to switch the syntaxes for packed
  2420. and unpacked strings; there is also a new #pragma to
  2421. to this.
  2422. and unpacked strings.
  2423.  
  2424. 1/05/1999 Array assignment is more relaxed for literal strings: the
  2425. destination array does not have to be exactly the
  2426. same size as the string length (in cells).
  2427.  
  2428. 17/04/1999 Terminal support (ANSI escape sequences) for the debugger.
  2429. The debugger supports "watches" and a few more commands.
  2430.  
  2431. 15/04/1999 Support for static local variables.
  2432. Bug correction: the compiler did not give an error message
  2433. when returning an array from a function.
  2434. New commands in the debugger:
  2435. "GO RET" (run until function exit)
  2436. "GO n" (run until line n)
  2437. "LIST ON" (list 10 source lines after each step)
  2438. "LIST OFF" (turns above option off)
  2439. Pressing <Return> repeats the last STEP or NEXT
  2440.  
  2441. 12/04/1999 Bug correction for line continuation (\ at the end of the
  2442. line).
  2443. Error message when a \ appears in a single line comment.
  2444. New predefined constants "language" (version of the Small
  2445. language) and "compiler" (version of the Small
  2446. compiler).
  2447.  
  2448. 31/03/1999 Bug corrections for three opcodes of the abstract machine (none
  2449. of which were generated by the Small compiler) were
  2450. found and corrected by Marc Peter.
  2451. A bug in the fixed point module (relating the division of
  2452. negative numbers) was found and corrected by Marc
  2453. Peter.
  2454. Array assignment is permitted, under the condition that the
  2455. arrays at both sides of the "=" operator are of equal
  2456. size.
  2457.  
  2458. 24/02/1999 The compiler has an option to skip a number of lines before
  2459. starting to compile; this comes handy for scripts
  2460. inside text files.
  2461. The file format can now store the names of required modules
  2462. (that must possibly be dynamically linked); this is
  2463. currently supported through "#pragma library".
  2464. The new "#endscript" directive is an alias for the existing
  2465. directive "#endinput".
  2466. User data fields in the abstract machine are now "tagged", so
  2467. that you get some kind of name/value pair; you can
  2468. now determine whether a user data field is "in use".
  2469. The compiler has a few more command line options.
  2470.  
  2471. 9/12/1998 Finished integration with Marc Peter's assembler abstract
  2472. machine, including the debugger interface.
  2473. Updated documentation for new features.
  2474.  
  2475. 27/11/1998 Two more warnings: nested comment and loose indentation (both
  2476. frequently indicate an error).
  2477.  
  2478. 6/11/1998 Integration of Marc Peter's abstract machine in assembler (this
  2479. is still an experimental version).
  2480.  
  2481. 4/11/1998 Major re-design of the compiler and the ANSI C version of the
  2482. abstract machine: opcodes are now cell sized.
  2483.  
  2484. 30/10/1998 Major changes in the debugger interface to accomodate the
  2485. design of a re-entrant debugger.
  2486. Early relocation of JUMPs and CALLs, which speeds up execution.
  2487. Changes in instructions to make array indexing faster.
  2488. New opcode to speed up passing long argument lists to
  2489. functions.
  2490. Variable arguments may now be tagged.
  2491. The manual got another full reading... and corrections.
  2492.  
  2493. 23/10/1998 New directive "#emit" for those who want to program directly
  2494. in the assembler of the Small abstract machine.
  2495. New directive "#endinput" to skip the rest of the file.
  2496. New function amx_FindPublic() that returns the index of a
  2497. public function whose name is specified.
  2498. Public functions are now written to the output file in sorted
  2499. order; this allows a quicker lookup of a public
  2500. function using a binary search.
  2501. "funcidx()" is a new native function in AMXCORE.C that returns
  2502. the index of a function in the "public function table"
  2503. so that a script can return the index that the
  2504. application should call next.
  2505.  
  2506. 19/10/1998 BUG fix: when calling an unknown function, the compiler would
  2507. issue a diagnostic and then crash or hang.
  2508. Command line options changed; you can now also add definitions
  2509. on the command line of the compiler.
  2510. The debugging interface changed (it became simpler), a console
  2511. mode debugger is included as an example.
  2512. New function amx_Flags() to check whether the compiled program
  2513. contains symbolic (debugging) information.
  2514. The property functions (core library) got an extra parameter
  2515. to avoid ambiguity in some cases.
  2516. A new "native function" module: fixed point arithmetic.
  2517. Clarifications and corrections in the manual.
  2518.  
  2519. 01/10/1998 BUG fix: conditional expression was inverted!
  2520. BUG fix: conditional expressions or logical operators generated
  2521. incorrect jumps when used in function arguments
  2522. (because arguments are evaluated right-to-left, but
  2523. code is generated left-to-right).
  2524. Support for named parameters (in addition to positional
  2525. parameters). See the documentation for this major
  2526. feature.
  2527.  
  2528. 28/09/1998 New functions pass strings between C and Small functions.
  2529. Run-time check for Little/Big Endian machines.
  2530. Some extra compiler checks: unused local constants and
  2531. side-effects of expressions.
  2532.  
  2533. 24/09/1998 BUG fix: code generation bug when incrementing or decrementing
  2534. a "reference" argument with the "++" or "--" operators.
  2535. Support for accessing (packed) characters from a (cell) array
  2536. with the {..} operator (function similarly to the [..]
  2537. operator).
  2538. REMOVED module names for native functions. This turned out
  2539. to be a feature that complicated the implementation
  2540. without adding much.
  2541. Several changes in the AMX, removed amx_CheckModules() and
  2542. amx_Unregister(). No need for callback functions
  2543. in an extension module. New function amx_NativeInfo().
  2544.  
  2545. 22/09/1998 Support for Unicode characters in strings and character
  2546. literals.
  2547. Support for line concatenation with a backslash at the end
  2548. of a line.
  2549. Two more predefined constants: cellbits and charbits give the
  2550. size of a cell and a character respectively.
  2551. More error messages (errors 41 and 42 are new).
  2552. Functions whose name start with an '@' are always public.
  2553. An indirect threaded interpreter of the abstract machine
  2554. (AMX.C) when compiled with GNU CC (I used Delorie
  2555. GCC). The GNU C version is twice as fast as the
  2556. ANSI C version.
  2557. BUG fix: the compiler had a memory leak in the allocation of
  2558. the type list of function arguments.
  2559. The #define directive can now easily be removed from the
  2560. language (its support is a kludge anyway).
  2561. Packed strings are now stored in Big Endian, and no longer
  2562. terminated with a full zero cell; the new specification
  2563. makes it easier to determine whether a string is
  2564. packed or unpacked.
  2565.  
  2566. 3/09/1998 BUG fix: multiple initialized local arrays in a compound
  2567. block were not initialized correctly.
  2568. Memory for function arguments was not explicitly freed.
  2569. Support for literal arrays, just like literal strings, like
  2570. in "print( {'H','e','l','l','o',0} );
  2571. Support for default values of array arguments, as in
  2572. "addvector(a[], b[] = {1, 1, 1}, size = 3);"
  2573. or
  2574. "messagebox(text[], caption[] = "error");"
  2575.  
  2576. 28/08/1998 BUG fix: local arrays were not initialized to their full
  2577. extent.
  2578. All unitialized variables and array elements are now set
  2579. to zero (default initialization).
  2580. A few clarifications and additions in the manual.
  2581.  
  2582. 24/08/1998 BUG fix: prototypes caused invalid code generation.
  2583. BUG fix: expression involving constants could generate invalid
  2584. code.
  2585. Added the FILL opcode in the abstract machine.
  2586. More compact code generation for arrays initialized to a
  2587. single value.
  2588. Extra error message 41 (invalid use of ellipsis).
  2589.  
  2590. 20/08/1998 Improved portability of the compiler.
  2591.  
  2592. 18/08/1998 First public release.
Advertisement
Add Comment
Please, Sign In to add comment