We need to add the byte offset into the floating-point value to get
the correct result for these floating point to integer conversions.
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
-Lw really is only useful to debug NASM crashes, and can hugely slow
down the assembler. Make -L+ simply imply full verbosity; if NASM
crashes use -Lw+ instead.
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
Most SSE instructions were missing memory operand sizes, resulting in
error if a memory operand was specified with explicit size.
Reported-by: <nemeth.marton@hotmail.com>
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
It is important for programmers to be able to know when new constructs
were introduced, as they may have backwards compatibility needs and
thus need to know to avoid a construct that is too new.
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
The %? and %?? tokens are ambiguous when used inside a multi-line
macro. Add tokens %*? and %*?? that only expand during single-macro
expansion.
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
Yet another place in the documentation where the copyright year comes
in. Instead of having to deal with it manually over and over, add
support for inserting the metadata strings as macros in the output.
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
Updating the copyright year in the header isn't sufficient. To make it
harder to mess up, move the year metadata tag to the header just below
the copyright statement itself.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
All the backends support code paragraphs 80+ characters wide (85 for
HTML, 90 for PDF) without overrunning the margins. Avoid the noise.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Ghostscript no longer recommends adding the .setpdfwrite operator when
producing PDF; in fact:
.setpdfwrite
This operator is now deprecated, and its use is discouraged
Presumably it was never actually necessary, so just drop it.
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
Support generating bfloat16 constants. This is a bit awkward, as "DW"
already generates IEEE half precision constants; therefore there is no
longer a single floating-point format for each size. This requires
some replumbing.
Fortunately bfloat16 fits in 64 bits, so support generating them with
a macro that uses __?bfloat16?__() to convert to integers first before
passing them to DW.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
NASM now supports a proper superset of cpp line number markers, so
there is no need to hack around them using the
"prepreprocessor". Instead, just put a quick test in do_directive()
treating it just like %line, except convert a "-quoted string into a
`-quoted string.
(This can break if there is a ` or \" sequence in the string... fix
that at some point. This is still much better than what there is now.)
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
NASM would incorrectly only allow for the alignment to be increased,
even when overridden by the user. Allow the user to specify any
alignment value and have it override the partition type default.
The user can increade their own alignment value specification later,
of course, and the sectalign directive will present a floor for either
kind of specification.
Reported-by: Dale Curtis <dalecurtis@chromium.org>
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
It appears that at least with the Adobe Source fonts:
'hyphen' -> U+002D (ASCII)
'minus' -> U+2212
This is ugly for cut & paste purposes.
Reported-by: C. Masloch <pushbx@ulukai.org>
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
There is no reason to mention an ancient Amiga assembler as the source
for INCBIN, especially since it is supported by quite a few other
assemblers.
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
Use a percentage size modifier for code/pre, which hopefully should
allow it to respect enclosing size modifications (for headings.)
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
Document new operators, removal of special casing for %if, and the
MASM-like enhancements to the Dx directives.
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
Significantly improve the portability/reliability of a general
make command. Build a .pdf.xz version of the documentation,
using an uncompressed pdf as basis.
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
It turns out that we need a Fontmap file after all, *and* -I. to make
gs find it. Inconsistent results came from stray Fontmap files from
previous debug attempts.
Now generate both fontpath and Fontmap, and hopefully at least one of
them should work. We might, in fact, need both, one for gs to know
where the files are and one for gs to know it is allowed to read them.
The core problem seems to be that gs will find OTF fonts by its normal
discovery mechanisms, but for some reason don't seem to use them
unless it can find them in a Fontmap, Font directory, of CIDFont
directory.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Enough users expect the namespace starting with underscore to be safe
for symbols. Change our private namespace from __foo__ to
__?foo?__. Use %defalias to provide backwards compatiblity (by using
%defalias instead of %define, we handle the case properly where the
user changes the value.)
Add a preprocessor directive:
%aliases off
... to disable all smacro aliases and thereby making the namespace
clean.
Finally, fix infinite recursion when seeing %? or %?? due to
paste_tokens(). If we don't paste anything, the expansion is done.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Seems like Ghostscript has managed to break fontconfig support again,
at least in Fedora 30. Help Ghostscript along by giving it an explicit
font path.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
note, preinit_array, init_array, and fini_array are ELF section types
that can matter to the assembly programmer.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Dead code elimination in ELF uses separate ELF sections for every
functions or data items that may be garbage collected. This can end up
being more than 32,633 sections which, when the ELF internal and
relocation sections are added in, can exceed the legacy ELF maximum of
65,279 sections.
Newer versions of the ELF specification has added support for much
larger number of sections by putting a place holder value (usually
SHN_XINDEX == 0xffff, but 0 in some cases) into fields where the
section index is a 16-bit value, and storing the full value in a
diffent place: the program header uses entries in section header 0,
the symbol table uses an auxiliary segment with the additional
indicies; the section header did not need it as the sh_link field is
already 32 (or 64) bits long.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>