-
Notifications
You must be signed in to change notification settings - Fork 9
/
history.txt
2112 lines (1875 loc) · 126 KB
/
history.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
Version 3.2, build 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 Bailopan 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
Bailopan, when he investigated the bug with the conditional operator.
* 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 Bailopan 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.
Version 3.2, build 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 Bailopan on the Pawn forum, including a suggested fix.
Version 3.2, build 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 depricated" 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.
Version 3.1, build 3541
-----------------------
* The debugger now allows for a "split-screen" build, meaning that the debugger
output goes to a simple console window/terminal (or "DOS box") and the
console output produced by the script goes through a second emulated terminal
(termwin for Microsoft Windows, or term_ga for GraphApp).
* Minor improvements in the termwin pseudo-terminal, mostly concerning lay-out.
* For warning 203 (symbol is never used), the reported line number is now the
line of the declaration of the symbol. For warning 204 (symbol is assigned a
value that is never used), the line number is the one at which the latest
assignment appears.
* When the "sleep" instruction is used, the compiler now flags this in its stack
usage report. The stack usage may not be accurate in such case, because the
sleep instruction often permits re-entrancy (this depends on the host
application).
* Quincy now checks for updates once a week. It downloads the PAD file for Pawn
and parses it using TinyXML. You can turn this feature off.
* Relevant modifications from the Quincy 2005 project (http://quincy.codecutter.org)
were merged into the "Quincy for Pawn" project.
* The Windows installer now registers the file extensions .p and .pawn and
associates these with Quincy.
* BUG fixes related to the JIT (it had not been updated in a while).
* BUG fix: a declaration like new array[1000][1000][1000] created invalid code
because the total array size exceeds 4 GiB. A check for this limit was
missing. Reported by Bailopan on the Pawn forum.
* BUG fix: calling a public function from within a script (where the public
function lacks a forward declaration) crashed the compiler. Reported by
Bailopan on the Pawn forum.
* BUG fix: the amx_StrParam() macro copied one character too few to the newly
allocated string. Reported by Peter W.
* BUG fix: a script having zero native functions still required amx_Register()
to be called. This bug was fixed earlier, but it surfaces again... Reported
by Peter W.
Version 3.1, build 3526
-----------------------
* The setup program failed to put the documentation (PDF files) in the
"Documentation" sub-menu in the Start / Program Files menu.
* Quincy was modified so that it would work when installed in a path with a
space character. In addition, the settings are now stored in an INI file,
which resides in the same location as the Quincy.exe file. I prefer INI
files, because they allow multiple installations of a program (in different
directories) with different configurations.
* The modifications done by Allen Cronce for the Mac OS-X port were merged with
the main sources. Apart from the port, the modified source code also features
bug fixes related to the Endianness of the debugging information, so it is
relevant to all users of Big Endian architectures (and who wish to use the
debugger).
Version 3.1, build 3522
-----------------------
* Quincy, a C++ IDE written by Al Stevens and published in Dr. Dobb's Journal,
is now adapted for Pawn. This is a Windows IDE, featuring an editor and a
debugger.
* Remote file uploading functionality in the Pawn debugger (for hosts that
support remote debugging).
Warning: For remote debugging, port 1 now refers to COM1 in Windows (and
ttyS1 in Linux); in previous releases you had to select port 0 for COM1.
* State variables are now available. Just like local variables have a
function-local scope, state variables have a scope restricted to a state
(or a set of states) --but they may be used across functions that implement
that state. The documentation is up to date.
* Keyword "state" is now also an operator; it returns "true" if the automaton
is in the indicated state.
* Macro-instructions for common repeated sequences, for more compact code and
quicker execution. The new compiler option "-O" sets the optimization level.
The JIT does not support these macro instructions, and scripts that may need
to run on the JIT must therefore be compiled with -O1 (standard optimization),
which is also the default setting.
* Support for re-entrant events in handling the "sleep" instruction.
* Added a delay() routine in amxTime.
* Added file matching and counting routines: fexist() (replaces the old
exist() function) and fmatch(). These routines allow wild-cards, similar to
those in the Unix shells.
* The Path to the XSL stylesheet is now stored into the report, and the
stylesheet information is embedded in the XSL file. The generated report can
therefore be viewed directly (with a browser).
* Dynamically loaded extension modules are looked up from the path in the
"AMXLIB" environment variable. This is especially useful for applications
that have a "plugins" directory, for contributed extensions in the form of
Pawn extension modules.
* There is improved support for compiling scripts for execution from read-only
memory.
* Native and public functions can be marked "depricated", to help upgrading to
new scripting environments.
* To avoid a frequent error: (typing) error in the name/signature of a public
function, the compiler now issues a warning if no forward declaration exists
for a public function. The idea is that the (implicitly included) include
file that the host application supplies, contains forward declarations for
all public functions.
Warning: this may require that you add forward declarations to existing
header files.
* The BinReloc package used for Pawn is now version 2.0 (see
www.autopackage.org). This package allows the Pawn compiler to be installed
in any path; it will always find the required include files in directories
that are relative to the path to the executable.
* The compiler uses strlcpy() and strlcat() as safe alternatives for strncpy()
and strncat(). As not all compilers include these functions in their C
library, the source code comes with standard implementations in the file
lstring.c.
* Fixed several bugs related to the order in which automatons were used and
declared.
* BUG fix: the generated code for the entry function (state machines, or
"automatons") had the wrong stack convention.
* Minor corrections in macros (for masking absence of terminal support) in the
console support (amxcons.c).
* BUG fix in strmid() concerning short destination strings.
* BUG fixes in the string packing routine (used a.o. by strcat()).
* CMakeLists.txt for the compiler: minor path-related fix
* BUG fix in amxjitsn.asm, where the JIT code was split into two different
sections for no good reason (probably predating the "mprotect" support code
in amx.c). Bug reported and fixed by David "BAILOPAN" Anderson.
* BUG fix: arrays used in logical expressions were not check for full indexing
(as they should). Specifically, after declarating "new series[10]" an
expression like "if (series || 0)" would compile without errors. Bug
reported and fixed by David "BAILOPAN" Anderson (my fix is somewhat
different, to catch more cases).
* BUG fix: the #error directive ignored the parsing state, so an #error
directive folded inside #if 0 ... #endif still fired. Reported by "chop".
* BUG fix: the tagof operator used as a default value for function arguments
took the tag of a variable, but not of an expression. Reported and fixed by
Jonathan on the Pawn forum.
* BUG fix in recursion detection.
* BUG fix for the sleep opcode: the STK and HEA registers were not updated in
the AMX structure (ANSI C and GNU C versions only; the assembler versions
were correct). Reported and fixed by "chop".
* BUG fix: the "JIT" flag was erased under specific conditions in amx_Init().
* BUG fix: memory block for the JIT code must be aligned under Linux.
* BUG fix: structure packing was incorrect for GCC. Also removed "far"
pointers from the definitions of the debug structures.
* Warning: The fixed point function fixedstr() is renamed to strfixed() to be
in line with the string functions strval() and valstr(). Similarly,
floatstr() is renamed to strfloat().
Change log for older releases
-----------------------------
28/07/2005 BUG fix for the "switch" opcode in the JIT, in the situation
where only the "default" case was present (no other
cases, which means that the switch was actually
redundant). This bug found and fixed by Bailopan, and
reported on the Pawn forum.
BUG fixes for debugging symbols in 64-bit mode, found and fixed
by Bailopan and reported on the Pawn forum.
Fixes in the CMakeList.txt file for compiling under Linux/UNIX.
22/07/2005 The compiler has native support for states and automatons.
Implementing finite state machines is thereby easier,
and the compiler helps in checking that the state
machine is coherent. See the language guide for details.
Several bugs related to arrays and enumerations have been
fixed. Some of these bugs were (also) reported by
Vic Viper on the forums.
Yet one more Big Endian bug was found and fixed.
Robert Daniels found and fixed a problem related to
3-dimensional arrays with a variable last dimension.
His fixes have been merged in the main source.
A 64-bit bug found by Bailopan was fixed. Compact Encoding
should now also work with 64-bit cells.
There are three new native function modules: one with string
manipulation functions, one with simple network packet
exchange functions and one with time/date functions.
A general purpose way to accept event sources has been
implemented in the "pawnrun" example program and in
several of the native function libraries. With this
interface, a native function library can "register"
a public function that it will call upon a specific
event. See pawnrun.c and the modules "amxCons.c"
(@keypressed) and amxTime.c ("@timer") for details and
examples.
The debug protocol has changed completely. The old debug opcodes
are replaced by a single new opcode: BREAK. The debug
information is now appended to the AMX file, instead of
being intermixed with the normal opcodes. The rationale
of the new design is improved performance when running
scripts with debug information, and the ability to
do remote debugging.
The console debugger has been enhanced to support states and to
allow debugging over a serial line (RS-232), provided
that the host application supports the protocol too.
The screen lay-out was improved as well.
The Linux compiler now uses the BinReloc package from
www.autopackage.org to locate the include files and the
configuration file. This should be more robust than the
earlier hack.
The peephole optimizer was improved. After finding an
optimization, it now recurses over all rules to find
(more) optimizations on the adjusted code.
Documentation comments have been improved (and now include the
automatons and the transitions). The lay-out has been
improved as well.
New #pragma "amxlimit" lets the compiler verify that the script
fits the abstract machine after compilation. This is
useful for embedded devices with little memory for
scripts.
18/03/2005 Small is renamed to Pawn. Changing the name has been requested
regularly, by various individuals, because searching
for information on the "small" scripting language (on
the Internet) was not exactly easy. The word "Small"
is fairly common. The new name, "Pawn" should improve
the odds that when you search for "Pawn scripting",
you will get information on the language. Together with
the product name, names of utilities and executables
changed as well.
Warning: when your host application relies on the name
of the compiler to be "sc.exe" or "sc", you must either
rename the executable after it is built, or you must
adjust your host application to run "pawncc.exe" or
"pawncc" instead.
The compiler is now built as a shared library/DLL. The compiler
command line program is now just a driver for the
library (except for the 16-bit version of the compiler).
The abstract machine can now support the JIT and the assembler
core together. In earlier releases, you had to choose
for either the JIT or the assembler core. As the JIT
does not support the debugging hook, the new scheme
allows you to build the abstract machine such that you
debug your scripts using the assembler core and run the
final version using the JIT.
Warning: the initialization of the JIT has changed (but
only slightly). Host applications that use the JIT must
set the AMX_FLAG_JITC flag before calling amx_Init().
16/03/2005 BUG fix: when introducing version 7 of the binary file format
I accidentally accessed the binary file directly instead
of passing through sc_resetbin(). This made in-memory
compilation impossible.
12/03/2005 BUG fix: declaring a global array variable with a symbolic
constant (for the array size) before that symbolic
constant is defined itself, could result in a hang
(or a significant compilation delay).
Documentation fix: the documentation for enumerations in
relation to explicit tags and array indices was
incorrect.
Global variables may now be declared both public and stock.
Functions must still be either public or stock (or
neither); note that there is not much use for public
stock functions, as functions can be "forward declared"
and variables cannot.
28/02/2005 The debug information format and the debug hook have changed
dramatically. The existing 5 opcodes for the debug hook
FILE, LINE, SYMBOL, SRANGE and SYMTAG are now redundant,
and replaced by a single new opcode: BREAK. Other
opcodes that previously called the debug hook, such as
CALL, RETN, and STACK, no longer call the debug hook.
The information for (local and global) variables is no longer
mixed in the executable code, but now appended to the
file in a separate chunk. There is a new component,
amxdbg.c, with functions that parse the debug
information and can look up functions, line numbers and
variables, given an address.
Warning: all code that uses a debugging hook must be adapted.
The new debugging hook strategy has the following
advantages:
- the debug hook can be set up on an "as-needed" basis:
when you want to break out of a "hung" script, you
can set up a debug hook while the script is still
running;
- even with the debug hook installed, the hook is a lot
quicker because there are less opcodes that call the
hook and the amount of data that needs to be parsed
and passed on is lower;
- the presence of debug information does not influence
the performance of the script execution as much (but
scripts without debug information and bounds checking
will still run quicker that those with those checks);
- the new method is more suitable for remote debugging,
especially over slow links.
There is also a disadvantage (apart from increased
complexity of the debugger and the compiler): when an
assertion fails it only gives the code address of
failure --to get the matching file & line number, you
need to look them up using the debug information.
22/02/2005 The estimate of stack usage has become more precise. In the
older version, the estimate could be too low, because
stack usage due to parameter passing was not taken into
account.
The XML report (script documentation) was enhanced with a list
dependencies for each function; the dependency
information is the inverse of the referral information.
17/02/2005 The method of passing parameters to public functions has
changed. In the past, these were passed to amx_Exec();
when arrays or strings had to be passed, you had to
allocate space, copy the array/string and release the
space after amx_Exec() returns. In the current method,
there are the functions amx_Push(), amx_PushArray() and
amx_PushString() which you call before calling
amx_Exec(). The required data is allocated and copied
implicitly; you must still release the allocated space,
however.
Function amx_Execv() is now gone, as there is no more use for
it.
The 16-bit version of the AMX DLL (AMX16.DLL) now has all
functions as "FAR PASCAL" (which is standard), rather
than "__cdecl". The 32-bit version of the AMX DLL
(AMX32.DLL) declares the exported function amx_Exec()
now as "__stdcall". This should be transparent to the
compiler.
8/02/2005 Support for the JIT in FreeBSD and OpenBSD is improved. A few
fixes were implemented. These were reported by Laurent
on the Small forum.
Merged in changes by Allen Cronce, for the support for Mac-OS.
The project file for Metrowerks Codewarrior was updated
as well.
4/02/2005 BUG fix: there was an incorrect assertion in the parser which
would break an expression like "a[0] = a[1] = a[2] = 0"
(unless you build the Small compiler without
assertions). This bug was reported by "kexz" on the
Small forum.
BUG fix: a self-assignment warning was issued in a special case
of an assignment of an array element into another
element of the same array. This bug was reported by PM
on the Small forums.
BUG fix: 64-bit support used the wrong shift counts in
generating byte offsets from cell offsets. This was
reported by BAILOPAN on the Small forum.
Better portability to 64-bit cells, for example by storing the
full 64-bit function pointer to a native function in
the internal native function table. P-code files with
a 64-bit cell size have a different "magic" value
(or "signature") in the header. Most of these
modifications were described by BAILOPAN on the Small
forum.
BUG fix: the peephole optimizer could not handle long symbol
names (i.e. over 21 characters) for local variables.
This bug was reported by BAILOPAN on the Small forum.
BUG fix: constants passed into functions that accept a variable
argument list (such as printf) caused a crash. This bug
was also reported by BAILOPAN on the Small forum.
BUG fix: when a field in an enumeration had the same name as
another symbol (name conflict/symbol redefinition), the
compile crashed instead of reporting the error. This
bug was reported by "Stu" on the Small forums.
31/01/2005 BUG fix: the implementation of the "SWITCH" opcode in the
abstract machine would not work correctly when a cell
is 16-bit. This bug was reported by "chop" on the
Small forum.
BUG fix: in AMXJITSN.ASM (the JIT compiler in NASM format),
one symbol was incorrectly exported, which made the
file produce a linker error when used with GCC on
Cygwin. This bug was reported by Laurent on the Small
forum.
BUG fix: in amx_Execv(), the number of parameters was forwarded
to the main function amx_Exec() in a way that was
incompatible with 16-bit architectures. This was
reported by Pierre de Vos, who is porting Small to the
Atmel ATmega128 controller.
18/01/2005 Corrections merged from Embryo, the adaption of Small from the
Enlightenment team.
The command line parsing in the Small compiler was modified to
be more flexible (and perhaps slightly more conforming
to what is common with GNU programs).
A simple "script arguments" native function library was
developed. This library provides general purpose
"command line argument" parsing functions. It is
somewhat in between of argc/argv and the getopt()
library.
A few bugs were fixed in the Microsoft Windows "terminal",
especially related to scrolling and resizing.
BUG fix: in the "switch" statement was fixed a bug would occur
if an expression between the parentheses of the switch
had a side effect. This bug was reported on the Small
forum by Lajos Molnar, and analysed by BAILOPAN.
The NASM version of the assembler core of the abstract machine
would not assemble under Cygwin. This has been fixed.
The error was reported by Lexx on the Small forum.
BUG fix: the "#pragma unused" directive did not accept symbol
names with digits, underscores or "@" characters. This
bug was reported by "chop" on the Small forum.
3/01/2005 The pre-build LIBSC DLL was missing an export, making the DLL
unuseable (you would have to rebuild the DLL to use it).
The self-installing setup had the version number wrong (it still
said 2.5).
The README.TXT was not up to date. The version packed in the
product came from a different directory than the one
I kept up to date.
There is a #section directive that hides all symbols declared
"static" (the #section directive simulates a file
switch). This was low on my wish list, but a recently
introduced feature in the compiler required it.
22/12/2004 The JIT-compiler was translated to NASM by G.W.M. Vissers. This
makes the JIT available in Linux, and probably other
Unix-like operating systems. The port was initially done
for the free MMORPG "Eternal Lands" (by a member of the
team of the game).
Modifications for better support of FreeBSD and OpenBSD.
The Small compiler now allows multiple source files on the
command line. The compiler combines all sources to
build a single output file.
Improved the report file and the ability to extract
"documentation comments". The toolkit now comes with
a matching XSL file and an accompanying stylesheet.
These allow the report file to be directly readable in
a web-browser.
Constants that are part of an enumeration are now flagged as
such, this those constants to be grouped with the
enumeration definition in the report (XML documentation).
The argument comparison for forwardly declared functions (with
the actual implementation) was improved.
The tags of array indices are also now checked for arrays passed
as arguments to functions.
I increased the maximum number of function arguments to 127 (it
was 64, and this turned out to be too little for some
users!).
BUG fix: an object code generation flaw in the Watcom C/C++
compiler caused the abstract machine to crash after
calling a native function for the second time. The code
generation problem has be circumvented by rewriting the
expression to do exactly the same thing in a slightly
different way.
There is a GraphApp terminal as an example terminal. This
terminal supports UTF-8 natively. It also supports
wide characters, if compiled as such. Look at
http://enchantia.com/software/graphapp/ for information
on the cross-platform library GraphApp.
The DLL versions of the abstract machine (AMX16.DLL and
AMX32.DLL) now use the "termwin" terminal, which allows
for font scaling and coloured text.
BUG fix: the NASM version of the abstract machine core did not
set the "debug event code" on a "line" event.
The documentation was improved, especially regarding compilation
on Linux and Unix-like platforms. There is a new section
on CMake, a cross-platform "makefile" generator utility.
22/07/2004 Functions can return arrays. The size of the array that is
returned must be fixed (functions returning
variable-length arrays are not supported).
The warning "function uses both `return' and `return <value>'"
is now an error.
The compiler writes extra information related to the
declarations of constants, variables and functions to
the report file, and it now also supports documentation
comments. The toolkit comes with an XSL stylesheet to
create a HTML file from the report file (which is in
XML format).
25/06/2004 Warning messages can be disabled individually (compiler option
-w).
I added the makefiles for FreeBSD contributed by Raphael
Raimbault to the standard distribution. In general,
FreeBSD support has been improved.
Adam D. Moss contributed a modified version of the makefile
for the abstract machine for Linux. If have called this
"makefile.linux" (because it seems more complete) and
my original "makefile_asm.linux" (because my version
compiles the assembler implementation of the core
executive).
Arrays whose size is declared with an "enum" symbol now allow
initialization by field size. In addition, the "sizeof"
and "tagof" operators look at the size and tag of the
enumeration element. This allows Small to mimic (simple)
structures with arrays.
BUG fix: when generating debug information, the compiler still
assumed that it was always writing to file (instead of
possibly writing to memory).
Two new preprocessor directives: #error, which is similar to the
same directive in C/C++, and #tryinclude, which fails
silently if the include file cannot be found.
26/03/2004 Expressions in preprocessor directives were not preprocessed
themselves. A bug found by "SniperBeamer".
The "#elseif" directive was (finally) implemented. It allows
you to chain conditionally compiled sections more
easily. Note that in contrast to C/C++, it is called
"#elseif", not "#elif".
A few modules for the abstract machine are enhanced for Unicode
and UTF-8 support.
In AMXCONS.C, create the terminal "late", meaning that if a
script does not use a terminal, it does not pop up.
Better support for having an abstract machine that uses both
fixed and floating point calculations. The format
string of the native printf() function uses %f for
floating point, %q for fixed point and %r for either
floating point or fixed point (if floating point is
not available).
A new include file "rational.inc" allows you to write a script
using "rational numbers" and leave it to the abstract
machine as to whether this means "floating point" or
"fixed point".
25/03/2004 Fixed a syntax problem where the conditional operator
interferes with tagnames, in an expression like:
new bool:a=(b<10)?true:false
Here "true:" is seen as a tagname, rather than as the
second part of the "? :" operator. Adding whitespace
fixes the matter, of course. The expression:
new bool:a=(b<10)?true : false
gives no problems.
The current compiler requires that tagnames in a
conditional expression appear between paranteheses,
like in:
new plain:a=(b<10)?(plain:true):(plain:false)
This bug was found by "PM", who posted it on the Small
forum.
Names of native functions were still truncated to 19 characters
even though the new binary file format no longer
imposes a length restriction on external names. This
limit is now removed. Another bug found by "PM", and
posted on the Small forum.
The logical operators did not force the tag to "bool:" (which
they should, according to the documentation).
A few type-casts were added, to allow the source to be compiled
as C++ source.
15/03/2004 The file SCLIB.C, that compiles the "Small compiler" to a
single object file for embedding into an application,
was updated to include the new files. At the same time,
it was renamed to LIBSC (for conformance with Linux).
In addition, the library file can now be compiled as a
DLL (without needing a change in the source code) and
the DLL supports the functionality required by
RUNDLL32.EXE.
The example "SRUN" files (implementation examples for the
abstract machine) have been cleaned-up a bit and
another example, for the JIT compiler was added. The
function amx_InitJIT() is now finally documented.
The syntax for declaring an increment for a constant in an
enumeration has changed. The old syntax:
enum {
first : 10,
second : 5,
}
has become:
enum {
first[10],
second[5],
}
I need this changed syntax for a new feature that I
intent to implement. In addition, I have accidentally
used the new syntax on various occasions, so it may
be more intuitive than the old syntax.
3/3/2004 I added a -v switch to the compiler to set the verbosity. For
the moment, this does not change much: -v0 disables the
copyright banner and -v2 displays extra stack/heap
usage information; -v1 is the default.
The declaration and initialization of simple variables (single
cell) to constant values is significantly optimized:
from 3 opcodes to one opcode. This makes declaring a
new variable a light-weight operation.
29/02/2004 The maximum number of dimensions for arrays has been increased
to 3. Hopefully, increasing it further now involves no
more than changing a constant.
As an example for how the Small abstract machine can be
extended, I have added a simple general purpose garbage
collector in a separate C file (AMXGC.C). The
"Implementor's Guide" discusses the interface and gives
an example of use, using the "Better String library"
(http://bstring.sourceforge.net/) for creating the
"garbage".
Basic support for UTF-8 is now also in the abstract machine.
The new functions amx_UTF8Get() and amx_UTF8Put()
extract or store a single (wide) character in UTF-8
encoding. The new function amx_UTF8Check enables you to
verify whether some input string is in valid UTF-8.
All functions return an error code. All functions use
a strict interpretation of the UTF-8 syntax.
23/02/2004 The compiler is now able to translate "extended" ASCII files
(i.e. 8-bit ASCII) to Unicode by using a codepage
mapping file. Only characters in unpacked strings or
in character constants are translated. Appropriate
mapping files can be found on
ftp://ftp.unicode.org/Public/MAPPINGS/.
In the compiler, the option "-c" no longer sets the
character size (there were bugs in this setting, so
I doubt that anyone ever used it). It now sets the
codepage for translation.
Robert Daniels provided fixes for bugs related to Big Endian
processors (I introduced these new bugs when adding
the "symbol names" table to the header in the AMX file
format.
Robert Daniels also gave a fix for an error that has been in
the toolkit much longer: several core functions had
to peek/poke into the data section of an abstract
machine, but they did not take the possibility of
"cloned" abstract machines into account.
17/02/2004 The parser stack is now "growable". In earlier releases it had
a fixed size.
A memory leakage was fixed; the leakage was related to a double
declaration of a native function.
The compiler now accepts UTF-8 files on input. It translates
non-ASCII characters (that are encoded in UTF-8) to
Unicode characters in unpacked strings. See the manual
for details.
The compiler allows character codes to be entered with a
hexadecimal escape (in addition to the existing decimal
escape): '\x82' is the same as '\130'.
Unicode support uncovered a few bugs in the handling of unpacked
strings in the "core" and "console" modules: checking
whether a string is packed or unpacked did not work for
characters above 255. This is now fixed, and it also
led to a new predefined constant in the compile:
"ucharmax".
The LINE opcode now allows a debug hook function to cause the
program to "sleep". Previously, a "sleep" mode could
only be started from a native function or via the
"sleep" statement of the Small language.
5/02/2004 For arrays with 2 dimensions, the major dimension no longer
needs to be explicitly specified when there are
initiallers. The compiler can now count the number of
items itself.
"Johnny got his gun" reported the bug that the compiler signals
the expression "var = !var" as a self-assignment. This
bug applied to most unary operators. (It is now fixed.)
A new extension library (native function library) comes with
the toolkit: file input/output. Text files (plain ASCII
and UTF-8) and binrary files are supported.
There is a new terminal implementation: "termwin". This
terminal emulates a console on Microsoft Windows; its
primary feature is that you can have several of these
consoles at the same time and that it supports Unicode.
For the purpose of Unicode, the functions amx_GetString() and
amx_SetString() got an extra parameter, for interpreting
the source or destination string (on the "C" side) as
a "wchar_t" string.
Anthalir gave an update to the FreeBSD support. His changes
were merged into the main branch.
16/01/2004 When you compile with option -d2, the compiler now gives you
an estimate of stack/heap usage. Even without this
option, the compiler will warn you when the stack/heap
area is too small. The stack/heap determination does
not work in the presence of recursive functions.
When you do not use the return value of a function, you mostly
do not need to enclose the function's arguments in
parantheses. That is, the snippet below is now a valid
Small program:
-----------------------------------------------------
main()
printf "Hello world\n"
-----------------------------------------------------
The manual has been updated to use this "friendlier"
syntax where possible.
The RET and RETN opcodes of the abstract machine now check
whether the "return address" (on the stack) lies inside
the code segment. This makes buffer overrun exploits
much less likely (perhaps impossible). This address
check is also done in "no debug" mode (unlike array
bounds checking, for example).
Opcode SYSREQ.D is now fully implemented. When calling a native
function, the "callback hook" function looks up the
function address. If it has found it, it may store this
address in the code stream and change the opcode from
SYSREQ.C to SYSREC.D. The SYSREQ.D calls the native
function directly, avoiding any overhead from the
callback hook.
9/01/2004 The compiler generates the intermediate (assembler) file in
memory. This is faster and cleaner: compiling a .AMX
file now no longer overwrites (and deletes) the .ASM
file, if one exists.
When you do not use the result of a function call, you may now
omit the parantheses around the function's parameters.
That is, you can say:
printf "Hello world\n"
This syntax may make Small source code a little
friendlier to read, especially for novice users.
The changes of FUTURE Interactive, to support a 64-bit cell,
were merged into the main branch.
30/12/2003 I switched to the zLib license for the toolkit. The original
license was already quite similar to the zLib license,
and in retrospect, the clauses that I added are not
very useful.
I changed the regression test suite to a REXX script (instead
of the older DOS "batch" file). REXX is available on
many platforms, so I hope that the regression suite
will be more useful to those users that do not run
Microsoft Windows (or DOS). By the way, I use Regina
REXX (see http://regina-rexx.sourceforge.net/).
19/12/2003 Søren Hannibal proposed the use of a private implementation
for strdup(), to make it easier to use other memory
allocators (than standard malloc()).
More options for fixed/floating point value formatting in the
printf() function (width/number of decimals)
The console functions (AMXCONS.C) were redesigned and now have
improved VT100 & Win32-console support. New native
functions are gotoxy(), wherexy(), clreol(), clrscr()
and setattr().
The toupper() and tolower() from the "core" library now also
work with accented characters using ANSI fonts
(Microsoft Windows).
New opcodes SYMTAG and SYSREQ.D. SYMTAG is for the debugger,
it allows a debugger to choose a display format based
on the "tag" of a symbol. (It was added mostly for
displaying fixed/floating point values.) SYSREQ.D is
to optimize the performance of native function
callbacks.
The ".AMX" file format changed: it now has a separate "symbol
name" table, so that the name length limit of 19
characters for "public" or "native" symbol names no
longer applies. The run-time (AMX.C) reads modules
with the previous file format as well. The compiler
only generates files in the new format, though.
The file header is now also padded to the requested "symbol",
alignment. This way, the code and data sections are
also automatically aligned to the chosen alignment.
The Small debugger now uses the console functions in AMXCONS.C
for output. This gives (almost) automatic recognition
of the proper "terminal" support. The debugger is also
improved in its display of fixed/floating point values.
Hard limits (number of files, number of breakpoints,
number of watches) have been removed.
24/11/2003 The preprocessor was "fixed". One problem were various match
and replacement errors (for parametrized macros),
another problem was its slow operation.
There were "tag mismatch" errors related to the user-defined
assignment operator. These have been fixed.
AMX.C now contains various conditionally compiled sections. If,
for example, you only need to call the function
amx_Register() from an extension module, you can save
of 10 kBytes of code by compiling AMX.C with the macro
AMX_REGISTER defined. This strips out all other
functions in AMX.C.
The floating point support module got a few more native
functions: floatsqroot(), floatpower(), floatlog(),
floatsin(), floatcos(), floattan() and n_floatabs().
In addition, I documented the floating point support
in an "application note" (just like the fixed point
library).
20/11/2003 The fixed point module was corrected to have accurate rounding
behaviour; for example 2.0 / 3.0 now is 0.667 instead
of 0.666. These rounding rules apply to both the
multiplication and the division operators and functions.
The documentation for the fixed point library is now
separate from the "user manual". In addition, I added a
power, a square root and an absolute value function to
the library (plus a useful "multiply, then divide"
function which avoids loss of precision in the
intermediate result).
Another error was also fixed in the library: the ANSI C version
of fixed point multiplication was prone to an
intermediate overflow bug. (I didn't catch this bug
earlier, because for most compilers there is an
optimized version for this function that uses 64-bit
arithmetic.) In addition, there are a few minor
corrections in the include file.
10/11/2003 In AMXCONS.C, I changed the definition of getstring() so that
the buffer size is now in "cells" rather than
characters. In practice, this makes it much easier to
use getstring(). It is, however, not compatible with
earlier releases.
5/11/2003 AMXCONS.C, the example "console" interface was extended with
an improved ANSI/VT100 terminal support and a native
Win32 console interface. New native functions are:
clrscr() clear screen
clreol() clear up to the end of line
gotoxy(x, y) set text cursor position
setattr(f, b) set foreground and background colours
I added a check for invalid "AMX" addresses in the
amx_StrParam() macro, to "fortify" native functions
against tampered ".AMX" files.
The new function amx_StrError() gives a descriptive error
string for an error code.
Frank Condello updated the project files for CodeWarrior, to