platform/upstream/nasm.git
16 years agoopenwcom.mak: wmake uses & for continuation, not \ (sigh)
H. Peter Anvin [Tue, 20 May 2008 21:42:53 +0000 (14:42 -0700)]
openwcom.mak: wmake uses & for continuation, not \ (sigh)

wmake uses & for continuation, since \ is used for pathname
separators.

16 years agoReadability improvements for regdis.c
H. Peter Anvin [Tue, 20 May 2008 21:38:21 +0000 (14:38 -0700)]
Readability improvements for regdis.c

16 years agonetware.mak: correct dependencies
H. Peter Anvin [Tue, 20 May 2008 21:35:34 +0000 (14:35 -0700)]
netware.mak: correct dependencies

The Makefile uses VPATH and stripped directory names for files, so
generate the dependencies accordingly.

16 years agordx: Add cast avoid warning from gcc
H. Peter Anvin [Tue, 20 May 2008 21:25:36 +0000 (14:25 -0700)]
rdx: Add cast avoid warning from gcc

Avoid a warning from gcc about casting an integer of different size to
a pointer.

16 years agoAvoid #including .c files; instead compile as separate units
H. Peter Anvin [Tue, 20 May 2008 21:21:29 +0000 (14:21 -0700)]
Avoid #including .c files; instead compile as separate units

Don't #include .c files, even if they are auto-generated; instead
compile them as separate compilation units and let the linker do its
job.

16 years agoPTEST is SSE4.1; although AMD says it's SSE5.
H. Peter Anvin [Tue, 20 May 2008 20:07:09 +0000 (13:07 -0700)]
PTEST is SSE4.1; although AMD says it's SSE5.

Fix this when we have proper support for feature sets, or forget about
the concept entirely.

16 years agoinsns.pl: don't require whitespace before / or \
H. Peter Anvin [Tue, 20 May 2008 20:03:39 +0000 (13:03 -0700)]
insns.pl: don't require whitespace before / or \

Use Perl's context-sensitive regular expressions to tell split that a
slash or backslash begins a new operator.

16 years agonasm.h: remove obsolete IP_REG definitions
H. Peter Anvin [Tue, 20 May 2008 18:47:01 +0000 (11:47 -0700)]
nasm.h: remove obsolete IP_REG definitions

16 years agoAdd DY, YWORD, and the SY instruction flag
H. Peter Anvin [Tue, 20 May 2008 18:43:53 +0000 (11:43 -0700)]
Add DY, YWORD, and the SY instruction flag

Add the DY instruction, YWORD keyword, and an SY marker for
instruction sizes.  Add a few more AVX sample instructions.

16 years agoinsns.pl: support operands that serve double duty
H. Peter Anvin [Tue, 20 May 2008 18:23:18 +0000 (11:23 -0700)]
insns.pl: support operands that serve double duty

Sometimes assembly syntax wants to permit a single operand to serve
multiple functions; allow this.

The disassembler could really use to be smarter about those.

16 years agoinsns.dat: no subheader for "must be last"
H. Peter Anvin [Tue, 20 May 2008 18:05:59 +0000 (11:05 -0700)]
insns.dat: no subheader for "must be last"

16 years agoinsns.dat: make even wider to make space for AVX
H. Peter Anvin [Tue, 20 May 2008 18:04:26 +0000 (11:04 -0700)]
insns.dat: make even wider to make space for AVX

The AVX instructions take more space, so add a few tab stops across
the entire file.

16 years agoinsns.dat: use compiler-generated bytecodes for AVX
H. Peter Anvin [Tue, 20 May 2008 18:01:28 +0000 (11:01 -0700)]
insns.dat: use compiler-generated bytecodes for AVX

Use compiler-generated bytecodes for the AVX instruction demos.  This
should make it a lot easier for other people (HINT, HINT) to add the
instruction table.

16 years agoinsns.pl: fix regex subgroup of /is4= codes
H. Peter Anvin [Tue, 20 May 2008 17:48:22 +0000 (10:48 -0700)]
insns.pl: fix regex subgroup of /is4= codes

The argument is now $1, not $2...

16 years agoinsns.pl: fix splitting of bracketted operations
H. Peter Anvin [Tue, 20 May 2008 17:39:15 +0000 (10:39 -0700)]
insns.pl: fix splitting of bracketted operations

