Merge a bunch of common code in the handling of modr/m
generation. Make the handing of compressed disp8 simpler and more
transparent by exporting a the shift factor for the compressed
immediate in ea_data. For the case of no compression, the shift factor
is simply 0; there is no need to distinguish "compressed" from
"uncompressed".
The tidied up version of the disp8 code is simple enough that it makes
more sense to inline it.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Don't break Makefile.dep generation if run from a separate build
directory.
config/unconfig.h is a bit special; it is kept in the repository for
the benefit of non-configure users. Therefore, don't have "make
spotless" delete it.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Without a manifest, Windows applications force a fixed PATH_MAX limit
to any pathname; this is unnecessary.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
The dependency on the warning files breaks when we are building in a
directory *and* the files already exist from being shipped with the
distribution tarballs. The make VPATH simply isn't sophisticated
enough to deal with it, so let the C compiler handle it by #including
the generated file from a dummy C file.
Reported-by: Rudi Heitbaum <rudi@heitbaum.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Include the version number in the output (misc/nasmtok.el) and add a
rule for generating it to the Makefiles.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Instead of handling conditional instructions ad hoc, generate
individual instruction patterns as normal. This simplifies the code
and makes CMPccXADD support simpler (otherwise it would be necessary
to hack in the handling of a condition code in the middle of an
instruction.)
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
RDOFF has been deprecated as it has unfixable problems, and has been
announced that it will be killed off in NASM 2.16.
This deletes it once and for all.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Fix circular dependency on asm/warnings.c by factoring out
warnings.$(O) from the dependencies, and use a separate <file>.time
which "generate" the main source file as a "side effect", giving us a
null target.
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
NASM 2.15.04
Conflicts:
asm/listing.h
asm/pptok.pl
asm/preproc.c
version
This doesn't pass travis test 3392711, which is using an extremely odd
construct of %?? in the middle of an argument sequence for an smacro
while not being in a macro itself, and expecting it to expand to the
macro name. This seems to *really* confuse the master branch.
Resolve this later...
The warning files are generated by a script, but the scripts is fast
enough run every time a C file is updated. To prevent having to
rebuild every file, however, make the generation script only actually
modify the file if it has changed.
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
Fold the prepreprocessor and the nop preprocessor into the main
preprocessor. This means handling # cpp-like lines and TASM
compatibility tokens in the preprocessor proper, but that is really
not very hard to do.
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
- config/watcom.h: update.
- Mkfiles/openwcom.mak: -wcd=124 to silence "Comparison result always 0"
warnings from error.h::debug_level()
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
config/unconfig.h really is no different than the other perlreq files,
so move it into the Makefile. This has the extra advantage that
config/unconfig.h no longer needs to be kept in the source repository.
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
Add warnings.src to PERLREQ. If this isn't done, warnings.src ends up
in the xdoc tarball rather than the release tarball, which means that
unless the user can "make warnings" manually (which requires Perl)
then they can't build the documentation.
As this only affects the documentation build, it probably does not
warrant a point release.
Add a few more extensions to the list of recognized binary extensions
for the purpose of generating a .zip file with DOS line ending
conventions.
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
Haiku apparently wants to include <float.h> rather than
"float.h". Rename float.[ch] to floats.[ch] to avoid unnecessary
namespace confusion.
Reported-by: <alaviss0+nasm@gmail.com>
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
There is no point to run config.status --recheck just because
we have changed Makefile.in. Just run config.status.
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
Move the definitions to a separate file, in order to separate code
from data better.
We can auto-generate more information about the instruction flags, so
let's do so.
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
It is possible on memory exhaustion that nasm_fatal() might cause
another allocation error, thus calling nasm_alloc_failed() again. If
we find us in nasm_alloc_failed() for a second time, try to get a
message out and then call abort().
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
Add a version of (v)asprintf(), which allocates a string on the
heap. Unlike the standard version of (v)asprintf(), we return the
pointer; if one wants the length of the string then one can simply use
the %n pattern.
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
The currently-unused strtbl was basically a slightly different version
of strlist, with the find and linearize capabilities. Merge these two
together by augmenting strlist to have the same capabilities.
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
1. The mkdep.pl program didn't handle excluded dependencies correctly,
causing it to error out due to config/config.h not existing.
2. NMAKE is sensitive to the order suffixes appear in .SUFFIXES,
causing it to try to use the builtin rule .c.exe instead of
.c.obj -> .obj.exe.
3. NMAKE doesn't handle the && operator between commands.
4. The !ifdef jungle around dependency generation was wrong.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Apparently OS/2 really wants \ as path separators, and that is really
the main target for OpenWatcom these days, so change the path
separator in this Makefile. For building on Linux we'd be better off
with a GNU Makefile anyway, but what is the point, really...
Reported-by: Andy Willis <abwillis1@gmail.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Get rid of remaining dependencies on FILENAME_MAX, which ought to have
been removed a long time ago.
Remove ofmt->filename(); all implementations pretty much do the same
thing and there is absolutely no reason to duplicate that
functionality all over the place.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
We don't want to call make to rebuild msvc.dep when that is what we
are actually trying to do, over and over again...
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Make it possible to keep dependency information separate from the
Makefiles, so we don't have to deal with it noisifying the git logs.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
For many (most?) targets these will be very small functions, so inline
them. However, just in case make these external library functions.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Fix a construct in doc/findfont.ph which crashes Perl on Windows
unconditionally.
Improve the README for building the full package with MSVC.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Move byte order handling functions to their own header file, and try
to be more specific about how exactly to handle things.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Several output formats use "string tables", which is a collection of
null-terminated (C) strings which are referenced by a byte offset into
the string table. A single string can be referenced an arbitrary
number of times.
As this is quite simple to implement with a hash table, we do exactly
that.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Some debugging formats may need to be able to split paths into
directory name and filename, at least. This is kind of iffy, at least
across platforms, but that isn't really expected to be an issue in
practice... we hope.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
We already have abort-on-error memory allocation and I/O operations in
nasmlib, so use them for rdoff as well.
Delete long-since-obsolete rdoff Mkfiles directory.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
An uncompressed PDF is about twice as big, but if one is using an
external compression program (e.g. .pdf.xz) it compresses far better.
Use it for the RPM specfile.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>