Commit Graph

715 Commits

Author SHA1 Message Date
H. Peter Anvin
d119ce6f9a saa_fread/fwrite: when seeking, must set [rw]ptr as well
[rw]ptr represent the global position and need to be kept in sync with
[rw]pos:[rw]blk at all times.  Failed to do that while seeking, with
obviously bad results.
2007-10-10 18:07:51 -07:00
H. Peter Anvin
6867acc18e Use the compiler-provided booleans if available, otherwise emulate
Both C and C++ have "bool", "true" and "false" in lower case; C
requires <stdbool.h> for this, in C++ it is an inherent type built
into the compiler.  Use those instead of the old macros; emulate with
a simple typedef enum if unavailable.
2007-10-10 14:58:45 -07:00
H. Peter Anvin
be1b83d24a owlinux.mak: don't clean things we won't be able to
There won't be a Makefile in rdoff in particular, so trying to run
"make clean" there is pointless.
2007-10-10 14:55:14 -07:00
H. Peter Anvin
38a1b8ae9f configure.in: looks like we need autoconf 2.61 :(
AC_USE_SYSTEM_EXTENSIONS is really, *really* useful, but apparently
requires autoconf 2.61...
2007-10-10 14:29:53 -07:00
H. Peter Anvin
fd7dd11345 Create option -Ox to tell NASM to do unlimited passes
Add option -Ox to tell NASM to do as many passes as it needs, instead
of imposing a fixed number.
2007-10-10 14:06:59 -07:00
H. Peter Anvin
f57f55c9cb Revert "floatb.asm: fix broken testcase"
This reverts commit d9e3116be1.

0x513c1704 is 50.49e9, not 50.40e9
2007-10-08 19:26:57 -07:00
H. Peter Anvin
d9e3116be1 floatb.asm: fix broken testcase
50.40e9 as a 32-bit float is 0x513c1704
2007-10-08 18:39:24 -07:00
H. Peter Anvin
73ab71f905 saa_rstruct: fix overrun check
The direction of the overrun test in saa_rstruct was backwards.
2007-10-08 12:41:00 -07:00
H. Peter Anvin
36a8f95bd0 Add Frank's floattest.asm test file 2007-10-08 12:12:23 -07:00
H. Peter Anvin
a44b587b14 saa_fpwrite: initializing "len" should be part of the loop
"len" should properly be initialized on every turn of the loop.  It
can be initialized to any value >= blk_len that fits in a size_t.
(size_t)~0 would work except for any possible noncompliant C compilers
that have a signed size_t (illegal per C99 7.17.2).
2007-10-07 21:13:14 -07:00
Charles Crayne
43f699b9bd Fix infinite loop in function saa_fpwrite 2007-10-07 18:46:57 -07:00
H. Peter Anvin
30c3ad1024 zerobyte.asm: use a real instruction to avoid confusing ndisasm
It's useful to be able to disassemble a test case, so avoid mixing
data bytes and code.
2007-10-05 17:44:16 -07:00
H. Peter Anvin
653e03bef5 zerobyte.asm: add test cases for non-initial \170 uses
Add test cases for noninitial uses of \170, in order to test for
accidental duplication of REX prefixes.
2007-10-05 17:42:31 -07:00
H. Peter Anvin
5d4fd7accc Check in the proper zerobyte test
The previous checkin checked in zerobyte.bin, not zerobyte.asm
2007-10-05 17:29:01 -07:00
H. Peter Anvin
c189b44032 Emit REX prefix before literal zero (\170) 2007-10-05 17:04:32 -07:00
H. Peter Anvin
a7abb7536d LICENSE: Break long line 2007-10-05 17:01:15 -07:00
H. Peter Anvin
9d14a10858 Add test for problematic floats 2007-10-05 14:36:03 -07:00
H. Peter Anvin
6b74577d7f floatx.asm: add Inf and NaN to the boundary condition tests 2007-10-04 23:51:08 -07:00
H. Peter Anvin
6b8abf54d3 floatx.asm: add specific tests for exponent boundary conditions
Add tests for the exponent boundaries (underflow, denorm, normal).
2007-10-04 23:09:19 -07:00
H. Peter Anvin
cdb227fa71 float.c: correct the exponent
We would accidentally produce an exponent which was exactly +1 from
the correct one.
2007-10-04 22:51:08 -07:00
H. Peter Anvin
b8e604eb5d Additional rules in test/Makefile
Add rules for .pl -> .asm
2007-10-04 15:18:23 -07:00
H. Peter Anvin
9d637df6da Rewrite the handling of SAA's to allow random access
SAA's were never intended to allow random access, but several backends
do random or semirandom access via saa_fread() and saa_fwrite()
anyway.  Rewrite the SAA system to allow for efficient random access.

On "label.pl 10000000" this improves performance by a factor of 12.
2007-10-04 13:42:56 -07:00
H. Peter Anvin
12e46510bc Change cloc_t to struct location, and reorder the members
Change cloc_t to struct location, and reorder the members so that it
should fit in 16 bytes instead of needing 8 bytes of extra padding on
64-bit machines.
2007-10-03 21:30:57 -07:00
H. Peter Anvin
bfc1712137 BR 1352920: change loc_t -> cloc_t
Change loc_t to cloc_t to avoid AIX conflict.
We really shouldn't use _t names at all; they are usually considered
platform types, but worry about that later.
2007-10-03 21:24:51 -07:00
H. Peter Anvin
0a98f6046d BR 1352920: Handle upper case %line 2007-10-03 21:22:16 -07:00
H. Peter Anvin
8f303505ea Use autoconf to request feature macros 2007-10-03 17:40:12 -07:00
H. Peter Anvin
476d2864b0 preproc.c: constipation
Add "const" in suitable places
2007-10-02 22:04:15 -07:00
H. Peter Anvin
4d13bdc72f make alldeps 2007-10-02 21:57:27 -07:00
H. Peter Anvin
fe501957c0 Portability fixes
Concentrate compiler dependencies to compiler.h; make sure compiler.h
is included first in every .c file (since some prototypes may depend
on the presence of feature request macros.)

Actually use the conditional inclusion of various functions (totally
broken in previous releases.)
2007-10-02 21:53:51 -07:00
H. Peter Anvin
4a8daf0607 Run "make alldeps".
Run "make alldeps".  This stuff probably shouldn't be checked in...
2007-10-02 21:13:18 -07:00
H. Peter Anvin
a59795c986 Use the crc64 we already use as the perfect hash function prehash
Use the same crc64 that we already use for the symbol table hash as
the perfect hash function prehash.  We appear to get radically faster
convergence this way, and the crc64 is probably *faster*, since the
table likely to be resident in memory.
2007-10-02 17:40:00 -07:00
H. Peter Anvin
17394a7d8e insns.dat: add systematic names for the hinting NOPs (0F18-0F1F)
0F 18-1F are reserved for hinting NOPs; they all take a single memory
operand which may be sized.  Allow the use of systematic names; this
also makes sure they get sensibly disassembled.
2007-10-02 15:09:33 -07:00
H. Peter Anvin
c147da0d28 Unspecified files are null strings, not null pointers
We use empty strings, not null pointers, for unspecified files, so
there is no need to compare them for nullness.
2007-10-01 11:28:32 -07:00
H. Peter Anvin
59ddd26aac Check for the most basic filename overlaps
Check for the most basic filename overlaps, in case we have the
opportunity to save the user from himself.
2007-10-01 11:26:31 -07:00
Charles Crayne
fcce07f171 modified: nasm.1 to add newer command line options
modified:   nasm.c to fully parse command line before redirecting stderr.
2007-09-30 22:15:36 -07:00
Charles Crayne
b001e89859 Merge branch 'master' of git+ssh://ccrayne@repo.or.cz/srv/git/nasm 2007-09-28 21:27:41 -07:00
H. Peter Anvin
a3d1ccd8ab configure.in: AC_SUBST_FILE should have been AC_SUBST
AC_SUBST_FILE happened to work in autoconf 2.59, but is broken in
autoconf 2.61.
2007-09-28 20:17:12 -07:00
H. Peter Anvin
d0b0d28f42 Unbreak relative references to immediate addresses
Remove bogus "treat labels different from immediates" code, which
would result in generating of a relative mod/rm but without adjusting
the address accordingly.

Update addressing mode test.
2007-09-28 17:17:20 -07:00
Charles Crayne
99e0317669 Merge branch 'master' of git+ssh://ccrayne@repo.or.cz/srv/git/nasm 2007-09-28 15:16:47 -07:00
H. Peter Anvin
43827654ac lib/vsnprintf.c: correct boundary conditions
Correct the boundary conditions in lib/vsnprintf.c; as it was we could
have an undetected one-byte overwrite.
2007-09-28 12:01:55 -07:00
H. Peter Anvin
304b605563 Add substitutes for snprintf() and vsnprintf()
To deal with fools^Wpeople trying to keep really old systems alive,
create a proper framework for substitution functions, and make it
possible to deal with the lack of snprintf/vsnprintf in particular.
2007-09-28 10:50:20 -07:00
Frank Kotler
bb2018587b Merge branch 'master' of git+ssh://fbkotler@repo.or.cz/srv/git/nasm 2007-09-28 02:03:41 -04:00
H. Peter Anvin
ab8447ed99 Exclude config.h from the dependency list for the canned makefiles
For the canned makefiles, we almost certainly don't have config.h, and
shouldn't include it in the list of dependencies.
2007-09-27 21:35:04 -07:00
H. Peter Anvin
747a80e0d6 version.pl: Add support for daily snapshot releases
Add support for daily snapshot releases of the form
<ordinary version number>-<datecode>.  These are exported to programs
as the new macro __NASM_SNAPSHOT__ (only present in snapshot releases.)
2007-09-27 21:12:17 -07:00
H. Peter Anvin
ede337ca51 Add Makefile for Linux -> DOS, Win32, OS/2 using OpenWatcom
Add a Makefile (for GNU Make, not wmake) to cross-compile NASM for
DOS, OS/2 or Win32 using OpenWatcom.
2007-09-27 19:46:55 -07:00
H. Peter Anvin
c38c117188 Add Makefile for OpenWatcom (DOS, OS/2 or Win32 output)
Add a Makefile for OpenWatcom using WMAKE.  This is a horrible version
of Make, but since it's bundled with OpenWatcom it is probably better
to stick to it.  It has the nice property that it can produce DOS,
Win32 or OS/2 binaries.

This Makefile currently assumes that it is hosted on a system where
pathname separators are backslashes.  For cross-compiling using
OpenWatcom on a Linux system it is probably better to write a separate
Makefile using GNU make to invoke Watcom.
2007-09-26 19:57:07 -07:00
H. Peter Anvin
3f9bc94b6e Test for various addressing modes in 64-bit mode
Test of various addressing modes in 64-bit mode.  Relative addresses
specified as numbers are currently broken!!
2007-09-26 17:00:18 -07:00
H. Peter Anvin
413fb900bf nasm option reshuffling, -E -> -Z
Old -E becomes -Z
New -E is alias for -e
Remove the obsolete -r option
2007-09-26 15:19:28 -07:00
Frank Kotler
6ac3135c16 Version 0.99.04 2007-09-25 23:57:21 -04:00
H. Peter Anvin
4cba95cf81 nasmdoc: corrections on 64-bit immediates/displacements
Corrections the section on 64-bit immediates and displacements.  In
particular, immediates are sign-extended the same way displacements
are (and the same way 8-bit immediates are), so there is some use for
the 7-byte mov eax,dword imm form :(
2007-09-25 20:36:45 -07:00