]> granicus.if.org Git - yasm/log
yasm
17 years agoSupport environment variables in %include along the lines of FASM:
Peter Johnson [Fri, 19 Jan 2007 08:05:17 +0000 (08:05 -0000)]
Support environment variables in %include along the lines of FASM:
%include "%SOMEVAR%/subdir/file.inc"

Multiple %VAR% are supported in a single %include.
Undefined vars are not expanded.

Suggested by: Martin Mocko <vid512@gmail.com>

svn path=/trunk/yasm/; revision=1737

17 years agoAdd dbgfmt_cv8 to flat Mkfiles (DJGPP).
Peter Johnson [Fri, 19 Jan 2007 07:30:19 +0000 (07:30 -0000)]
Add dbgfmt_cv8 to flat Mkfiles (DJGPP).

Noticed by: Rugxulo <rugxulo@gmail.com>

svn path=/trunk/yasm/; revision=1736

17 years agoMake gnu an alias for gas parser.
Peter Johnson [Thu, 18 Jan 2007 04:09:59 +0000 (04:09 -0000)]
Make gnu an alias for gas parser.

Suggested by: Rugxulo <rugxulo@gmail.com>

svn path=/trunk/yasm/; revision=1735

17 years agoAdd macho to Mkfiles.
Peter Johnson [Thu, 18 Jan 2007 04:03:33 +0000 (04:03 -0000)]
Add macho to Mkfiles.

Noticed by: Rugxulo <rugxulo@gmail.com>

svn path=/trunk/yasm/; revision=1734

17 years agoUnbreak distcheck (missing test shell scripts from EXTRA_DIST).
Peter Johnson [Mon, 15 Jan 2007 17:54:46 +0000 (17:54 -0000)]
Unbreak distcheck (missing test shell scripts from EXTRA_DIST).

svn path=/trunk/yasm/; revision=1733

17 years agoInitial commit of Mach-O object format.
Peter Johnson [Sat, 13 Jan 2007 19:34:04 +0000 (19:34 -0000)]
Initial commit of Mach-O object format.

Contributed by: Henryk Richter <henryk.richter@comlab.uni-rostock.de>

This adds 3 object format keywords: macho, macho32, macho64.  These work in
the same way as elf, elf32, and elf64.  The object format is still a work
in progress; amongst other things it does not yet support full cross-section
references (othersym1-othersym2), dynamic linking, or GAS input syntax.  We
will continue to improve and work on these features in the near future.

svn path=/trunk/yasm/; revision=1732

17 years ago.indent.pro: Update ancient typedef list.
Peter Johnson [Thu, 11 Jan 2007 04:58:53 +0000 (04:58 -0000)]
.indent.pro: Update ancient typedef list.

svn path=/trunk/yasm/; revision=1731

17 years agocoretype.h: Remove yasm_optimizer typedef.
Peter Johnson [Thu, 11 Jan 2007 04:58:22 +0000 (04:58 -0000)]
coretype.h: Remove yasm_optimizer typedef.

svn path=/trunk/yasm/; revision=1730

17 years agox86arch.c, x86id.c: Explicitly cast to unsigned char.
Peter Johnson [Sun, 7 Jan 2007 22:00:53 +0000 (22:00 -0000)]
x86arch.c, x86id.c: Explicitly cast to unsigned char.
stabs-dbgfmt.c: Check for overflow, cast to unsigned short.

svn path=/trunk/yasm/; revision=1729

17 years agogas-parse.c: Delete unused variables.
Peter Johnson [Sun, 7 Jan 2007 21:58:51 +0000 (21:58 -0000)]
gas-parse.c: Delete unused variables.

svn path=/trunk/yasm/; revision=1728

18 years agocoff-objfmt.c: Close small memory leak.
Peter Johnson [Sat, 30 Dec 2006 06:08:54 +0000 (06:08 -0000)]
coff-objfmt.c: Close small memory leak.

svn path=/trunk/yasm/; revision=1727

18 years agopython-yasm/Makefile.inc: Pull in CPPFLAGS for Python build, which on some
Peter Johnson [Sat, 30 Dec 2006 05:44:20 +0000 (05:44 -0000)]
python-yasm/Makefile.inc: Pull in CPPFLAGS for Python build, which on some
systems can have important include directories that aren't in INCLUDES.

svn path=/trunk/yasm/; revision=1726

18 years agobc-data.c: Fix memory leak when handling LEB128 data.
Peter Johnson [Sat, 30 Dec 2006 05:43:18 +0000 (05:43 -0000)]
bc-data.c: Fix memory leak when handling LEB128 data.

svn path=/trunk/yasm/; revision=1725

18 years agoGAS parser: convert to recursive descent.
Peter Johnson [Sat, 30 Dec 2006 03:19:24 +0000 (03:19 -0000)]
GAS parser: convert to recursive descent.