16 years agoOpcode listing notation is /is4, consistently
H. Peter Anvin [Tue, 20 May 2008 17:29:11 +0000 (10:29 -0700)]
Opcode listing notation is /is4, consistently

16 years agoUse the \360..\363 annotations for SSE prefixes
H. Peter Anvin [Tue, 20 May 2008 17:21:57 +0000 (10:21 -0700)]
Use the \360..\363 annotations for SSE prefixes

16 years agoSame some space by introducing shorthand byte codes for SSE prefixes
H. Peter Anvin [Tue, 20 May 2008 16:46:24 +0000 (09:46 -0700)]
Same some space by introducing shorthand byte codes for SSE prefixes

Properly done, all SSE instructions which has the 66/F2/F3 opcode
multiplex need two prefixes: one to control the use of OSP and one to
control the use of REP.  However, it's a four-way select: np/66/F2/F3;
so introduce shorthand bytecodes for that purpose.

16 years agoAllow explicit immediate syntax for imz2 as well as is4
H. Peter Anvin [Tue, 20 May 2008 16:36:41 +0000 (09:36 -0700)]
Allow explicit immediate syntax for imz2 as well as is4

imz2 is just an alias for is4 as far as we are concerned...

16 years agoinsns.pl: escape literal special character in regex
H. Peter Anvin [Tue, 20 May 2008 04:10:14 +0000 (21:10 -0700)]
insns.pl: escape literal special character in regex

In Perl code, it is good practice to escape special characters
intended to be literal.

16 years agoBytecode compiler: add support for is4/imz2 operands
H. Peter Anvin [Tue, 20 May 2008 04:07:08 +0000 (21:07 -0700)]
Bytecode compiler: add support for is4/imz2 operands

16 years agoMore work on bytecode compiler (not finished yet...)
H. Peter Anvin [Tue, 20 May 2008 02:08:03 +0000 (19:08 -0700)]
More work on bytecode compiler (not finished yet...)

More work on the bytecode compiler.  Not all useful bytecodes are
implemented yet, however.

16 years agoinsns.pl: first steps toward a "smart" bytecode compiler
H. Peter Anvin [Tue, 20 May 2008 01:19:42 +0000 (18:19 -0700)]
insns.pl: first steps toward a "smart" bytecode compiler

First steps toward a smart(er) bytecode compiler, using a syntax that
can be more directly taken from the manuals.

16 years agoMake insnsb.c an actual compilation unit
H. Peter Anvin [Tue, 13 May 2008 21:29:47 +0000 (14:29 -0700)]
Make insnsb.c an actual compilation unit

"make alldeps" doesn't really like it when included files end in *.c.
Instead of renaming insnsb.c to insnsb.h, make it an actual
compilation unit, since there really isn't any reason for it not to
be.

16 years agoinsnsb.c: use 5 digits for index, not 4
H. Peter Anvin [Mon, 12 May 2008 22:28:33 +0000 (15:28 -0700)]
insnsb.c: use 5 digits for index, not 4

We already have indexes up to 9500, so use 5 digits instead of 4.

16 years agoMake MAX_OPERANDS a parameter in insns.pl as well
H. Peter Anvin [Mon, 12 May 2008 18:36:24 +0000 (11:36 -0700)]
Make MAX_OPERANDS a parameter in insns.pl as well

MAX_OPERANDS is present in insns.pl as well (although proper C
compilers shouldn't need this kind of zero padding.)  Make sure it's
clear to everyone.

16 years agoRemove special hacks to avoid zero bytecodes
H. Peter Anvin [Mon, 12 May 2008 18:13:41 +0000 (11:13 -0700)]
Remove special hacks to avoid zero bytecodes

We can now have zero bytecodes with impunity, so remove any special
hacks we had to avoid zeroes in the bytecode.

16 years agoGenerate a byte array instead of using strings for the byte codes
H. Peter Anvin [Mon, 12 May 2008 18:00:50 +0000 (11:00 -0700)]
Generate a byte array instead of using strings for the byte codes

Generate a byte array instead of using C compiler strings for the byte
codes.  This has a few advantages:

- No need to special-case zero due to broken C compilers.
- Only insns.pl only ever reads the string, so we can invent our own
  syntax.
- Compaction.
- We can give it the proper, unsigned type.

16 years agoFactor out string decoder in insns.pl
H. Peter Anvin [Mon, 12 May 2008 17:17:27 +0000 (10:17 -0700)]
Factor out string decoder in insns.pl

Factor out the string decoder into its own subroutine.  This will be
useful shortly ;)

