Peter Johnson
29f7d9a917
New function: expr_get_symrec().
...
svn path=/trunk/yasm/; revision=338
24 years ago
Peter Johnson
d6d0cb8785
Add symrec_delete() for deleting non-table symbols. Use it from expr_delete().
...
Also allow the sect for labels to be NULL (special case for new directive
handling code).
svn path=/trunk/yasm/; revision=337
24 years ago
Peter Johnson
8178f883a5
Modify so that almost everything passes LCLint with the options in lclint.sh.
...
This is actually worthwhile; I found and fixed a few bugs/edge cases while
doing this.
For more information on LCLint, see <http://lclint.cs.virginia.edu/ >.
svn path=/trunk/yasm/; revision=335
24 years ago
Peter Johnson
fc603c2900
Add RCSID().
...
svn path=/trunk/yasm/; revision=334
24 years ago
Peter Johnson
424c30fdaa
Allow symrec_foreach return value to be ignored (in lclint).
...
svn path=/trunk/yasm/; revision=332
24 years ago
Peter Johnson
4df0191de8
lclint-ize gettext().
...
svn path=/trunk/yasm/; revision=331
24 years ago
Peter Johnson
9f97bcd9d0
Fix some nits found by lclint. Still something weird going on with list2 in
...
mergesort(), according to lclint, but I haven't figured out if it's real or
not.
svn path=/trunk/yasm/; revision=330
24 years ago
Peter Johnson
21eb7c7fe2
Add some lclint annotations.
...
svn path=/trunk/yasm/; revision=329
24 years ago
Peter Johnson
d7fe402fb9
Split away x86-specific parts of expression handling (eg, effective address ->
...
ModRM+SIB).
svn path=/trunk/yasm/; revision=328
24 years ago
Peter Johnson
f58d7cb093
Split x86-specific stuff away from bytecode.
...
svn path=/trunk/yasm/; revision=316
24 years ago
Peter Johnson
c9d92847b6
Start framework for separating architecture-dependent functions and data
...
structures from the rest of the assembler. We're not trying to write GAS
here (yet :), but doing this will make large parts of the codebase a lot
clearer.
svn path=/trunk/yasm/; revision=314
24 years ago
Peter Johnson
a7ac50c918
Add coretype.h, make util.h do a lot more, use util.h to simplify include
...
sections of C files. Also remove IdPath from top comment in files where
RCSID() is used. Move RCSID() to immediately after util.h include.
svn path=/trunk/yasm/; revision=313
24 years ago
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
24 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
24 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
24 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
24 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
24 years ago
Peter Johnson
94730125be
Missed a free->xfree conversion.
...
svn path=/trunk/yasm/; revision=306
24 years ago
Peter Johnson
10fa8fadc1
Correctly process 32-bit memory expressions in expr_checkea().
...
svn path=/trunk/yasm/; revision=303
24 years ago
Peter Johnson
305b471f51
On xfree(NULL), just return instead of triggering InternalError().
...
svn path=/trunk/yasm/; revision=302
24 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
24 years ago
Peter Johnson
dc1c3c70f5
Get rid of all the extra filename strdup()'s. (Bug #14 ).
...
svn path=/trunk/yasm/; revision=300
24 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
24 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
24 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
24 years ago
Peter Johnson
21c598f9f8
Put in temporary implementations of ErrorAt() and WarningAt().
...
svn path=/trunk/yasm/; revision=296
24 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
24 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
24 years ago
Peter Johnson
0a98a74163
Add mergesort() replacement from BSD sources.
...
svn path=/trunk/yasm/; revision=292
24 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
24 years ago
Peter Johnson
e640f25da5
Update comment on disp.len to match changes in expr.c.
...
svn path=/trunk/yasm/; revision=288
24 years ago
Peter Johnson
43c736c2d8
Add parser finalization check for undefined symbols.
...
svn path=/trunk/yasm/; revision=287
24 years ago
Peter Johnson
e170a2f8b3
Add symrec_get_visibility().
...
svn path=/trunk/yasm/; revision=286
24 years ago
Peter Johnson
6ac7d95579
Call expr_expand_equ() on effective address from bytecode_parser_finalize().
...
svn path=/trunk/yasm/; revision=285
24 years ago
Peter Johnson
6a7504341f
Add _copy() constructor.
...
Add expr_expand_equ().
svn path=/trunk/yasm/; revision=284
24 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
24 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
24 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
24 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
24 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
24 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
24 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
24 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
24 years ago
Peter Johnson
57a746069d
Remove NULL return checks; BitVector uses xmalloc(), so they aren't necessary.
...
svn path=/trunk/yasm/; revision=271
24 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
24 years ago
Peter Johnson
2e04b1830a
Add BitVector_from_Oct() and tests for it.
...
svn path=/trunk/yasm/; revision=268
24 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
24 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
24 years ago
Peter Johnson
fef39125bc
Use xmalloc() instead of malloc().
...
svn path=/trunk/yasm/; revision=265
24 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
24 years ago