Peter Johnson
fa1654f7b9
Add SAVE_*, READ_*, and LOAD_* families of little-endian macros.
...
svn path=/trunk/yasm/; revision=230
23 years ago
Peter Johnson
1abd74ba04
Fix large parts of expression and symbol handling. Actually link in labels
...
properly (bug #8 ). Framework added for portable floating point support (bug
#7 ). Lots of functions still not finished in this commit.
svn path=/trunk/yasm/; revision=229
23 years ago
Peter Johnson
902d974288
Save filename as well as line number for each symbol.
...
svn path=/trunk/yasm/; revision=224
23 years ago
Peter Johnson
197f8857e4
Change error/warning framework to store a list of errors and warnings instead
...
of just one at a time. This is the groundwork for printing undefined symbol
messages, which can't be determined until after parsing has been completed
(and should be in the same line order with the other errors).
svn path=/trunk/yasm/; revision=223
23 years ago
Peter Johnson
f9209d5200
Used ternary search tree instead of linked list to store symbol table.
...
Cleaned up function naming too.
Removed locallabel_base from global.h, moving it into the parser-specific code.
Made sym_table private to symrec.c.
svn path=/trunk/yasm/; revision=220
23 years ago
Peter Johnson
df62b73779
Add check and BSD replacement for strsep(3).
...
svn path=/trunk/yasm/; revision=218
23 years ago
Peter Johnson
ecf19c6170
Delete ancient symrec cruft.
...
svn path=/trunk/yasm/; revision=217
23 years ago
Peter Johnson
b3f0a1c6b8
Make name and keyword const.
...
svn path=/trunk/yasm/; revision=211
23 years ago
Peter Johnson
ac22f77d42
Get initial bits setting from object format. Change the initial section name
...
from a function to a constant string. Make mode_bits uniformily an unsigned
char instead of an int.
svn path=/trunk/yasm/; revision=210
23 years ago
Peter Johnson
f173e9e042
Include stddef.h for size_t.
...
svn path=/trunk/yasm/; revision=206
23 years ago
Peter Johnson
5bed5011d0
Make sure | and == done in right order.
...
svn path=/trunk/yasm/; revision=205
23 years ago
Peter Johnson
91f41e241b
Try to fix configure and automake files so everything builds a bit cleaner.
...
Also try to fix the warnings on the GNU C Library.
Still a lot of work and testing to be done here, but making progress.
svn path=/trunk/yasm/; revision=204
23 years ago
Peter Johnson
60fd596a66
Cleaned up bytecode data structure, some effaddr functions. Made ea an
...
effaddr * instead of an effaddr to decrease size of bytecode. Changed parser
to use effaddr * as well. Finally fixed issue with ONE by adding flag to
bytecode.data.insn and utilizing spare bytes of the opcode. Hackish, but
works.
svn path=/trunk/yasm/; revision=203
23 years ago
Peter Johnson
3bd6541c5f
Allow make check and tests module to be disabled, as it's not portable yet.
...
svn path=/trunk/yasm/; revision=200
23 years ago
Peter Johnson
556602d2fa
Add portable little-endian file functions.
...
svn path=/trunk/yasm/; revision=198
23 years ago
Peter Johnson
1284d8d8af
Pull in GCC and ELF alternatives for RCSID() if available.
...
Idea from: sys/cdefs.h on FreeBSD.
svn path=/trunk/yasm/; revision=197
23 years ago
Peter Johnson
1fd753346c
Build section linked list, and support the section directive, including
...
asking the objfmt module. Add some utility functions for both bytecode
and section to better modularize their data structure usage and common
code. Rename doparse to do_parse to be consistent in naming.
svn path=/trunk/yasm/; revision=196
23 years ago
Peter Johnson
a95f135cc2
Completely test ConvertRegToEA().
...
svn path=/trunk/yasm/; revision=195
23 years ago
Peter Johnson
0b24caa55c
Cleanup of local .cvsignore files after addition of global CVSROOT/cvsignore.
...
svn path=/trunk/yasm/; revision=193
23 years ago
Peter Johnson
9397744af8
Add unit test framework using Check ( http://check.sourceforge.net/ ).
...
Only test included right now is a tiny one for one bytecode function, but
will grow as time goes on.
TODO: check for non ANSI C things required by Check.
svn path=/trunk/yasm/; revision=190
23 years ago
Michael Urman
caba67b7d6
Fixed two ansi C errors (empty file and extra semicolon)
...
svn path=/trunk/yasm/; revision=183
23 years ago
Peter Johnson
b2890b8f9d
$Id$ -> $IdPath$.
...
svn path=/trunk/yasm/; revision=174
23 years ago
Peter Johnson
d758a063b2
Add barebones optimizer module framework.
...
svn path=/trunk/yasm/; revision=169
23 years ago
Peter Johnson
695ab62056
Whoa, oops! Bad bug in bytecode_new_common (wasn't returning allocated bc).
...
svn path=/trunk/yasm/; revision=166
23 years ago
Peter Johnson
3c2a67ca1c
Use bytecode * instead of bytecode in parser.
...
Rename and restructure bytecode functions to make this use clearer.
svn path=/trunk/yasm/; revision=164
23 years ago
Peter Johnson
013530034e
Start building of sections and bytecodes in parser.
...
Still need to add section switching (currently never switches away from
default section).
svn path=/trunk/yasm/; revision=163
23 years ago
Peter Johnson
303bc90f72
Add prototypes for strcasecmp and strncasecmp if we use our own implementation.
...
svn path=/trunk/yasm/; revision=160
23 years ago
Peter Johnson
c09f4addc8
Check for case-insensitive string comparisons. Use strcasecmp and strncasecmp
...
in the source: if stricmp or strcmpi is available, they're mapped to
strcasecmp.
svn path=/trunk/yasm/; revision=159
23 years ago
Peter Johnson
fa6e459ce5
Use abort() instead of exit() if it's available for InternalError() and
...
Fatal().
svn path=/trunk/yasm/; revision=158
23 years ago
Peter Johnson
84e0411c49
Use queue.h macros in section.h, and reference bytecode using bytecodehead.
...
Remove old "append" function from bytecode.h
Add generic parser functions, clean up parser struct.
svn path=/trunk/yasm/; revision=157
23 years ago
Peter Johnson
074b748ece
Rename outfmt to objfmt and related files and directories. "objfmt" is more
...
descriptive of what the module is actually used for ("output" is rather
generic).
svn path=/trunk/yasm/; revision=155
23 years ago
Peter Johnson
45df22d110
Convert to using gettext instead of the ugly errwarn constant strings.
...
NOTE: gettextize now needs to be run before building.
svn path=/trunk/yasm/; revision=153
24 years ago
Peter Johnson
86f7268ea8
Add RCSID().
...
svn path=/trunk/yasm/; revision=151
24 years ago
Peter Johnson
77fc6dd491
Standardize order of include statements as well as autoconf'ing those source
...
files that weren't yet.
svn path=/trunk/yasm/; revision=150
24 years ago
Peter Johnson
bcd6236091
Add RCSID() function.
...
Indent some of the preprocessor directives a bit nicer.
svn path=/trunk/yasm/; revision=149
24 years ago
Peter Johnson
ae600ce442
Use STAILQ's for datavals and bytecodes.
...
svn path=/trunk/yasm/; revision=146
24 years ago
Peter Johnson
8d62e17ce2
Use the FreeBSD version of <sys/queue.h> instead of the OpenBSD version
...
because the OpenBSD version doesn't have STAILQ_*.
svn path=/trunk/yasm/; revision=145
24 years ago
Peter Johnson
b4668a5405
Use header-reuse #defines that are ANSI C compatible.
...
svn path=/trunk/yasm/; revision=144
24 years ago
Peter Johnson
28940100d4
Add <sys/queue.h> to util.h and pull in compatible, portable version from
...
OpenSSH-portable.
svn path=/trunk/yasm/; revision=143
24 years ago
Peter Johnson
edf74fe9ea
Run through GNU indent using indent profile. Manually fix some changes
...
(particularly functions such as BuildBC_Insn() which have large numbers
of arguments).
svn path=/trunk/yasm/; revision=141
24 years ago
Peter Johnson
5cd594556a
Declare type enum correctly.
...
svn path=/trunk/yasm/; revision=136
24 years ago
Peter Johnson
7ba343f346
New modular directory structure: parsers, preprocs, and outfmts.
...
Moved token.l.in, bison.y.in, and gen_instr.pl to parsers/nasm/.
New parser, preproc, and outfmt structures. None are complete; outfmt
needs the most work.
The raw preprocessor added (for no preprocessing).
Currently the default for the nasm parser is to use the raw preproc; this
should be changed to nasm_preproc once the nasm preprocessor is finished.
A dbg output format is also new; because outfmt isn't done yet, there's not
much implementation.
What structures still need creating: listfmt, debugfmt.
svn path=/trunk/yasm/; revision=133
24 years ago
Peter Johnson
b3a5266c00
Add "error when reading from file" error.
...
svn path=/trunk/yasm/; revision=131
24 years ago
Peter Johnson
50cd4f238f
Add global filename variable and handling for a filename passed on the
...
command line (no real command-line parsing yet).
svn path=/trunk/yasm/; revision=130
24 years ago
Peter Johnson
1fa31332b6
Add lexing, parsing, and internal format for strings and character constants.
...
Completely handle data declarations (db/dw/etc) and reserve space declarations
(resb/resw/etc).
svn path=/trunk/yasm/; revision=129
24 years ago
Peter Johnson
bb595a8f02
Formatting changes and starting to comment more heavily.
...
svn path=/trunk/yasm/; revision=128
24 years ago
Peter Johnson
d4c6d24a9e
At least in NASM syntax, there is no differentation between labels and data
...
declarations, so delete SYM_DATA. We may add it back in someday if we add
another syntax.
svn path=/trunk/yasm/; revision=127
24 years ago
Peter Johnson
fa5c9d5ea9
First attempt at supporting relative jump instructions. A few hacks, but
...
seems to work well.
A few other minor fixes/changes as well (noticed when coding).
svn path=/trunk/yasm/; revision=119
24 years ago
Michael Urman
c4d985f1ad
Integrate expression handling into memory address expressions.
...
Consequently change Imm->EA, and update DebugPrintBC (fix segvs too)
svn path=/trunk/yasm/; revision=117
24 years ago
Michael Urman
0cb10aa577
Fixed the non-ansi attempts to pass a union member casted as the union
...
type.
svn path=/trunk/yasm/; revision=113
24 years ago