16 years agoAdd support for register-number immediates with fixed 4-bit values
H. Peter Anvin [Wed, 7 May 2008 03:11:14 +0000 (20:11 -0700)]
Add support for register-number immediates with fixed 4-bit values

Add support for imm8 bytes which has a register value in the top four
bits and an arbitrary fixed value in the bottom four bits.

16 years agoFix encoding of VPERMIL2PS instructions
H. Peter Anvin [Wed, 7 May 2008 03:06:14 +0000 (20:06 -0700)]
Fix encoding of VPERMIL2PS instructions

16 years agoActually spell "Sandy Bridge" correctly
H. Peter Anvin [Wed, 7 May 2008 02:58:52 +0000 (19:58 -0700)]
Actually spell "Sandy Bridge" correctly

16 years agoSandy Bridge, not Sandy Banks; add Westmere
H. Peter Anvin [Wed, 7 May 2008 02:54:28 +0000 (19:54 -0700)]
Sandy Bridge, not Sandy Banks; add Westmere

16 years agoInitial NDISASM support for AVX instructions/VEX prefixes
H. Peter Anvin [Tue, 6 May 2008 01:47:27 +0000 (18:47 -0700)]
Initial NDISASM support for AVX instructions/VEX prefixes

Initial NDISASM support for AVX instructions and VEX prefixes.  It
doesn't mean it's correct, but it seems to match my current
understanding.  It can disassemble *some*, but not *all*, of the AVX
test cases (which are known to be at least partially incorrect...)

16 years agoThe AVX R,X,B, and V fields (but not W) are inverted.
H. Peter Anvin [Mon, 5 May 2008 06:15:13 +0000 (23:15 -0700)]
The AVX R,X,B, and V fields (but not W) are inverted.

The AVX test cases are still not generated correctly, though.

16 years agoFirst cut at AVX machinery.
H. Peter Anvin [Mon, 5 May 2008 00:53:31 +0000 (17:53 -0700)]
First cut at AVX machinery.

First cut at AVX machinery support.  The only instruction implemented
is VPERMIL2PS, and it's probably buggy.  I'm checking this in with the
hope that other people can start helping out with (a) testing this,
and (b) adding instructions.

NDISASM support is not there yet.

16 years agoInitial support for YMM (AVX) registers
H. Peter Anvin [Tue, 22 Apr 2008 02:44:55 +0000 (22:44 -0400)]
Initial support for YMM (AVX) registers

Add support for ymm0..15 registers, and the "ymmreg" qualifier.
No support yet for "yword" or "dy".

16 years agoAvoid long line warning when generating nasm docs
Charles Crayne [Sat, 12 Apr 2008 20:35:43 +0000 (13:35 -0700)]
Avoid long line warning when generating nasm docs

rdsrc.pl limits lines to 68 characters for some formats

16 years agoAvoid some warnings in rdoff/rdf2bin.c
Bo Borgerson [Sat, 12 Apr 2008 15:47:57 +0000 (11:47 -0400)]
Avoid some warnings in rdoff/rdf2bin.c

I received some warnings when running make on the head revision of
nasm from git:

----
rdf2bin.c: In function 'main':
rdf2bin.c:122: warning: comparison between signed and unsigned
rdf2bin.c:123: warning: comparison between signed and unsigned
rdf2bin.c:124: warning: comparison between signed and unsigned
----

I think these warnings are innocuous and should be safely avoidable
with simple casts (please see attached patch).

* rdoff/rdf2bin.c
(main): cast to size_t for comparison with fwrite return value

Signed-off-by: Bo Borgerson <gigabo@gmail.com>
16 years agoTemporaries in macros need a unique prefix; WSAA*() macros to header
H. Peter Anvin [Thu, 10 Apr 2008 21:56:09 +0000 (14:56 -0700)]
Temporaries in macros need a unique prefix; WSAA*() macros to header

When using temporaries in macros, given them a unique prefix to avoid
namespace collisions when using one macro inside another.

Move the WSAA*() macros from outelf32/outelf64 to a separate header
file.

16 years agoautogen.sh: remove config.status
H. Peter Anvin [Thu, 10 Apr 2008 21:54:02 +0000 (14:54 -0700)]
autogen.sh: remove config.status

Remove config.status when rebuilding the autoconf files.