Remove all Bison supporting struts as we no longer need Bison.

svn path=/trunk/yasm/; revision=1724

18 years agoNASM parser bugfixes, and add support for section names that include "-"
Peter Johnson [Sat, 30 Dec 2006 02:48:17 +0000 (02:48 -0000)]
NASM parser bugfixes, and add support for section names that include "-"
(such as the common .note.GNU-stack section).  While Yasm allows such section
names by enclosing with double-quotes, NASM allows this, so for compatibility
it makes sense for Yasm to as well.

svn path=/trunk/yasm/; revision=1723

18 years agoyasm_value_delete(): Check for NULL expr before attempting to delete it.
Peter Johnson [Sat, 30 Dec 2006 02:45:39 +0000 (02:45 -0000)]
yasm_value_delete(): Check for NULL expr before attempting to delete it.

svn path=/trunk/yasm/; revision=1722

18 years agonasm-parse.c, x86id.c: Fix unused variable warnings.
Peter Johnson [Wed, 27 Dec 2006 21:06:50 +0000 (21:06 -0000)]
nasm-parse.c, x86id.c: Fix unused variable warnings.
coff-objfmt.c: Fix return without a value.

svn path=/trunk/yasm/; revision=1721

18 years agoPOTFILES.in: Bring up to date by adding a couple of missing files.
Peter Johnson [Sun, 24 Dec 2006 21:22:54 +0000 (21:22 -0000)]
POTFILES.in: Bring up to date by adding a couple of missing files.

svn path=/trunk/yasm/; revision=1720

18 years agoRemove remaining references to nasm-bison.c/h.
Peter Johnson [Sun, 24 Dec 2006 21:18:01 +0000 (21:18 -0000)]
Remove remaining references to nasm-bison.c/h.
Noticed by: Sean Darcy <seandarcy2@gmail.com>
Patch by: Charles Bailey <charles@hashpling.org>

Fix automake 1.10 error.
Noticed/fix by: Sean Darcy <seandarcy2@gmail.com>

svn path=/trunk/yasm/; revision=1719

18 years agoPort re2c parser from YACC to recursive descent.
Peter Johnson [Sun, 24 Dec 2006 00:13:19 +0000 (00:13 -0000)]
Port re2c parser from YACC to recursive descent.

svn path=/trunk/yasm/; revision=1718

18 years agoFix Mkfiles for previous commit (NASM recursive descent parser).
Peter Johnson [Sat, 23 Dec 2006 21:06:10 +0000 (21:06 -0000)]
Fix Mkfiles for previous commit (NASM recursive descent parser).

svn path=/trunk/yasm/; revision=1717

18 years agoNASM parser: change from Bison parser to hand-written recursive descent
Peter Johnson [Sat, 23 Dec 2006 10:20:51 +0000 (10:20 -0000)]
NASM parser: change from Bison parser to hand-written recursive descent
parser with one token of lookahead.  This allows for better error handling
and proper handling of things like "xxxx"/5.  There may be a minor speedup
but it's probably a wash.

Still TODO:
 - Unify the expression parser with the NASM preproc one.
 - Change the GAS parser to recursive descent.

Only had to change one test result; this is due to re-ordering of symrec
creation versus symrec use in data expressions such as x db y.  With the
Bison parser, the symrec use (y) would come first, now the symrec creation
(x) comes first.

svn path=/trunk/yasm/; revision=1716

18 years agoRename yasm_dvs_destroy() to yasm_dvs_delete() to match the fact it's an
Peter Johnson [Sat, 23 Dec 2006 06:45:14 +0000 (06:45 -0000)]
Rename yasm_dvs_destroy() to yasm_dvs_delete() to match the fact it's an
initialized not allocated, so the function doesn't actually free the
provided pointer.

svn path=/trunk/yasm/; revision=1715

18 years agoFix bad valparams setup introduced in previous commit. yasm_vps_append()
Peter Johnson [Sun, 17 Dec 2006 18:11:00 +0000 (18:11 -0000)]
Fix bad valparams setup introduced in previous commit.  yasm_vps_append()
is a macro and does bad things when given a non-variable.

Tracked down by: Peter Tanski <p.tanski@gmail.com>

svn path=/trunk/yasm/; revision=1713

18 years agoPush down GAS .ident directive handling into objfmts. Note this makes it
Peter Johnson [Thu, 14 Dec 2006 07:39:01 +0000 (07:39 -0000)]
Push down GAS .ident directive handling into objfmts.  Note this makes it
such that only ELF and COFF actually handle .ident; all other object
formats silently ignore it.

