Peter Johnson [Thu, 28 Jun 2001 08:50:09 +0000 (08:50 -0000)]
Use autoconf to determine when to include our implementation of strdup, so
remove util.c and create strdup.c. Make util.h, strdup.c, and several source
files use config.h defines.
Peter Johnson [Thu, 28 Jun 2001 08:48:32 +0000 (08:48 -0000)]
Use autoconf to determine when to include our implementation of strdup, so
remove util.c and create strdup.c. Make util.h, strdup.c, and several source
files use config.h defines.
Michael Urman [Wed, 13 Jun 2001 05:43:59 +0000 (05:43 -0000)]
Added handling of labels including:
better symbol table functions
calling them from yacc rather than lex
a new warning for .label before normal_label
locallabel_base now a symrec* instead of a strdup'd string.
Still needs some more error checking (to not allow multiple copies of
the same label, etc.)
Also includes move to y_strdup for bison.y.in (ANSI compatibility)
Peter Johnson [Wed, 30 May 2001 07:41:03 +0000 (07:41 -0000)]
Reorganize (yet again) effective address, immediate value, and instruction
structures.
Add more interface functions to isolate structure internals and make it
easier to add warnings (such as for multiple overrides/prefixes).
Michael Urman [Wed, 30 May 2001 06:43:02 +0000 (06:43 -0000)]
Horrible hack to fold ONE, and REG_A* into more general versions of the
grammar, but only if they actually exist in the set; generate normally
if the more general version doesn't exist.
Peter Johnson [Tue, 22 May 2001 20:48:21 +0000 (20:48 -0000)]
Call new error output functions after every line.
Moved line_number increment into single location.
Use SetEASegment() to set the segment override in memory addresses.
Peter Johnson [Tue, 22 May 2001 20:44:32 +0000 (20:44 -0000)]
Split error and warning handlers into notify and output functions.
Paired with changes in bison.y.in, this will make sure only one error
and/or warning is output for each line.
Peter Johnson [Tue, 22 May 2001 07:17:04 +0000 (07:17 -0000)]
Fix all shift/reduce and reduce/reduce conflicts except for those that
involve REG_AL, REG_AX, and REG_EAX with immediates. Also eliminated
various unused rules.
Still need to figure out the proper thing to do with XCHG and AX/EAX as
one of the parameters.
Build still breaks because ONE is not a real token (it needs to be handled
along with the AL, AX, and EAX conflicts in gen_instr.pl).
Michael Urman [Mon, 21 May 2001 22:33:23 +0000 (22:33 -0000)]
Changed structure to one hash - now order is not preserved.
On the bright side, rules use the | where appropriate.
Arguments after TO rules are shifted right by 1.
Aliased arguments are handled in the lexer.
Michael Urman [Mon, 21 May 2001 21:46:33 +0000 (21:46 -0000)]
First commit. Generates all needed sections of token.l, bison.y from
instrs.dat, token.l.in, bison.y.in. Optionally can use other files, or
just verify input is valid.
Peter Johnson [Mon, 21 May 2001 20:17:51 +0000 (20:17 -0000)]
Added conversion from immediate value to effective address. Used for enter
instruction (which takes two immediate values).
To facilitate this change, changed meaning of "len" in bytecode structure
to be only the length of the offset (from being 1+length, the 1 being for the
Mod/RM byte), and added a need_modrm flag similar to the need_sib flag in
functionality.