16 years agoDocument avaiabily of DWARF for ELF32 and ELF64
Charles Crayne [Mon, 7 Apr 2008 21:26:29 +0000 (14:26 -0700)]
Document avaiabily of DWARF for ELF32 and ELF64

16 years agoCorrectly identify dwarf support for elf32
Charles Crayne [Mon, 7 Apr 2008 20:15:53 +0000 (13:15 -0700)]
Correctly identify dwarf support for elf32

Change architecture tag to i386.

16 years agoCorrectly identify SBYTE in the optimizer
H. Peter Anvin [Fri, 4 Apr 2008 20:34:53 +0000 (13:34 -0700)]
Correctly identify SBYTE in the optimizer

Correctly identify SBYTE in the optimizer, *HOWEVER*, this change will
cause nuisance warnings to be issued; that will have to be fixed.

16 years agoRestore critical expression checking when optimizer enabled
Charles Crayne [Thu, 27 Mar 2008 00:20:21 +0000 (17:20 -0700)]
Restore critical expression checking when optimizer enabled

In the prior code, enabling optimization effectively diabled
critical expression checking, because the optimization passes
took place before checking was enabled.

16 years agoMerge branch 'master' of git+ssh://ccrayne@repo.or.cz/srv/git/nasm
Charles Crayne [Sun, 23 Mar 2008 03:08:20 +0000 (20:08 -0700)]
Merge branch 'master' of git+ssh://ccrayne@repo.or.cz/srv/git/nasm

16 years agoRemove KATMAI support for CLFLUSH
Charles Crayne [Sun, 23 Mar 2008 03:07:08 +0000 (20:07 -0700)]
Remove KATMAI support for CLFLUSH

Minimal cpu level is WILLAMETTE,SSE2

16 years agoRemove redundant, bogus CLFLUSH entry
H. Peter Anvin [Sun, 23 Mar 2008 02:33:31 +0000 (19:33 -0700)]
Remove redundant, bogus CLFLUSH entry

16 years agoBetter handling of 32-bit imms in 64-bit moves
H. Peter Anvin [Wed, 19 Mar 2008 21:52:27 +0000 (14:52 -0700)]
Better handling of 32-bit imms in 64-bit moves

A much better way to handle the 32-bit immediates in 64-bit moves.
Add a test file.

16 years agoinsns.dat: add "MOV reg64,imm32" as a special rule
H. Peter Anvin [Wed, 19 Mar 2008 21:42:20 +0000 (14:42 -0700)]
insns.dat: add "MOV reg64,imm32" as a special rule

Add "MOV reg64,imm32" as a special rule, to handle the case of
"mov rax,dword <foo>", where <foo> is sign-extended; this is a 7-byte
form, as opposed to "mov eax,<foo>" (5 bytes) and "mov rax,<foo>" (10
bytes).

At some point, the optimizer needs to be able to handle these.

16 years agoCorrect opcode for CLFLUSH
Charles Crayne [Tue, 18 Mar 2008 22:21:14 +0000 (15:21 -0700)]
Correct opcode for CLFLUSH

Correct opcode is 0FAEh

16 years agoDisplay fully qualified local label in "not defined" message
Charles Crayne [Thu, 13 Mar 2008 05:39:03 +0000 (22:39 -0700)]
Display fully qualified local label in "not defined" message

Add new function "local_scope" to label subsystem to
return the previous non-local label for a given local label,
and invoke this funcion in eval.c to display the fully
qualified name in the "not defined" error message.

16 years agoAdjust symbol number for global symbols
Charles Crayne [Tue, 4 Mar 2008 22:25:34 +0000 (14:25 -0800)]
Adjust symbol number for global symbols

Reloc entries were pointing to wrong target section

16 years agoEliminate duplicate symbol definitions
Charles Crayne [Mon, 3 Mar 2008 22:43:55 +0000 (14:43 -0800)]
Eliminate duplicate symbol definitions

Don't accept -1 as an odd numbered segment

16 years agoReport dwarf as V2 for ELF32
Charles Crayne [Mon, 25 Feb 2008 05:05:46 +0000 (21:05 -0800)]
Report dwarf as V2 for ELF32

Older versions of gdb reject version 3

16 years agoDwarf3 support for ELF32
Charles Crayne [Mon, 25 Feb 2008 03:14:17 +0000 (19:14 -0800)]
Dwarf3 support for ELF32

1. Port dwarf3 support from ELF64 to ELF32
2. Move common SAA extentions to nasmlib

