Skip to main content.
IBAN   NL79 ABNA 0477 3565 08
EU-VAT NL170160656B01
Chamber of Commerce 32041148
http://www.compuphase.com
Eerste Industriestraat 19-21
1401VL  Bussum
tel. +31 35 693 9261
info@compuphase.com
CompuPhase

The pawn language

 
Quality software

Pawn's icon

An embedded scripting language

Summary of recent changes

 

date / version changes
26 March, 2008
version 3.3.3951
  • The compiler no longer accepted strings that ended with a double backslash. This annoying bug was fixed.
  • The Quincy IDE has various improvements in the area of syntax highlighting and informational tooltips.
6 March, 2008
version 3.3.3936
  • New native functions fattrib() and filecrc() in the amxFile module.
  • On enum declarations, a "terminating" comma is now optional if there is only one constant per line.
  • Concatenation of literal strings (using "...") in the lexer, see the Language Guide for details.
  • Increased maximum line length for script files in the compiler (it is now dynamically allocated).
  • Implement a true LRU scheme in the overlay pool manager, also add an option to mark blocks as "protected" (not swapped out).
  • Various improvements in the Quincy IDE, including updated documentation.
  • Minor fix in pawnrun.c: event-driven programs without main() now also work. Previously, pawnrun required a script to have a function "main()", even if that function were just empty.
  • BUG fix in one of the new (packed) opcodes. The bug occurred in the "C" versions of the abstract machine only. The assembler implementations were not affected.
  • BUG fix: enum field size was not taken into account when implicitly passed to a function (default value of a parameter of a function, using "sizeof").
  • BUG fix: skipping lines on the imput (in the Pawn compiler) did not work with UTF8 scanning (a static variable was overwritten).
  • BUG fix in amx.c: when calling amx_Exec() with the flag to continue from the point that the abstract machine encountered a "sleep" instruction, it should also reload the overlay (a nested call to the AMX could have kicked the sleeping function out of the pool).
  • BUG fix: support array assignment of a two-dimensional array into part of a three-dimensional array.
  • Added opcode "PICK", for copying multi-dimensional arrays.
  • Minor corrections in ARM7 assembler syntax (RealView assembler).
  • BUG fix: stack not reset correctly for native function returning SLEEP.
  • BUG fix: overlays and user-defined operators did not mix.
  • BUG fix: the compiler dropped on an assertion in parsing a native function that returns an array.
