Peter Johnson
405df52913
bytecode_print(): Change how NULL values are output for imm and multiple.
...
bytecode_parser_finalize_insn(): Add some preliminary imm handling. Handle
shift_op special-casing (,1 hack).
svn path=/trunk/yasm/; revision=312
23 years ago
Peter Johnson
665eddf5d7
Conditional x* prototypes on !DMALLOC (as they're defined by dmalloc.h if
...
DMALLOC is enabled).
svn path=/trunk/yasm/; revision=311
23 years ago
Peter Johnson
79e945c33c
Optimize expression building a bit in expr_new() by eliminating IDENT's here.
...
This saves a lot of extra unnecessary recursions when the expr gets to the
simplification stage.
svn path=/trunk/yasm/; revision=310
23 years ago
Peter Johnson
ad7cbcea04
Add memory expressions tests (checkea).
...
Split off errwarn functions so that they can be overridden in test cases.
svn path=/trunk/yasm/; revision=309
23 years ago
Peter Johnson
00788fa80c
Fix errors found in expr_level_op() and checkea_calc_displen() by new test
...
cases.
svn path=/trunk/yasm/; revision=308
23 years ago
Peter Johnson
1d26b1de84
Fix directive memory leaks in a different way; the old way broke name/val
...
splitting.
svn path=/trunk/yasm/; revision=307
23 years ago
Peter Johnson
94730125be
Missed a free->xfree conversion.
...
svn path=/trunk/yasm/; revision=306
23 years ago
Peter Johnson
df933810ea
Previous commit broke ANSI C header checking (BAD). Fixed, by changing how
...
optional things are checked.
svn path=/trunk/yasm/; revision=305
23 years ago
Peter Johnson
50ff757dae
Update with changes made to source tree and configure options.
...
svn path=/trunk/yasm/; revision=304
23 years ago
Peter Johnson
10fa8fadc1
Correctly process 32-bit memory expressions in expr_checkea().
...
svn path=/trunk/yasm/; revision=303
23 years ago
Peter Johnson
305b471f51
On xfree(NULL), just return instead of triggering InternalError().
...
svn path=/trunk/yasm/; revision=302
23 years ago
Peter Johnson
4d95de5161
Plug memory leaks, and enhance finding later ones with *_delete functions.
...
Fix a *major* bug in expr_level_op().
svn path=/trunk/yasm/; revision=301
23 years ago
Peter Johnson
dc1c3c70f5
Get rid of all the extra filename strdup()'s. (Bug #14 ).
...
svn path=/trunk/yasm/; revision=300
23 years ago
Peter Johnson
7a6eaf8c03
Make InternalError() a bit easier to call. Also, reverse its file and line
...
parameters to match the *At() functions.
svn path=/trunk/yasm/; revision=299
23 years ago
Peter Johnson
6f708e3034
Add xfree() to replace calls to free().
...
This also fixes the build breakage caused by removing stdlib includes.
svn path=/trunk/yasm/; revision=298
23 years ago
Peter Johnson
adf5a95e89
Add option for malloc debugging using dmalloc library ( http://dmalloc.com/ ).
...
Remove unnecessary stdlib includes (because we use xmalloc instead of malloc).
svn path=/trunk/yasm/; revision=297
23 years ago
Peter Johnson
21c598f9f8
Put in temporary implementations of ErrorAt() and WarningAt().
...
svn path=/trunk/yasm/; revision=296
23 years ago
Peter Johnson
e7bab50cf2
Parse NOSPLIT.
...
Move some work to subfunctions in expr so they can be used for both 16-bit
and 32-bit checking.
svn path=/trunk/yasm/; revision=295
23 years ago
Peter Johnson
121f93b0a0
*COMPLETELY* rewrite most of expression handling.
...
Features:
- More complex memory expressions like [bx-(bx-di)] are now calculated through
as valid.
- Much better simplification.
Internal changes:
- More flexible n-way tree (rather than old binary-only).
- Many new functions to simplify and deal with very complex expressions.
svn path=/trunk/yasm/; revision=294
23 years ago
Peter Johnson
b76d2cd490
Add other Makefiles, supporting files to EXTRA_DIST.
...
svn path=/trunk/yasm/; revision=293
23 years ago
Peter Johnson
0a98a74163
Add mergesort() replacement from BSD sources.
...
svn path=/trunk/yasm/; revision=292
23 years ago
Peter Johnson
cdcf358af1
RCSID() breaks under DJGPP because of "__unused". Removing __unused shouldn't
...
cause any problems, really, so just removed it.
svn path=/trunk/yasm/; revision=291
23 years ago
Peter Johnson
d9ea939762
Add "very flat" (based on Makefile.flat) makefiles and config.h files for
...
DJGPP and Visual C++. These are build-only (not development).
svn path=/trunk/yasm/; revision=290
23 years ago
Peter Johnson
b7bbbd5b81
Prototype, very simple, flat Makefile for use in compiling (but NOT developing)
...
on other platforms.
svn path=/trunk/yasm/; revision=289
23 years ago
Peter Johnson
e640f25da5
Update comment on disp.len to match changes in expr.c.
...
svn path=/trunk/yasm/; revision=288
23 years ago
Peter Johnson
43c736c2d8
Add parser finalization check for undefined symbols.
...
svn path=/trunk/yasm/; revision=287
23 years ago
Peter Johnson
e170a2f8b3
Add symrec_get_visibility().
...
svn path=/trunk/yasm/; revision=286
23 years ago
Peter Johnson
6ac7d95579
Call expr_expand_equ() on effective address from bytecode_parser_finalize().
...
svn path=/trunk/yasm/; revision=285
23 years ago
Peter Johnson
6a7504341f
Add _copy() constructor.
...
Add expr_expand_equ().
svn path=/trunk/yasm/; revision=284
23 years ago
Peter Johnson
0be7a0d444
Add first version of post-parsing bytecode finalization. Lots of work still
...
to be done at the bytecode and expression level.
svn path=/trunk/yasm/; revision=283
23 years ago
Peter Johnson
68c9dcc62c
Add several major functions, including effective address ModRM calculation
...
(only 16-bit is implemented at the moment) via expr_checkea().
svn path=/trunk/yasm/; revision=282
23 years ago
Peter Johnson
a83fc9c8f6
Change order of arguments for get_ and check_ functions to better match other
...
functions (floatnum * as first arg).
svn path=/trunk/yasm/; revision=281
23 years ago
Peter Johnson
c6d051a5f2
Allow both signed and unsigned interpretations for get_int and check_size.
...
Change argument order on get_int and check_size to better match other
functions (intnum * first arg).
svn path=/trunk/yasm/; revision=280
23 years ago
Peter Johnson
df1245459f
Add parsing of memory expressions. Currently adds a lot of duplication for
...
the expressions in the yacc code, but I don't see an easier way right now.
Also, no validity checking is done.
svn path=/trunk/yasm/; revision=279
23 years ago
Peter Johnson
8149291eca
Add expr_contains_float() and symrec_get_equ() functions. These are the first
...
of many functions like this which will be needed for advanced validity checking
in the finalization of the parser stage.
Fix yacc grammar to not use the (incorrect) expr_no_fltstr, and change memexp
to memexpr and its handling to prepare for memory expressions.
svn path=/trunk/yasm/; revision=278
23 years ago
Peter Johnson
053329a368
Clarify and fix some usages of valid/need flags for modrm and sib bytes.
...
In bytecode_print(), check for NULL ea displacement and print out modrm and
sib bytes in octal (because it's easier to read the 2/3/3 format in octal).
svn path=/trunk/yasm/; revision=277
23 years ago
Peter Johnson
1708da018a
Don't allow floats to be used as targets of jumps.
...
svn path=/trunk/yasm/; revision=276
23 years ago
Peter Johnson
84de990744
Support TIMES prefix. Split expr parsing to have a no-float and no-string
...
version (for times and reserve space).
svn path=/trunk/yasm/; revision=275
23 years ago
Peter Johnson
256511eea8
Fix conficts created when adding EQU.
...
svn path=/trunk/yasm/; revision=274
23 years ago
Peter Johnson
079c17a068
Fix handling of numeric constants ending in a single character (h,q,b).
...
svn path=/trunk/yasm/; revision=273
23 years ago
Peter Johnson
124177e635
Handle EQU. Handle BITS directive. Move directive handling out to separate
...
function.
svn path=/trunk/yasm/; revision=272
23 years ago
Peter Johnson
57a746069d
Remove NULL return checks; BitVector uses xmalloc(), so they aren't necessary.
...
svn path=/trunk/yasm/; revision=271
23 years ago
Peter Johnson
193392dcb6
Fix LOTS of little nits. Primary changes:
...
- New intnum module to replace using just unsigned long (for >32 bit values).
Read values using BitVector instead of strtoul().
- Brought both floatnum and intnum into expr (still need to integrate calc for
floatnum).
- Add traversal function to ternary tree (for use by symrec_foreach).
- Change floatnum output interface from single/double/extended to byte size.
- Try to make floatnum/intnum interfaces very similar. Still needs work.
- Add/fix *_print functions, including interating ones for sections/bytecodes.
- Fix handling of $ and $$. Both now are properly parsed and bytecode'd.
- Print out all sections and symbol table in main() in preparation for work
on "cleanup" functionality between parser and optimizer stages (really part
of the parser stage).
svn path=/trunk/yasm/; revision=270
23 years ago
Peter Johnson
840c0f169d
Output "real" version and package names (from config.h).
...
svn path=/trunk/yasm/; revision=269
23 years ago
Peter Johnson
2e04b1830a
Add BitVector_from_Oct() and tests for it.
...
svn path=/trunk/yasm/; revision=268
23 years ago
Peter Johnson
6e4b87ab46
Change comment to include im_ptr in list of things that cannot be reused or
...
changed after calling bytecode_new_insn().
svn path=/trunk/yasm/; revision=267
23 years ago
Peter Johnson
217b33802c
Make data.insn.imm within bytecode a pointer. This prevents leakage in calls to
...
bytecode_new_insn().
svn path=/trunk/yasm/; revision=266
23 years ago
Peter Johnson
fef39125bc
Use xmalloc() instead of malloc().
...
svn path=/trunk/yasm/; revision=265
23 years ago
Peter Johnson
c49daeab12
Move SymStatus and SymType to symrec.c from symrec.h. They're only used
...
internally.
svn path=/trunk/yasm/; revision=264
23 years ago
Peter Johnson
677d561c21
Fix SHR operation, and do some reindentation.
...
svn path=/trunk/yasm/; revision=263
23 years ago