16 years agoDwarf support tweeks and clean-up
Charles Crayne [Sun, 24 Feb 2008 02:35:11 +0000 (18:35 -0800)]
Dwarf support tweeks and clean-up

1. Add relocation entries for dwarf sections.
2. Combine common dwarf and stabs routines.

16 years agoNASM 2.02
H. Peter Anvin [Tue, 19 Feb 2008 19:01:08 +0000 (11:01 -0800)]
NASM 2.02

16 years agooutform: make OF_DOS include OF_COFF
H. Peter Anvin [Mon, 18 Feb 2008 02:54:13 +0000 (18:54 -0800)]
outform: make OF_DOS include OF_COFF

DJGPP uses COFF as the file format.  Since DJGPP is widely used in the
(remaining) DOS world, include OF_COFF in OF_DOS.

16 years agoAdd %ifempty and variants
H. Peter Anvin [Sun, 17 Feb 2008 01:01:40 +0000 (17:01 -0800)]
Add %ifempty and variants

16 years agoCHANGES: Document %iftoken
H. Peter Anvin [Sun, 17 Feb 2008 00:46:45 +0000 (16:46 -0800)]
CHANGES: Document %iftoken

16 years agoNASM 2.02rc2
H. Peter Anvin [Sun, 17 Feb 2008 00:44:46 +0000 (16:44 -0800)]
NASM 2.02rc2

16 years agoImplement %iftoken, test for a single token
H. Peter Anvin [Sun, 17 Feb 2008 00:41:25 +0000 (16:41 -0800)]
Implement %iftoken, test for a single token

Implement %iftoken, a test for a single token.  This is useful in
cases using %+ to splice a macro-provided token.

16 years agoOpenWatcom: optimize for 686
H. Peter Anvin [Sat, 16 Feb 2008 23:44:24 +0000 (15:44 -0800)]
OpenWatcom: optimize for 686

Apparently -6 compiles are defined to run on anything 386 or newer,
and just use different instruction timings.

16 years agoSome compilers define __386__ instead of __i386__
H. Peter Anvin [Sat, 16 Feb 2008 23:28:02 +0000 (15:28 -0800)]
Some compilers define __386__ instead of __i386__

OpenWatcom, and possibly other compilers from the DOS universe,
defines __386__ rather than __i386__.

16 years agoClear up WRITE macros causing compile failures with Watcom
H. Peter Anvin [Sat, 16 Feb 2008 23:25:02 +0000 (15:25 -0800)]
Clear up WRITE macros causing compile failures with Watcom

The OpenWatcom compiler warns about invalid shifts (correctly, it
appears) due to the non-X86_MEMORY versions of the various WRITE
macros.  Fix.

16 years agoBring CHANGES hopefully up to date
H. Peter Anvin [Sat, 16 Feb 2008 23:08:41 +0000 (15:08 -0800)]
Bring CHANGES hopefully up to date

16 years agoUse term "host platform" consistently
H. Peter Anvin [Sat, 16 Feb 2008 22:57:45 +0000 (14:57 -0800)]
Use term "host platform" consistently

16 years agoAdd standard time macro boilerplate to __POSIX_TIME__
H. Peter Anvin [Sat, 16 Feb 2008 22:56:49 +0000 (14:56 -0800)]
Add standard time macro boilerplate to __POSIX_TIME__

16 years agoBR 774131: date and time macros
H. Peter Anvin [Sat, 16 Feb 2008 22:54:10 +0000 (14:54 -0800)]
BR 774131: date and time macros

This checkin creates the following date and time macros:

__DATE__, __TIME__, __UTC_DATE__, __UTC_TIME__: strings

__DATE_NUM__, __TIME_NUM__, __UTC_DATE_NUM__, __UTC_TIME_NUM__:
civil dates in digit-string formats

__POSIX_TIME__: time in POSIX time_t format

16 years agoConstipate the stdmac[] array.
H. Peter Anvin [Sat, 16 Feb 2008 21:58:45 +0000 (13:58 -0800)]
Constipate the stdmac[] array.

16 years agoBR 1582430: Allow numbers with leading + or - for %ifnum
H. Peter Anvin [Sat, 16 Feb 2008 21:44:52 +0000 (13:44 -0800)]
BR 1582430: Allow numbers with leading + or - for %ifnum

Allow numbers with a leading + or - to return true for %ifnum.