In Win32/Win64, the .ident contents are dumped into the .rdata$zzz section
rather than the .comment section as in COFF and ELF; this is due to the
fact the GNU linker for Win32 is broken and puts .comment in the output
executable as a separate section, breaking the executable.  The .rdata$zzz
name matches that used by GAS to work around this same linker bug.

Reported and tracked down by: Peter Tanski <p.tanski@gmail.com>

svn path=/trunk/yasm/; revision=1712

18 years agoPyxelator: Rip out code wrapper generation. Reindent. Add yasm wrapper
Peter Johnson [Tue, 12 Dec 2006 07:16:45 +0000 (07:16 -0000)]
Pyxelator: Rip out code wrapper generation.  Reindent.  Add yasm wrapper
generator script.  Still needs additional tweaks before it can be tied
into the build.

svn path=/trunk/yasm/; revision=1711

18 years agoBring Pyxelator-r428 into trunk.
Peter Johnson [Tue, 12 Dec 2006 07:11:48 +0000 (07:11 -0000)]
Bring Pyxelator-r428 into trunk.

svn path=/trunk/yasm/; revision=1710

18 years agoTake [1423] to the next logical step by supporting the general case of
Peter Johnson [Sun, 10 Dec 2006 07:05:06 +0000 (07:05 -0000)]
Take [1423] to the next logical step by supporting the general case of
(sym in other section)-(sym in this section) rather than just
(sym in other section)-(curpos) (e.g. sym-$).  Unfortunately supporting
this required precbc to be flowed down to the value_finalize functions,
but it's relatively reasonable to do so, as all of the _finalize() routines
have access to precbc.

Reported by: Peter Tanski <peter_tanski@cox.net>

svn path=/trunk/yasm/; revision=1705

18 years agovalparam.h (yasm_vps_destroy): Fix documentation.
Peter Johnson [Mon, 4 Dec 2006 03:14:22 +0000 (03:14 -0000)]
valparam.h (yasm_vps_destroy): Fix documentation.

svn path=/trunk/yasm/; revision=1704

18 years agoexpr.pxi: Sync with [1702].
Peter Johnson [Mon, 27 Nov 2006 03:38:36 +0000 (03:38 -0000)]
expr.pxi: Sync with [1702].

svn path=/trunk/yasm/; revision=1703

18 years agoRemove YASM_EXPR_SYMREC hack; it's no longer used due to changes in
Peter Johnson [Mon, 27 Nov 2006 03:37:59 +0000 (03:37 -0000)]
Remove YASM_EXPR_SYMREC hack; it's no longer used due to changes in
absolute section reference expansion.

svn path=/trunk/yasm/; revision=1702

18 years agoRename linemgr.c and linemgr.h to linemap.c and linemap.h. The "manager"
Peter Johnson [Sun, 26 Nov 2006 21:02:59 +0000 (21:02 -0000)]
Rename linemgr.c and linemgr.h to linemap.c and linemap.h.  The "manager"
part of linemgr is long gone, and the current naming is a little confusing.

svn path=/trunk/yasm/; revision=1701

18 years agoGAS parser: match .file and .line handling to that of GAS. In GAS, both
Peter Johnson [Sun, 26 Nov 2006 20:50:23 +0000 (20:50 -0000)]
GAS parser: match .file and .line handling to that of GAS.  In GAS, both
.file (sans file number) and .line need to be given before error messages
start having the file/line numbers specified.

This temporarily breaks .rept error reporting somewhat (as the current code
outputs just .line for .rept expansion), but this will be fixed soon.

svn path=/trunk/yasm/; revision=1700

18 years agoerrwarn.c (yasm_warn_occurred): New, warning near-equivalent to
Peter Johnson [Sun, 26 Nov 2006 06:49:31 +0000 (06:49 -0000)]
errwarn.c (yasm_warn_occurred): New, warning near-equivalent to
yasm_error_occurred().

svn path=/trunk/yasm/; revision=1699

18 years agoFix #92: CPU 8086 doesn't support PUSH imm; this was added in the 186.
Peter Johnson [Thu, 23 Nov 2006 02:15:47 +0000 (02:15 -0000)]
Fix #92: CPU 8086 doesn't support PUSH imm; this was added in the 186.

svn path=/trunk/yasm/; revision=1698

18 years agogas-token.re: Use new yasm_unescape_cstring() to handle string constants.
Peter Johnson [Tue, 21 Nov 2006 09:00:29 +0000 (09:00 -0000)]
gas-token.re: Use new yasm_unescape_cstring() to handle string constants.

svn path=/trunk/yasm/; revision=1697

18 years agofile.c (yasm_unescape_cstring): New function to unescape a string following
Peter Johnson [Tue, 21 Nov 2006 08:55:43 +0000 (08:55 -0000)]
file.c (yasm_unescape_cstring): New function to unescape a string following
C-style escaping conventions.  Will update GAS parser to use this.

svn path=/trunk/yasm/; revision=1696

