svn commit: r1485 - in trunk/yasm: libyasm modules/preprocs/nasm/tests

peter at tortall.net peter at tortall.net
Fri Apr 14 21:06:48 PDT 2006


Author: peter
Date: Fri Apr 14 21:06:44 2006
New Revision: 1485

Added:
   trunk/yasm/modules/preprocs/nasm/tests/nasmpp-bigint.asm
   trunk/yasm/modules/preprocs/nasm/tests/nasmpp-bigint.errwarn
   trunk/yasm/modules/preprocs/nasm/tests/nasmpp-bigint.hex
Modified:
   trunk/yasm/libyasm/coretype.h
   trunk/yasm/libyasm/expr.c
   trunk/yasm/libyasm/intnum.c
   trunk/yasm/libyasm/intnum.h
   trunk/yasm/modules/preprocs/nasm/nasm-eval.c
   trunk/yasm/modules/preprocs/nasm/nasm-eval.h
   trunk/yasm/modules/preprocs/nasm/nasm-pp.c
   trunk/yasm/modules/preprocs/nasm/nasm-preproc.c
   trunk/yasm/modules/preprocs/nasm/nasm.h
   trunk/yasm/modules/preprocs/nasm/nasmlib.c
   trunk/yasm/modules/preprocs/nasm/nasmlib.h
   trunk/yasm/modules/preprocs/nasm/tests/Makefile.inc
   trunk/yasm/modules/preprocs/nasm/tests/ifcritical-err.errwarn
Changeset:
   http://www.tortall.net/projects/yasm/changeset/1485

Log:
Change the NASM preprocessor to use yasm_intnum and yasm_expr.  This
decreases bloat and more importantly makes it possible to use >32-bit values
in the preprocessor.

This has NOT been heavily tested, so there may easily be bugs.  I've not yet
decided whether to merge this to 0.5.0 final for this reason.

Inspired by: Jason Chen <jchen at centtech.com> patches to use "long long"
rather than "long" in the preprocessor to enable >32-bit values.

* coretype.h (yasm_op): Add XNOR, LXOR, LXNOR, LNOR.
* intnum.c (yasm_intnum_calc): Calculate the above.
* expr.c (expr_is_constant, expr_can_destroy_int_left)
(expr_can_destroy_int_right, ...): Actually handle logical operations,
including the new ones.

* intnum.c (yasm_intnum_get_str): New; gets a signed decimal string
representation of an intnum.
* intnum.h (yasm_intnum_get_str): Prototype.

* nasmlib.c (nasm_strcat): Change parameters to const.
* nasmlib.h (nasm_strcat): Update prototype.

* nasm-preproc.c (nasm_preproc_input): Close a memory leak.

* nasm.h: Clean out a lot of cruft we don't use.
(tokenval): Change t_integer and t_inttwo to yasm_intnums.
(evalfunc): Remove fwref and hints parameters (cleanup), change return value
to yasm_expr.
* nasm-eval.c: Massively rewrite to just call appropriate yasm_expr creation
functions rather than calculating the value here.  Overall recursive descent
parsing structure is unchanged.
* nasmlib.c: Remove a lot of now-unused functions.
(nasm_readnum): Use yasm_intnum functions and return that.
(nasm_readstrnum): Likewise.
* nasmlib.h: Update prototypes.
* nasm-pp.c: Change to use intnum/expr as necessary.
* nasm-preproc.c (nasm_preproc_destroy): Don't call nasm_eval_cleanup,
it's been deleted.

* nasmpp-bigint.asm: New test for >32-bit preproc values.
* ifcritical-err.errwarn: The new code doesn't generate a duplicate warning.



More information about the yasm-cvs mailing list