16 years agoBR 1893952: XGETBV is not privileged.
H. Peter Anvin [Sat, 16 Feb 2008 21:29:56 +0000 (13:29 -0800)]
BR 1893952: XGETBV is not privileged.

16 years agoAdd XSAVE instruction features (CPU feature is bogus, but oh well.)
H. Peter Anvin [Thu, 14 Feb 2008 19:25:14 +0000 (11:25 -0800)]
Add XSAVE instruction features (CPU feature is bogus, but oh well.)

Add the XSAVE group of instructions: XSAVE, XRSTOR, XGETBV, XSETBV.
The CPU feature information is bogus, but so is our entire handling of
CPU feature sets for anything but the bare necessities (long jump
emulation, etc.)

16 years agoUpgrade dwarf3 support for elf64
Charles Crayne [Thu, 14 Feb 2008 03:58:54 +0000 (19:58 -0800)]
Upgrade dwarf3 support for elf64

Add support for multiple executable segments

16 years agoTest version of dwarf debugging format for elf64
Charles Crayne [Thu, 7 Feb 2008 06:17:55 +0000 (22:17 -0800)]
Test version of dwarf debugging format for elf64

Not ready for prime time, but anyone who is interested
is welcome to help me test.

16 years agoMkfiles/README: document the Netware Makefile.
H. Peter Anvin [Wed, 6 Feb 2008 05:35:08 +0000 (21:35 -0800)]
Mkfiles/README: document the Netware Makefile.

16 years agoAdd Makefile for Netware
H. Peter Anvin [Wed, 6 Feb 2008 05:30:16 +0000 (21:30 -0800)]
Add Makefile for Netware

Add Makefile for Netware, using the GNU toolchain.

16 years agoversion.pl: produce Makefile variables
H. Peter Anvin [Wed, 6 Feb 2008 05:29:32 +0000 (21:29 -0800)]
version.pl: produce Makefile variables

Add a mode to version.pl to produce Makefile variables (used by
Netware Makefile.)

16 years agoFix "carryover" of exclude information from one file to another.
H. Peter Anvin [Wed, 6 Feb 2008 05:27:43 +0000 (21:27 -0800)]
Fix "carryover" of exclude information from one file to another.

my %foo; doesn't mean %foo is initialized to empty, need my %foo = ();
or my %foo = undef; or similar for that.

16 years agoNASM 2.02rc1
H. Peter Anvin [Wed, 30 Jan 2008 22:23:43 +0000 (14:23 -0800)]
NASM 2.02rc1

16 years agoAdd list of changes for 2.02, so far
H. Peter Anvin [Wed, 30 Jan 2008 22:22:17 +0000 (14:22 -0800)]
Add list of changes for 2.02, so far

16 years agoTest for BR 1879590
H. Peter Anvin [Wed, 30 Jan 2008 22:13:46 +0000 (14:13 -0800)]
Test for BR 1879590

16 years agoBR 1879590: More MMX/SSE size fixes
Ismail Dönmez [Wed, 30 Jan 2008 22:09:45 +0000 (14:09 -0800)]
BR 1879590: More MMX/SSE size fixes

Fix more instances of MMX/SSE having "SM" instead of "SQ" or "SO".
This should hopefully resolve bug report 1879590.

16 years agoBR 1880905: make sure we have enough zero-padding data for 'DO'
H. Peter Anvin [Mon, 28 Jan 2008 00:39:26 +0000 (16:39 -0800)]
BR 1880905: make sure we have enough zero-padding data for 'DO'

When using DO with a string that was too short, we would run off the
end of an all-zero buffer.  Make sure the buffer is long enough.

16 years agoPrevent segfault in stabs64_typevalue
Charles Crayne [Sun, 27 Jan 2008 20:49:20 +0000 (12:49 -0800)]
Prevent segfault in stabs64_typevalue

Prevent segfault when type == STT_OBJECT and no symbol
has been defined.

16 years agofloat.c: BR 1879670: fix output byte order
H. Peter Anvin [Fri, 25 Jan 2008 16:11:23 +0000 (08:11 -0800)]
float.c: BR 1879670: fix output byte order

The fix for the memory overwrite output the bytes in the wrong order.
Fix.

16 years agoIgnore ERR_PASS1 except for actual warnings
H. Peter Anvin [Tue, 22 Jan 2008 22:08:36 +0000 (14:08 -0800)]
Ignore ERR_PASS1 except for actual warnings