18 years agoerrwarn.c (yasm_warn_fetch): Follow documentation and don't crash if no
Peter Johnson [Tue, 21 Nov 2006 08:54:05 +0000 (08:54 -0000)]
errwarn.c (yasm_warn_fetch): Follow documentation and don't crash if no
warnings pending and this is called.

svn path=/trunk/yasm/; revision=1695

18 years agoOutput warnings if no errors occurred in preproc-only mode.
Peter Johnson [Mon, 20 Nov 2006 07:37:17 +0000 (07:37 -0000)]
Output warnings if no errors occurred in preproc-only mode.

svn path=/trunk/yasm/; revision=1694

18 years agoyapp_test.sh: Fix error recording and srcdir replacement.
Peter Johnson [Mon, 20 Nov 2006 07:36:46 +0000 (07:36 -0000)]
yapp_test.sh: Fix error recording and srcdir replacement.

svn path=/trunk/yasm/; revision=1693

18 years agogas-token.re (strbuf_append): Remove line parameter.
Peter Johnson [Mon, 20 Nov 2006 06:27:03 +0000 (06:27 -0000)]
gas-token.re (strbuf_append): Remove line parameter.

svn path=/trunk/yasm/; revision=1692

18 years agogas-bison.y: Fix crash when .ident is used with an object format that
Peter Johnson [Mon, 20 Nov 2006 01:20:11 +0000 (01:20 -0000)]
gas-bison.y: Fix crash when .ident is used with an object format that
doesn't support the .comment section.

svn path=/trunk/yasm/; revision=1691

18 years agoClean up a few minor nits (warnings).
Peter Johnson [Sun, 19 Nov 2006 01:04:29 +0000 (01:04 -0000)]
Clean up a few minor nits (warnings).

svn path=/trunk/yasm/; revision=1690

18 years agogas-parser.h: Fix nit (NASM_PARSER_H define instead of GAS_PARSER_H).
Peter Johnson [Sat, 18 Nov 2006 09:34:42 +0000 (09:34 -0000)]
gas-parser.h: Fix nit (NASM_PARSER_H define instead of GAS_PARSER_H).

svn path=/trunk/yasm/; revision=1689

18 years agoFix #91 and a few other minor nits. Reorganize to make for clearer flow.
Peter Johnson [Sat, 18 Nov 2006 06:20:06 +0000 (06:20 -0000)]
Fix #91 and a few other minor nits.  Reorganize to make for clearer flow.

svn path=/trunk/yasm/; revision=1688

18 years agoyapp_test.sh: Unbreak.
Peter Johnson [Thu, 16 Nov 2006 07:49:37 +0000 (07:49 -0000)]
yapp_test.sh: Unbreak.

svn path=/trunk/yasm/; revision=1687

18 years agoFix quoting error.
Peter Johnson [Thu, 16 Nov 2006 07:19:23 +0000 (07:19 -0000)]
Fix quoting error.

svn path=/trunk/yasm/; revision=1686

18 years agoyapp-preproc.c: Build fix.
Peter Johnson [Thu, 16 Nov 2006 04:49:34 +0000 (04:49 -0000)]
yapp-preproc.c: Build fix.

svn path=/trunk/yasm/; revision=1685

18 years agoGenerate better errors than "invalid combination of opcode and operands"
Peter Johnson [Tue, 14 Nov 2006 06:51:50 +0000 (06:51 -0000)]
Generate better errors than "invalid combination of opcode and operands"
for a number of common cases (size mismatch, too low of CPU).

svn path=/trunk/yasm/; revision=1684

18 years agoUse is_exp2() in a couple more places.
Peter Johnson [Sat, 11 Nov 2006 06:00:22 +0000 (06:00 -0000)]
Use is_exp2() in a couple more places.

svn path=/trunk/yasm/; revision=1683

18 years agoMake life a little easier by adding an is_exp2() macro.
Peter Johnson [Sat, 11 Nov 2006 05:47:09 +0000 (05:47 -0000)]
Make life a little easier by adding an is_exp2() macro.

svn path=/trunk/yasm/; revision=1682

18 years agoAllow overriding of strict-ness requirement with command line option
Peter Johnson [Tue, 7 Nov 2006 06:40:05 +0000 (06:40 -0000)]
Allow overriding of strict-ness requirement with command line option
"--force-strict", which switches Yasm back to the old behavior of treating
any sized operand as "strict" (forcing the actual size).

Requested by: Michael Urman <mu@tortall.net>

svn path=/trunk/yasm/; revision=1681

