Peter Johnson [Sun, 6 Oct 2002 19:43:51 +0000 (19:43 -0000)]
Make output endian-tolerant by making intnum and floatnum output functions for
arch. This will also simplify other objfmt expr output functions. Change
file functions to use bits instead of byte/short/long, and create both little
and big endian versions. This name change caused changes in several other
files.
Peter Johnson [Sat, 5 Oct 2002 06:00:37 +0000 (06:00 -0000)]
Undo part of the tools/re2c flattening. Specifying a re2c_CFLAGS causes
automake to automatically prepend re2c- to all generated object files,
eliminating the main.o conflict. Also, it prevents extended compilation flags
from applying to the re2c build.
In Makefile.am, also allow automake to automatically include the autoconf
conditionally-included files strsep and mergesort.
Peter Johnson [Fri, 4 Oct 2002 07:23:11 +0000 (07:23 -0000)]
Make test scripts more portable by detecting echo line-ending features, using
fewer options for sed, and using a perl script for hexdump. As a side effect,
hexdumps are more accurate (the hexdump util put * for as many multiples as
were output, whereas the perl script outputs a line for every byte, no matter
what).
Peter Johnson [Thu, 3 Oct 2002 19:08:13 +0000 (19:08 -0000)]
Create a common out_test.sh test script to be used by a variety of tests.
Rename objfmts/bin/tests/*.bin.hx to *.hex to fit better in the common usage.
Peter Johnson [Thu, 3 Oct 2002 19:02:53 +0000 (19:02 -0000)]
x86_bc_resolve_insn(): If x86_expr_checkea fails, return not only
BC_RESOLVE_UNKNOWN_LEN but also BC_RESOLVE_ERROR so that a spurious circular
reference detected is not output from the basic optimizer.
Peter Johnson [Thu, 3 Oct 2002 09:26:47 +0000 (09:26 -0000)]
Fix a major bug: after switching sections, prev_bc was always being set to
NULL, causing any labels at that point to point to the start of the section
instead of the current position!
Peter Johnson [Thu, 3 Oct 2002 09:16:11 +0000 (09:16 -0000)]
expr_level_op(): Pull up IDENT-EXPR as well as EXPR-IDENT subtrees.
expr_level_tree(): Call recursively after calling expr_xform_bc_dist instead
of just calling expr_level_op, which wasn't simplifying the whole tree
properly.
Peter Johnson [Tue, 1 Oct 2002 18:56:28 +0000 (18:56 -0000)]
Completely revamp how label resolution is done (part of Bug#6). Now calculates
/distances/ between bytecodes in a section using bc_calc_dist() functions (a
"typical" one is provided for most occasions). expr_expand_labelequ() is gone,
as its functionality is integrated into expr_simplify(). Currently these
changes break most bin objfmt output, as it doesn't know how to resolve
absolute labels yet. Also, very preliminary expr support for :, SEG, and WRT
operators has been added (part of Bug#2). Several other minor bug fixes.
Peter Johnson [Tue, 24 Sep 2002 18:35:51 +0000 (18:35 -0000)]
Rename intnum_new_int to intnum_new_uint, and add new signed version of
intnum_new_int. Currently only just calls intnum_new_uint with a cast, but
eventually there may be a better way of handling signed numbers.
Peter Johnson [Mon, 23 Sep 2002 06:16:59 +0000 (06:16 -0000)]
Move yasm core files into a libyasm shared library (avoiding backlinking).
Some cleanups still needed; a few things in globals should really be somewhere
else, or named differently.
Peter Johnson [Sun, 18 Aug 2002 03:48:17 +0000 (03:48 -0000)]
Eliminate duplicate code for callbacks from expr_expand_labelequ() by moving
code and adding a resolve_precall function parameter (which caused cascading
changes in bytecode-related sources).
Peter Johnson [Tue, 13 Aug 2002 05:56:39 +0000 (05:56 -0000)]
Finish remaining instructions (SSE, SSE2, Cyrix MMX). Changed CPU flags for
MMX/SSE2 to reflect that it's the MMX or SSE2 cpu feature, not the cpu family.
Peter Johnson [Sat, 10 Aug 2002 23:04:28 +0000 (23:04 -0000)]
Add checking of target modifier.
Change operand typing mask constants to be more uniform.
Increase operand type size to long from int, as it now can go over 16 bits.
Peter Johnson [Sat, 10 Aug 2002 18:18:59 +0000 (18:18 -0000)]
Added shift instructions, as well as new "postponed" actions for things such
as shift ,1 operands and imm operands that have sign-extended imm8 forms that
can't be decided at parse-time. The x86 bc format already had support for
these. Also fixed a bug in the lfs family (incorrect inst len).
Peter Johnson [Fri, 9 Aug 2002 05:43:03 +0000 (05:43 -0000)]
Massive restructuring of lexing and parsing (NASM-compatible parser).
Bugzilla Bug#3. Not all instructions are parsed yet, so this is actually a
minor feature regression from the user side, but this commit lays the framework
for much easier additions of new assembler syntaxes and architectures. The
re2c tool is now used to generate the lexers, as it's much more flexibly
function-oriented than lex.
- nasm-bison.y is a repocopy+modify of nasm/bison.y.in.
- x86arch.h now includes all of x86-int.h
Peter Johnson [Fri, 9 Aug 2002 05:22:07 +0000 (05:22 -0000)]
Flatten the tools/re2c build.
- Moved (by repocopy) main.c to re2c.c
- Moved (by repocopy) parser.y to re2c-parser.y
- Changed to Makefile.inc's rather than Makefile.am's
- Modified all the source file local includes to point to tools/re2c/*.h
Peter Johnson [Sat, 3 Aug 2002 03:40:51 +0000 (03:40 -0000)]
Remove .re.c suffix rule. In GNU make, this doesn't work as intended (instead
of making all .re -> .c builds require re2c (as a suffix rule), it instead sees
it as a rule to build ".re.c"). Oddly enough, in BSD make this works perfectly.
Peter Johnson [Mon, 24 Jun 2002 07:30:28 +0000 (07:30 -0000)]
Add configure.lineno to CLEANFILES. It doesn't delete itself or have something
else delete it, making distcheck impossible (the build directory isn't empty
after a distclean).