is_suppressed_warning() should never return true unless we're actually
dealing with a warning.  There is a handful of cases where we pass
ERR_PASS1 down together with errors, but that's mostly because it fits
into an overall pattern.  Thus, ignore it.

16 years agoRAA subsystem: use shift instead of divide
H. Peter Anvin [Tue, 22 Jan 2008 00:33:00 +0000 (16:33 -0800)]
RAA subsystem: use shift instead of divide

Make the RAA size always a power of two, so we can use shifts instead
of multiple, expensive divides.

16 years agopreproc.c: simplify detoken() slightly
H. Peter Anvin [Tue, 22 Jan 2008 00:31:57 +0000 (16:31 -0800)]
preproc.c: simplify detoken() slightly

Probably pointless optimization of detoken()...

16 years agonasmlib.c: log nasm_free() before calling free()
H. Peter Anvin [Tue, 22 Jan 2008 00:29:10 +0000 (16:29 -0800)]
nasmlib.c: log nasm_free() before calling free()

If we're logging nasm_free(), then log it before we actually call
free(); that way we can find out what the last thing was if free()
crashes.

16 years agonasmlib.h: nasm_zalloc() should call nasm_zalloc_log()
H. Peter Anvin [Tue, 22 Jan 2008 00:28:04 +0000 (16:28 -0800)]
nasmlib.h: nasm_zalloc() should call nasm_zalloc_log()

If we're doing logging, we need to call nasm_zalloc_log()

16 years agomisc/findleak.pl: make executable
H. Peter Anvin [Tue, 22 Jan 2008 00:26:32 +0000 (16:26 -0800)]
misc/findleak.pl: make executable

misc/findleak.pl: no text change, but mark file executable.

16 years agonasm.h: make t_type an enum
H. Peter Anvin [Tue, 22 Jan 2008 00:26:05 +0000 (16:26 -0800)]
nasm.h: make t_type an enum

Make t_type an enum to make debugging easier.

16 years agonasm.c: clean up the handing of response files
H. Peter Anvin [Tue, 22 Jan 2008 00:23:59 +0000 (16:23 -0800)]
nasm.c: clean up the handing of response files

Avoid using malloc/free (not nasm_malloc/nasm_free even) in the
processing of response files; move to separate function.

16 years agofloat.c: fix memory overwrite with 8-, 16- or 80-bit constants
H. Peter Anvin [Tue, 22 Jan 2008 00:19:52 +0000 (16:19 -0800)]
float.c: fix memory overwrite with 8-, 16- or 80-bit constants

We incorrectly clobbered 4 extra bytes when serializing 8-, 16- or
80-bit constants.  Be less smart, but actually correct.

16 years agoOpenWatcom makefiles: add DEBUG option
H. Peter Anvin [Tue, 22 Jan 2008 00:18:44 +0000 (16:18 -0800)]
OpenWatcom makefiles: add DEBUG option

Add a Makefile variable, DEBUG, which can be used to set debug options
(-d2, -DLOGALLOC, etc.)

16 years agoFix the options when compiling under OpenWatcom
H. Peter Anvin [Mon, 21 Jan 2008 19:50:31 +0000 (11:50 -0800)]
Fix the options when compiling under OpenWatcom

OpenWatcom needs different strings for compile and link target, so
using -bcl which uses the same string for both is just plain wrong.
This fixes that bit, but running nasm on test/floatx.asm (at least as
a DOS or a Win32 binary) crashes with a NULL pointer reference inside
the C library free() function.

16 years agodoc/Makefile.in: avoid deleting opt_var.txt, fix dependencies
H. Peter Anvin [Mon, 21 Jan 2008 05:50:02 +0000 (21:50 -0800)]
doc/Makefile.in: avoid deleting opt_var.txt, fix dependencies

Fix dependencies in the generation of the instruction list, and make
sure we don't delete opt_var.txt on "make spotless".

16 years agoAdd autogenerated instruction list to NASM documentation
Charles Crayne [Mon, 21 Jan 2008 00:27:03 +0000 (16:27 -0800)]
Add autogenerated instruction list to NASM documentation

1. Allow included files in rdsrc.pl
2. New program inslist.pl to generate instruction list from insns.dat
3. Mark certain comments in insns.dat as documentation subheaders
4. Add Instruction List appendix to nasmdoc.src
5. Update build process to invoke inslist.pl