18 years agoSupport strict for immediate values, and optimize non-strict (thus some
Peter Johnson [Mon, 6 Nov 2006 08:59:35 +0000 (08:59 -0000)]
Support strict for immediate values, and optimize non-strict (thus some
other testcase changes).

While I'm here, fix handling of arith [], dword X in 64-bit mode by making
this an error; it's impossible to tell if add dword [], X or add qword [], X
is meant as the immediate part is always a dword.  This is only important for
arith rather than other memory instructions due to dword also being needed
for optimization.

Next step: support strict for jump sizing and optimize non-strict sized
jumps.

svn path=/trunk/yasm/; revision=1680

18 years agoSupport "strict" in NASM parser. Still need to implement its desired
Peter Johnson [Mon, 6 Nov 2006 02:33:11 +0000 (02:33 -0000)]
Support "strict" in NASM parser.  Still need to implement its desired
behavior in the x86 architecture.

svn path=/trunk/yasm/; revision=1679

18 years agoRemove some unused yasm_scanner variables, and properly document the
Peter Johnson [Thu, 2 Nov 2006 07:44:09 +0000 (07:44 -0000)]
Remove some unused yasm_scanner variables, and properly document the
remaining ones.

svn path=/trunk/yasm/; revision=1678

18 years agoyasm_intnum_create_charconst_nasm(): Ensure converted values from char
Peter Johnson [Tue, 31 Oct 2006 03:58:26 +0000 (03:58 -0000)]
yasm_intnum_create_charconst_nasm(): Ensure converted values from char
fit into 8 bits.

Reported by: Samuel Thibault <samuel.thibault@ens-lyon.org>

svn path=/trunk/yasm/; revision=1677

18 years agoout_test.sh: Fix reporting of non-error.
Peter Johnson [Tue, 31 Oct 2006 03:56:53 +0000 (03:56 -0000)]
out_test.sh: Fix reporting of non-error.

Patch submitted by: Samuel Thibault <samuel.thibault@ens-lyon.org>

svn path=/trunk/yasm/; revision=1676

18 years agoFix #88: Allow only GNU Bison (not Bison++ or plain old yacc) for YACC, and clear...
Peter Johnson [Mon, 30 Oct 2006 05:08:48 +0000 (05:08 -0000)]
Fix #88: Allow only GNU Bison (not Bison++ or plain old yacc) for YACC, and clear YACC
if too low (<1.25) version found.

svn path=/trunk/yasm/; revision=1675

18 years agoHave incbin search include paths (long-missing feature).
Peter Johnson [Sat, 28 Oct 2006 22:06:01 +0000 (22:06 -0000)]
Have incbin search include paths (long-missing feature).

svn path=/trunk/yasm/; revision=1673

18 years agoAdd trailing slashes on include paths again (functionality deleted in
Peter Johnson [Sat, 28 Oct 2006 22:04:18 +0000 (22:04 -0000)]
Add trailing slashes on include paths again (functionality deleted in
[1669]).

svn path=/trunk/yasm/; revision=1672

18 years agoUnbreak raw preproc (broken in [1669]).
Peter Johnson [Sat, 28 Oct 2006 21:54:27 +0000 (21:54 -0000)]
Unbreak raw preproc (broken in [1669]).

svn path=/trunk/yasm/; revision=1671

18 years agoyasm_fopen_include: Allow oname to be NULL. Also set oname to NULL if NULL
Peter Johnson [Sat, 28 Oct 2006 21:39:14 +0000 (21:39 -0000)]
yasm_fopen_include: Allow oname to be NULL.  Also set oname to NULL if NULL
is returned.

svn path=/trunk/yasm/; revision=1670

18 years agoRefactor include file handling into libyasm from preprocessors.
Peter Johnson [Sat, 28 Oct 2006 21:31:38 +0000 (21:31 -0000)]
Refactor include file handling into libyasm from preprocessors.

svn path=/trunk/yasm/; revision=1669

18 years agoMake common scanner fill function, as we're using it in two places already.
Peter Johnson [Sat, 28 Oct 2006 20:34:03 +0000 (20:34 -0000)]
Make common scanner fill function, as we're using it in two places already.
Actually, GAS parser doesn't use this yet, as it still contains the rept
functionality that will move to GAS preproc at some point.  When GAS
preproc implements rept, we can switch to the common implementation.

svn path=/trunk/yasm/; revision=1668

18 years agoFix handling of svdc, rsdc, wrshr, and rdshr Cyrix opcodes.
Peter Johnson [Sat, 28 Oct 2006 18:44:21 +0000 (18:44 -0000)]
Fix handling of svdc, rsdc, wrshr, and rdshr Cyrix opcodes.

Reported by: Danny Reeves <danny_reeves@hotmail.com>

svn path=/trunk/yasm/; revision=1667

18 years agoFix prefix order for "3-byte" instructions like the SIMD instructions.
Peter Johnson [Sat, 28 Oct 2006 18:19:39 +0000 (18:19 -0000)]
Fix prefix order for "3-byte" instructions like the SIMD instructions.
While the F2/F3/66 prefix used by these instructions should precede the
REX prefix in 64-bit mode, they should probably not precede the segment
override.  The processor specifications seem to be unclear on this point,
so play it safe.

This change has a minor side-effect of reversing the segreg/size override
ordering on things like "fs cmpsd" in 16-bit mode; this is okay as those
prefixes can be in any order.  This is due to the way Yasm implements
segreg overrides for instructions with no EA.

Reported by: Danny Reeves <danny_reeves@hotmail.com>

svn path=/trunk/yasm/; revision=1666

18 years agoexpr.c (expr_expand_equ): Work around what I believe to be a GCC aliasing
Peter Johnson [Fri, 27 Oct 2006 07:29:28 +0000 (07:29 -0000)]
expr.c (expr_expand_equ): Work around what I believe to be a GCC aliasing
bug (probably http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28778) by not
accepting NULL for eh, and giving it the static eh at the sole caller of
this function (yasm_expr__level_tree).  While I'm here, clean up the logic
a bit to avoid relying on ee.e NULL value.  This fix prevents crashes in
GCC 4.1.1 with -fstrict-aliasing (enabled by -O2).

Noticed by: Danny Reeves <danny_reeves@hotmail.com>

svn path=/trunk/yasm/; revision=1665

18 years agogenmodule.c: Fix edge cases in string handling.
Peter Johnson [Mon, 23 Oct 2006 03:32:06 +0000 (03:32 -0000)]
genmodule.c: Fix edge cases in string handling.

svn path=/trunk/yasm/; revision=1664

18 years agoAdd yasm_parsers(7), yasm_objfmts(7), and yasm_dbgfmts(7) man pages,
Peter Johnson [Sat, 21 Oct 2006 18:52:29 +0000 (18:52 -0000)]
Add yasm_parsers(7), yasm_objfmts(7), and yasm_dbgfmts(7) man pages,
mostly copied from the yasm manual.

svn path=/trunk/yasm/; revision=1662

18 years agoRevamp and update man pages. Still need to add in some missing ones.
Peter Johnson [Sat, 21 Oct 2006 08:07:09 +0000 (08:07 -0000)]
Revamp and update man pages.  Still need to add in some missing ones.

svn path=/trunk/yasm/; revision=1660

18 years agoFix #86 by requiring '-' (e.g. "yasm -") to read from stdin, and reporting
Peter Johnson [Sat, 21 Oct 2006 04:49:19 +0000 (04:49 -0000)]
Fix #86 by requiring '-' (e.g. "yasm -") to read from stdin, and reporting
an error if no files are specified (instead of defaulting to stdin).
While the old behavior mimiced GNU AS, the new behavior is far more common
amongst typical compilers (e.g. GCC), including NASM.

While I'm here, add support for '--' (e.g. "yasm -- -f").

svn path=/trunk/yasm/; revision=1659

18 years agoFix #85: Multiple may be 0. In this case, force size to zero instead of
Peter Johnson [Thu, 19 Oct 2006 19:42:08 +0000 (19:42 -0000)]
Fix #85: Multiple may be 0.  In this case, force size to zero instead of
dividing (and thus crashing).

svn path=/trunk/yasm/; revision=1658

18 years agoFix #84: I broke the idiom of concating a decimal number to a register
Peter Johnson [Thu, 19 Oct 2006 03:21:18 +0000 (03:21 -0000)]
Fix #84: I broke the idiom of concating a decimal number to a register
in the preproc (e.g mm%$x -> mm0) when I implemented a minor optimization
(outputing values in hex to avoid the 2x decimal conversion overhead) in
[1488].  Revert that optimization.

I believe the right way to do this is to add the GAS (and MASM) syntax
sugar of mm(0) etc. to NASM syntax, then any number (not just decimal)
can be used as the new idiom for doing this.  But that wouldn't unbreak
programs that already exist, so we're left with this state of affairs.
Sigh.

svn path=/trunk/yasm/; revision=1657

18 years agoexpr.h: Fix comment to match [1655].
Peter Johnson [Thu, 19 Oct 2006 03:08:44 +0000 (03:08 -0000)]
expr.h: Fix comment to match [1655].

svn path=/trunk/yasm/; revision=1656

18 years agoDon't mix EQU expansion with other expr leveling; we could get confused
Peter Johnson [Wed, 18 Oct 2006 05:36:51 +0000 (05:36 -0000)]
Don't mix EQU expansion with other expr leveling; we could get confused
with certain combinations.
(2nd half of #83)

This also hides some internals of yasm_expr_level_tree.

svn path=/trunk/yasm/; revision=1655

18 years agoFix handling of CPU flags; the old code would simply take the last CPU
Peter Johnson [Wed, 18 Oct 2006 04:21:21 +0000 (04:21 -0000)]
Fix handling of CPU flags; the old code would simply take the last CPU
setting in the file and use it against the entire file (oops).
(first half of #83)

Also make the error message a lot nicer, at least for ones we detect early
(shl ax, 2 in 8086 mode still gives the old message).

While I'm here, upgrade movsd to CPU_386.

svn path=/trunk/yasm/; revision=1654

18 years agordf: Enable Id keywords on various files.
Peter Johnson [Tue, 17 Oct 2006 06:58:41 +0000 (06:58 -0000)]
rdf: Enable Id keywords on various files.

svn path=/trunk/yasm/; revision=1653

18 years agordf-objfmt.c: Clean up unused variables.
Peter Johnson [Tue, 17 Oct 2006 06:57:47 +0000 (06:57 -0000)]
rdf-objfmt.c: Clean up unused variables.

svn path=/trunk/yasm/; revision=1652

18 years agoFix up Mkfiles for RDOFF2 support.
Peter Johnson [Tue, 17 Oct 2006 05:53:40 +0000 (05:53 -0000)]
Fix up Mkfiles for RDOFF2 support.

svn path=/trunk/yasm/; revision=1651

18 years agoAdd support for RDOFF2 object format (#73).
Peter Johnson [Tue, 17 Oct 2006 05:48:42 +0000 (05:48 -0000)]
Add support for RDOFF2 object format (#73).

svn path=/trunk/yasm/; revision=1650

18 years agonasm-token.re: Be even more pedantic and pass through $-prefixed ids as-is.
Peter Johnson [Tue, 17 Oct 2006 05:14:27 +0000 (05:14 -0000)]
nasm-token.re: Be even more pedantic and pass through $-prefixed ids as-is.

svn path=/trunk/yasm/; revision=1649

18 years agonasm-token.re: Fix handling of inside of directive to allow even keywords
Peter Johnson [Tue, 17 Oct 2006 04:42:12 +0000 (04:42 -0000)]
nasm-token.re: Fix handling of inside of directive to allow even keywords
to be used.

svn path=/trunk/yasm/; revision=1648

18 years agoxdf-objfmt.c: Remove unused reloc list (this is taken care of in libyasm
Peter Johnson [Tue, 17 Oct 2006 04:35:44 +0000 (04:35 -0000)]
xdf-objfmt.c: Remove unused reloc list (this is taken care of in libyasm
now).

svn path=/trunk/yasm/; revision=1647

18 years agoFix crash case in data bytecode handling (raw followed by non-raw value).
Peter Johnson [Thu, 12 Oct 2006 03:10:14 +0000 (03:10 -0000)]
Fix crash case in data bytecode handling (raw followed by non-raw value).

Reported by: Danny Reeves <danny_reeves@hotmail.com>

svn path=/trunk/yasm/; revision=1646

18 years agoutil.h: Use same workarounds for mingw32 as for the GNU C library.
Peter Johnson [Sun, 8 Oct 2006 00:53:10 +0000 (00:53 -0000)]
util.h: Use same workarounds for mingw32 as for the GNU C library.

svn path=/trunk/yasm/; revision=1645

18 years agoexpr.c: Remove a couple of unused variables.
Peter Johnson [Sun, 8 Oct 2006 00:48:03 +0000 (00:48 -0000)]
expr.c: Remove a couple of unused variables.

svn path=/trunk/yasm/; revision=1644

18 years agoFix error/warnings in the NASM preprocessor to reference the correct line
Peter Johnson [Sat, 7 Oct 2006 17:27:56 +0000 (17:27 -0000)]
Fix error/warnings in the NASM preprocessor to reference the correct line
number, rather than the last parsed line number.  Also improve
"cannot reference symbol" error a bit, to include the symbol name.

svn path=/trunk/yasm/; revision=1643

18 years agoChange genmodule to parse through the Makefile (or Makefile.am) looking for YASM_MODULES,
Peter Johnson [Thu, 5 Oct 2006 06:22:25 +0000 (06:22 -0000)]
Change genmodule to parse through the Makefile (or Makefile.am) looking for YASM_MODULES,
rather than simply taking a list of modules on the command line.  This allows significant
improvement of the behavior when used with Visual Studio, as the "old" way of doing this
with Visual Studio build files was to scan through the .c files; this brought up things
that were actually disabled in the build.

Also incorporate a patch by Charles Bailey to make the VC8 build less noisy, and allow use
of Win32 Bison if it's installed.  Instructions updated as well.

svn path=/trunk/yasm/; revision=1642

18 years agore2c-parser.y: Work around a bug in Bison 2.1; Bison 2.1 generates bad code if both
Peter Johnson [Thu, 5 Oct 2006 06:07:59 +0000 (06:07 -0000)]
re2c-parser.y: Work around a bug in Bison 2.1; Bison 2.1 generates bad code if both
YYPARSE_PARAM and __STDC__ are undefined.

svn path=/trunk/yasm/; revision=1641

18 years agogenversion.c: Include ctype.h to get isdigit() definition.
Peter Johnson [Thu, 5 Oct 2006 05:32:29 +0000 (05:32 -0000)]
genversion.c: Include ctype.h to get isdigit() definition.

svn path=/trunk/yasm/; revision=1640

18 years agoFollow-up to #80 and #81: "xchg ax, ax" can use the short 0x90 form as
Peter Johnson [Wed, 4 Oct 2006 04:38:43 +0000 (04:38 -0000)]
Follow-up to #80 and #81: "xchg ax, ax" can use the short 0x90 form as
16-bit operations don't clear the high bits of the 64-bit register, so
this is effectively a NOP as well.

While I'm still looking at this, make "xchg rax, rax" not output a REX
prefix.

I thought about being extra-clever and have "xchg ax, ax" not output an
operand-size prefix, but thought better of it: if the user says "ax"
they're probably going to expect the prefix to be there.  Left in as
a comment for future readers of the code.

svn path=/trunk/yasm/; revision=1639

18 years agoFix #80: xchg ax, ax or xchg eax, eax in 64-bit mode should not use 90h
Peter Johnson [Tue, 3 Oct 2006 16:24:30 +0000 (16:24 -0000)]
Fix #80: xchg ax, ax or xchg eax, eax in 64-bit mode should not use 90h
opcode.

svn path=/trunk/yasm/; revision=1638

18 years agoImprove error message for illegal use of A/B/C/DH with REX instruction.
Peter Johnson [Tue, 3 Oct 2006 05:33:54 +0000 (05:33 -0000)]
Improve error message for illegal use of A/B/C/DH with REX instruction.

svn path=/trunk/yasm/; revision=1637

18 years agoAccept (but ignore) -O and -Onnn command line options, for compatibility
Peter Johnson [Sat, 30 Sep 2006 08:16:39 +0000 (08:16 -0000)]
Accept (but ignore) -O and -Onnn command line options, for compatibility
with NASM.

svn path=/trunk/yasm/; revision=1636

18 years agoFix #77 by performing symrec-symrec -> subst placeholder transformation
Peter Johnson [Sat, 30 Sep 2006 05:13:41 +0000 (05:13 -0000)]
Fix #77 by performing symrec-symrec -> subst placeholder transformation
recursively in yasm_expr__bc_dist_subst(); before this we would only do
one level, which fails on simple structures like the old NASM align approach
of "($$-$) & value" (as the $$-$ is one level down in the expression).

svn path=/trunk/yasm/; revision=1635

18 years ago- Fix much brokenness in absolute value handling, particularly in regards to
Peter Johnson [Fri, 29 Sep 2006 07:18:45 +0000 (07:18 -0000)]
- Fix much brokenness in absolute value handling, particularly in regards to
  PC-relative relocations (jumps and calls).
- Allow SEG:OFF to be used as just an offset portion (like NASM does).
- Labels in absolute sections that are declared global are given the correct
  absolute value in the symbol table.

One difference from NASM:
  label equ 0040h:001eh
  jmp label
in NASM means the same as:
  jmp 001eh  (a near jump)
but yasm will treat this the same as:
  jmp 0040h:001eh  (a far jump)

I'm still not completely happy with this implementation, but it's workable
and fixes all the bugs I've found so far in absolute handling.

svn path=/trunk/yasm/; revision=1634

18 years agoFix #78: Handle C-style comments (/* */) in GAS parser.
Peter Johnson [Wed, 27 Sep 2006 07:02:27 +0000 (07:02 -0000)]
Fix #78: Handle C-style comments (/* */) in GAS parser.

svn path=/trunk/yasm/; revision=1633

18 years agoFix error message for arch/parser mismatch.
Peter Johnson [Wed, 27 Sep 2006 06:58:50 +0000 (06:58 -0000)]
Fix error message for arch/parser mismatch.

svn path=/trunk/yasm/; revision=1632

18 years agoFix duplicate line at the end of list output.
Peter Johnson [Mon, 25 Sep 2006 05:42:09 +0000 (05:42 -0000)]
Fix duplicate line at the end of list output.

Reported by: Danny Reeves <danny_reeves@hotmail.com>

svn path=/trunk/yasm/; revision=1631

18 years agoFix NASM preprocessor outputting %line for every line.
Peter Johnson [Fri, 22 Sep 2006 05:28:12 +0000 (05:28 -0000)]
Fix NASM preprocessor outputting %line for every line.

Noticed by: Dancie Reeves <danny_reeves@hotmail.com>

svn path=/trunk/yasm/; revision=1630