Commit graph

9 commits

Author SHA1 Message Date
Peter Johnson
4df9f87323 All Pyrex files: Use __cinit__ instead of __new__ in extension classes.
svn path=/trunk/yasm/; revision=2254
2010-01-01 20:52:25 +00:00
Peter Johnson
0c344700a7 Massive Python/Pyrex wrapper cleanup. We now use Pyxelator to generate
the C function and data structure wrappers for Pyrex.  We now require
Pyrex 0.9.5 to build the Python wrappers, as only >=0.9.5 has working
weakref support.  We actually need 0.9.5.1, but it's not yet released
(0.9.5 has a crash bug in enum wrapping that we trigger).

Pyxelator works a lot better with non-anonymous enums/structs, so libyasm
has been scrubbed for this.

Next step: full Yasm data structure inspection.

svn path=/trunk/yasm/; revision=1745
2007-01-29 03:32:37 +00:00
Peter Johnson
9ab89fdfe6 Take [1423] to the next logical step by supporting the general case of
(sym in other section)-(sym in this section) rather than just
(sym in other section)-(curpos) (e.g. sym-$).  Unfortunately supporting
this required precbc to be flowed down to the value_finalize functions,
but it's relatively reasonable to do so, as all of the _finalize() routines
have access to precbc.

Reported by: Peter Tanski <peter_tanski@cox.net>

svn path=/trunk/yasm/; revision=1705
2006-12-10 07:05:06 +00:00
Peter Johnson
ad687bb34a Get rid of origin_prevbc; it's no longer needed due to yasm_value handling
of PC-relative values.

Add new yasm_value_get_intnum(); this is a simplified variant of
yasm_value_output_basic().

svn path=/branches/new-optimizer/; revision=1560
2006-06-10 04:01:12 +00:00
Peter Johnson
a7b6526ea4 Get rid of calc_bc_dist_func, the only times this was used was when
yasm_common_calc_bc_dist was used.  Rename yasm_common_calc_bc_dist to
yasm_calc_bc_dist, call it directly from the expr functions, and change
higher-level callers to boolean flags of whether to calculate bc distance
or not.

svn path=/branches/new-optimizer/; revision=1550
2006-06-07 04:01:33 +00:00
Peter Johnson
83c0ecaaec * coretype.h (yasm_value): Add size field (specified in bits).
(yasm_value_output_func): Remove valsize and shift parameters.
* bytecode.h (yasm_effaddr): Remove disp_len, replacing with
need_nonzero_len.
(yasm_immval): Remove len.
* value.h (yasm_value_initialize): Add size parameter.
(yasm_value_finalize_expr): Likewise.
(yasm_value_output_basic): Remove valsize and shift parameters.

Update all implementations and users for the above.

* intnum.c (yasm_intnum_calc): Fix bug in shift right (was doing a logical
instead of arithmetic shift).

* lc3b-basic.asm, lc3b-basic.errwarn, lc3b-basic.hex: Update based on
fixed warnings.

svn path=/trunk/yasm/; revision=1534
2006-05-10 08:54:52 +00:00
Peter Johnson
949965d5cb * pyrex.m4: Add a little documentation.
* setup.py, yasm.pyx, *.pxi: Add copyright/license.

svn path=/trunk/yasm/; revision=1458
2006-04-04 08:06:39 +00:00
Peter Johnson
549534bc03 * value.pxi, expr.pxi: Copy instead of NULL'ing origin; this will look much
more pythonic on the python side, although it will cause much additional
object churn, and will not be fast.

svn path=/trunk/yasm/; revision=1453
2006-04-03 04:54:27 +00:00
Peter Johnson
5f284d738c python-yasm: Modularize and clean up. Note the modularization is a little
bit broken: you need to remove yasm.c before running python setup.py build
or the pyrex step may not actually run.

svn path=/trunk/yasm/; revision=1450
2006-04-03 04:32:25 +00:00