Instead of completely useless sequential line numbers, emit line
numbers corresponding to the line numbers in the source code.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Remove the --allow-64-bits relocation, and instead make it a
suppressible warning in the case of a zero-extended relocation, and an
error in the case of a sign-extended relocation.
Relocations which can be losslessly represented in the output format
do not issue any diagnostic at all, as there is no problem in that
case.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Add the option --allow-64-bit to permit the generation of 64-bit code
even for a 16/32-bit output format.
Using NASM to do some boot strapping code and ran into trouble when
trying to emit a few 64-bit instructions in the OMF object file doing
the mode switching. While I can see how the "error: obj output format
does not support 64-bit code" message can be a useful reality check
for application programmers, it prevents low-level programmers from
doing what they want. It if was just a harmless warning, it wouldn't
be so bad, but it turns BITS 64 into BITS 16. The main trick to mixing
64-bit code into OMF and other 32-bit output formats is to avoid
64-bit sized fixups, which normally isn't too hard.
[hpa: shortened the option name to --allow-64-bit, minor code cleanups]
Signed-off-by: Knut St. Osmundsen <bird-nasm@anduin.net>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Add the CLFLUSHOPT instruction from the Intel Instruction Set
Architecture Extensions document version 319433-018 (Feb 2014).
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Add the XSAVEC, XSAVES, and XRSTORS instructions from the Intel SDM
release 253665-050US (Feb 2014).
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
[nosplit eax] has been encoded as [eax*1+0] since 0.98.34.
But this seems like unexpected behavior.
So only when a register is multiplied, that will be treated
as an index. ([nosplit eax*1] -> [eax*1+0])
Document is updated accordingly.
Signed-off-by: Jin Kyu Song <jin.kyu.song@intel.com>
[nosplit eax+eax] was encoded [eax*2] previously but
this seems against the user's intention.
So in this case, nosplit is ignored now and [eax+eax] will be
generated.
Document is also updated accordingly.
Signed-off-by: Jin Kyu Song <jin.kyu.song@intel.com>
Added bnd warning and nobnd prefix. DEFAULT directive section
has got more description about BND-related settings.
Signed-off-by: Jin Kyu Song <jin.kyu.song@intel.com>
Allow specifying {vex3} or {vex2} (the latter is currently always
redundant, unless we end up with instructions at some point can be
specified with legacy prefixes or VEX) to select a specific encoding
of VEX-encoded instructions.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Added the list of features added since 2.10 release.
Nasmdoc is also updated with those new features.
Signed-off-by: Jin Kyu Song <jin.kyu.song@intel.com>
Quote filenames for Make when generated for filenames internally.
Only skip quoting when using the -MT option (rather than -MQ).
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
The NASM 2.09 preprocessor allows some illogical constructs, but which
unfortunately has been found in real code in the field. We need
a compatibility solution or a pragma before we can avoid that.
However, we need the other features in NASM 2.10 to come out, so
revert the preprocessor changes for now.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
The default page-centered position doesn't work too well with the
title and the new logo, so move the new logo down the page a bit.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Allow specifying an offset from the computed position of the EPS logo:
\M{logoxadj}{adjustment}
\M{logoyadj}{adjustment}
The adjustment is given in Postscript points (1/72" = 0.352778 mm) and
using the Postscript coordinate system, with the origin in the lower
left.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Onle one change here but wrong instruction encoding is
pretty serious error which desrves to go into new stable
release.
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
We use -Ox by default since Nasm-2.09 so "-O0" is not
longer "default" option. But first paragraph still has
the reference which confuses people. Get rid of it.
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Feel free to update this text as well,
and check it please for being more/less
readable.
CC: Keith Kanios <keith@kanios.net>
CC: "H. Peter Anvin" <hpa@zytor.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
And describe it in documentation. We've introduced
sectalign in 2.09rc series and have to provide an
ability to steer this feature.
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Since %rep counter is a 64 bit signed integer we have to use some
"maximum possible value" limit (upper bound) otherwise there may be
a situation when %rep counter is 0 or even negative while user
has been passing big positive integer value.
Reported-by: nasm64developer
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Two fixes:
1. Optimization of [bx+0xFFFF] etc
0xFFFF is an sbyte under 16-bit semantics,
so make sure to check it right.
2. Don't optimize displacements in -O0
Displacements that fit into an sbyte or
can be removed should *not* be optimized in -O0.
Implicit zero displacements are still optimized, e.g.:
[eax] -> 0 bit displacement, [ebp] -> 8 bit displacement.
However explicit displacements are not optimized:
[eax+0] -> 32 bit displacement, [ebp+0] -> 32 bit displacement.
Because #2 breaks compatibility with 0.98,
I introduced a new optimization level: -OL, legacy.
Allow non-identifier characters in the name of environment variables,
by surrounding them with string quotes (subject to ordinary
string-quoting rules.)
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
We still miss Chuck, but I don't think we can really say anymore we're
doing this particular release in his memory.
Requiescat in pace, our friend.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Make -Ox the default; it's the optimization level expected by most
users, and it is clearly still causing confusion that it has to be
specified manually.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
inslist.src is an intermediate file, it should be in "make clean"
rather than "make spotless"; otherwise it ends up in the xdoc tarball.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Due to previous commit empty line was occasionally
removed which make text harder to read. Restore it.
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
We've a problem in supporting [i]rmacro, exitmacro
facilities at moment.
In a sake of not holding new NASM release any longer these
directives are just marked as being "forbidden".
This allow us to not squash much changes in current source
code base but remain on a safe side same time.
Reviewed-by: Keith Kanios <keith@kanios.net>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
This reverts commit 3012d5d430.
nasm64developer pointed out that we still have this
limit in label.c (IDLEN_MAX).
Reported-by: nasm64developer
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
We always allocate enough memory to hold identifiers
with any length. So lets remove restriction from
documentation.
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Fix case where \\ needs to be written as \\\\ in order to appear as a
double backslash. Also add mention of release candidates and
snapshots.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
It isn't just invalid UTF-8 sequences that are affected; it is in fact
any high-bit bytes (we don't ever try to construct UTF-8 characters,
just deconstruct them.)
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Revert to original %+ behavior. This is what we really wanted in the
first place, except this time we have fixed some bugs.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Update user-visible changes so far. Since I consider the license
change alone to be big enough of a deal to justify a "real" version
number, make this version 2.07.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
We seem to use the term "extensions" to mean anything that is specific
to an object format, so continue to do so.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Add support for directly generating Intel hex or Motorola S-records.
These formats are commonly used with ROM burners.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
This adds copyright verbiage to the Perl scripts. Scripts that are
known to be clean w.r.t. the 2-clause BSD license are given that
license; unclear ones are given the "LGPL for now".
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Move backend-specific code into the output/ directory, and make the
null debugging backend a separate file (it certainly isn't needed for
ndisasm...)
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Eliminiate hard-coded section numbers, at least to the best of our
ability. There is still a very odd piece of computation in
elf_build_reltab() which I can't really figure out...
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Add something approaching real ELF header files.
Begin merging the common ELF code, beginning with the section name
detection.
Drop automatic generation of .comment section, and in particular the
treatment of .common as a special section (if we decide generating
.comment is still a good idea, we should just do it as a macro.)
Augment the list of known sections, and make it table-driven.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
I realized that a documentation change is required to inform users about the
addition of entry point support for the as86 format. The following produces
reasonable output for .txt output, but I am blind and so can't check the
other formats as readily.
The implication that %line allows NASM to digest cpp output is just
plain wrong, at least without additional intermediate processing. Be
a little more circumspect.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Minimize the TLS documentation examples (we don't need "dword" in a
mov from ebx, for example.) This is just to avoid user confusion.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Explicitly document that %[...] and macro parameters concatenate the
same way, and cross-reference the two.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>