18 December, 2007
version 3.3.3875
  • The error system is now more helpful in the common case of a mistyped symbol name: it tells you the name of a known symbol whose name closely matches.
  • The compiler now generates "position-independent code", which makes it easier to run code from ROM or to load portions of the code as overlays. Old compiled scripts are transformed automatically to position-independent code (except for the JIT's, which still use physical code addresses).
  • Now that that is mentioned, the abstract machine has hooks and special opcodes to load overlaid functions and the Pawn compiler can optionally create tables suitable for this purpose. The Implementer's Guide has a new appendix on using overlays. Overlays allow the creation of relatively large scripts in a memory constrained environment (it is used on embedded systems with a hard upper limit on the amount of RAM for a script, for example).
  • The compiler also generates "packed instructions", where the opcode and its parameter are packed in a single cell.
  • amxFile has the new functions frename() and fstat(). Function fstat() returns the size and the time stamp of a file. In contrast to flength(), this function does not need to open the file to get its size.
  • amxTime has a new function cvttimestamp() to convert Unix timestamps (number of seconds since midnight of January 1, 1970) to date and time fields. In addition, function settimestamp() was documented and declared in the header, but not implemented. This has been corrected.
  • amxString now contains the function strcopy(), which copies a packed string into another packed string and an unpacked string into another unpacked string. To convert strings between packed and unpacked strings, you can still use the functions strpack() and strunpack().
  • Support for array comparison, with a syntax and restrictions similar to array assignment. Comparing two arrays is convenient when using arrays as light-weight structures. Only the "==" and "!=" are implemented, just like the comparison of structures in C/C++.
  • There are new P-code interpreters for the ARM7 architecture. This implemenation gives a significant performance boost compared to the C version, especially because it manages to map all pseudo-registers to ARM registers. The ARM7 core is implemented both in GNU AS syntax and in ARM assembler syntax, in the files amxexec_arm7_gas.s and amxexec_arm7.s respectively.
  • Jacob Dall sent patches to avoid a few common calling-convention issues on Microsoft Windows.
  • Opcode checking has become stricter: when initializing an abstract machine, the abstract machine tests the parameters of branch instructions and of instructions that access data in the data segment or the stack/heap.
  • BUG fixes for Big Endian processors: one was in loading the debug information and another in the "getch" code (for Linux/MacOS platforms). Both were reported by Jim Schimpf on the Pawn forum.
  • BUG fix: the garbage collector dereference a pointer before checking for its validity. This bug was found by Jason Hughes and reported on the Pawn forum.
  • BUG fix: amx_FindNative() used binary search on function names, but the native table is sorted on SYSREQ IDs rather than names. This bug was reported by "faluco" on the Pawn forum.
  • BUG fix: the printf() function in the "console" module did not handle "%%" correctly. It should print a single "%".
  • BUG fix: under particular circumstances (including a file with stock functions at the bottom of the file, and not using that particular stock function), the debug information might not refer to the correct file. This bug was signaled by Jean-Robert Laffineur.
  • BUG fix: the debug information always included all public functions, even those that were not implemented.
  • BUG fix: "loo" reported a bug that turned out to be in the "termwin" module (the "Microsoft Windows" graphical console). This bug occurred with scripts that use events, and especially keyboard events.
  • BUG fix: when using recursive functions, the stack depth check was sometimes completely wrong and no indication for recursion was given.
  • BUG fix: the libcall() function in the "Process" module pushed (on some environments) the parameters in reversed order.
  • BUG fix: the JIT attempted to access memory before that memory was allocated. This bug was reported by Bailopan on the Pawn forum.
  • Other fixes and improvements, notably a list of minor fixes posted by Søren Hannibal and numerous bug reports by Bailopan.
10 November, 2006
version 3.2.3664
  • BUG fix: using user-defined operators with the compiler option -O2 (for using macro instructions) could produce code that the abstract machine finds "invalid". Actually, the code is good, but the abstract machine sees a combination of instructions that it does not expect.
  • The Linux autopackage now uses autopackage version 1.2. This should make the Linux setup more robust.
  • BUG fix: The function libcall() in the amxProcess extension module pushed the parameters in the wrong order under Microsoft Windows (when the module was built with Borland C++ and perhaps with other C/C++ compilers too).
  • BUG fix: when the conditional operator is used in combination with functions returning arrays, the heap was restored twice (once too often). In particular the expression
        a ? test1() : test2()
    where test1() and test2() are both functions that return an array, had the effect that both the "true branch" and the "false branch" allocate space for the return value on the heap, and the heap is restored for the total of test1() and test2() at the end of the expression. However, only one of the branches is taken, so the heap is incremented for either test1() or test2(), but restored for both.

    This bug was reported by David "Bailopan" Anderson on the Pawn forum.

  • BUG fix: the heap checking (overrun and underrun) was incorrect in the JITs. This made heap underflows go by mostly undetected. This bug was found by David "Bailopan" Anderson, when he investigated the bug with the conditional operator.
  • BUG fix: The expression "++a" in a statement like "return ++a" was optimized incorrectly by the peephole optimizer, because it considered the expression result as "unused". This also occurred in the statements "sleep" and "exit". This bug was reported by David "Bailopan" Anderson on the Pawn forum.
  • BUG fix: "nametable" field in the AMX header was swapped twice on Big Endian architectures. This bug was reported by Pekka Nikander on the Pawn forum.
  • There is a new build macro to remove the default implementation of amx_Callback(). A patch from Markus Schaber, on the Pawn forum.
  • The Abstract Machine core that uses computed gotos ("labels as values") is now also used for the Intel C/C++ compiler (ICC). The Intel compiler supports the GNU GCC extension. This change was suggested by Markus Schaber on the Pawn forum.
  • The AMX API functions amx_PushArray() and amx_PushString() now accept NULL for the "amx_addr" parameter. This is convenient, because amx_Release() can free heap memory for multiple allocations at once.
  • The compiler now adds a warning for the expression
        showval (a > 0) ? 1 : 2
    because this is interpreted as calling showval() with the parameter "a > 0", like in:
        (showval(a > 0)) ? 1 : 2
    What was intended is:
        showval((a > 0) ? 1 : 2)
  • On Microsoft Windows, there is a second pre-compiled debugger that splits the debugger output from the script output. This debugger is intended to be used from an IDE like Quincy.
  • The definition of native functions has changed so that "params" is now a "const" parameter. This gives some protection against inadvertedly changing the stack in the abstract machine.
  • Improved support for running scripts in ROM. In this configuration, the P-code of the script resides in ROM and the data/stack/heap is in RAM. The abstract machine must be configured specifically for running scripts in ROM, because various optimizations (such as relocating jump addresses) no longer work.
  • Various minor improvements to the Pawn debugger and the Quincy IDE.
  • Various minor optimizations and minor fixes. Some related to Macintosh support, others to the Linux Autopackage. A few error/warning messages in the compiler were made more precise/accurate too.
15 August, 2006
version 3.2.3636
  • Performance of the compiler has improved, due to a faster "memory file" interface. The new interface was donated by the AMX Mod X team (http://www.amxmodx.org).
  • BUG fix: for "optimize level" 2 and when using GCC or the assembler core, the SYSREQ.N instructions were not replaced correctly by SYSREQ.ND. Mostly, it failed to replace the instruction; when it did replace the instruction, it did so at the wrong position, leading to a crash. This problem did not occur with the ANSI C version of the abstract machine.
  • amxProcess now loads libffi dynamically, so that it works with both version 1.20 and version 2.00-beta. Version 1.20 is the only release that can still be downloaded separately, and which is needed for GCC versions before 3.4; see http://sources.redhat.com/libffi. libffi is only used for the Linux version of amxProcess; the Microsoft Windows version uses its own code.
  • Better checks for unreachable code, including a test for code following an infinite loop.
  • If no AMXLIB environment variable is set, pawnrun and pawndbg now look for the add-in modules in the same path as where they reside themselves. This change makes it easier to run Pawn "out of the box" on Linux machines.
  • When making an array without specifiying the dimensions, but where the element count at the lowest dimension is the same for all, the compiler now "counts" this size, rather than setting the lowest dimension as "variable length".
  • An example for this situation is the declaration:
          new my_array[][] = { {1,0}, {2,1}, {3,1} }
    No dimensions are given, but the new compiler determines that the minor dimension is 2 (and the major dimension is 3). Previous compilers set the minor dimension to 0 --meaning "variable".
  • BUG fix: #elseif handling did not work. Bug reported and patched by "rain" at the Pawn forum.
  • A minor compiler bug (which surfaced when you would change the file output stage) was reported by David "Bailopan" Anderson on the Pawn forum, including a suggested fix.
5 July, 2006
version 3.2.3599
  • Constants (fields) in an enumeration may now be redeclared in other enumerations, provided that all enumerations have a tag. When arrays are declared with these enumeration tags for the index, the same constant name may refer to different elements in different arrays.
  • The directive "#pragma deprecated" now allows for a comment on the directive line. This comment is appended to the warning message (warning 234). This feature was requested on the Pawn forum by "Greenberet" and Felix Kollmann.
  • New extension module amxProcess, bringing process control and a "foreign function interface" (meaning that you can call functions from dynamically loaded DLLs in Microsoft Windows or shared libraries in Unix/Linux). There is an example script, gtkcalc, that uses the amxProcess module to create a simple GUI via gtk-server (see http://www.gtk-server.org/).
  • Pawn now uses autopackage 1.0.10, which fixes a problem with the zsh shell (Linux/Unix).
  • BUG fix in handling the "precision" (i.e. the maximum width) of string parameters in printf() and strformat() (from the amxCons and amxString modules respectively).
  • BUG fix in using a state function before its definition, when this usage occurs from a fall-back state.
  • BUG fix: the "@" character was not allowed in macro definitions (while the documentation stated that they were). They are now allowed.
  • BUG fix: the retail binaries crashed when an extension module invoked a public function on an event, and that extension module was in a DLL. The cause was that the DLL contained its own copy of amx_Exec(), but possibly one that was compiled differently from the amx_Exec() in the main program. The fix is to let the main host program pass in a pointer to the correct amx_Exec() to use. This bug was reported by Loo on the Pawn forum.
  • BUG fix: when compiling with -O2, an invalid assembler instruction occasionally popped up. Reported by Brad Benjamin.
  • BUG fix: the OP_SYSREQ_N was not handled correctly in the assembly-optimized version of the AMX. This opcode is only generated when the optimization level (of the Pawn compiler) is set to 2.
  • BUG fix in amxCons in relation with amxString: when strformat() forwards to amx_printstring() and the format string contains a %s, amx_printstring() is re-entered, but the redirected output functions were not passed through.
See the history.txt in the downloadable archives for a longer history.