platform/upstream/nasm.git
16 years agoFormatting: kill off "stealth whitespace"
H. Peter Anvin [Fri, 19 Oct 2007 21:42:29 +0000 (14:42 -0700)]
Formatting: kill off "stealth whitespace"

"Stealth whitespace" makes it harder to read diffs, and just generally
cause unwanted weirdness.  Do a source-wide pass to get rid of it.

16 years agotest/floatx.asm: fix test case
H. Peter Anvin [Fri, 19 Oct 2007 21:26:52 +0000 (14:26 -0700)]
test/floatx.asm: fix test case

"dq" should have been "dt"

16 years agouscore.asm: Fix test case
H. Peter Anvin [Fri, 19 Oct 2007 21:19:52 +0000 (14:19 -0700)]
uscore.asm: Fix test case

"$1e+16" was missing, instead "$1e16" was duplicated

16 years agofloat.c: mark read_exponent() static
H. Peter Anvin [Fri, 19 Oct 2007 21:17:51 +0000 (14:17 -0700)]
float.c: mark read_exponent() static

read_exponent() is not used outside float.c; mark static

16 years agoDon't confuse suffixed hexadecimal with floating-point
H. Peter Anvin [Fri, 19 Oct 2007 21:10:35 +0000 (14:10 -0700)]
Don't confuse suffixed hexadecimal with floating-point

1e30 is a floating-point constant, but 1e30h is not.  The scanner
won't know that until it sees the "h", so make sure we keep enough
state to be able to distinguish "1e30" (a possible hex constant) from
"1.e30", "1e+30" or "1.0" (unabiguously floating-point.)

16 years agoAnchor filename locations in .gitignore
H. Peter Anvin [Fri, 19 Oct 2007 20:17:24 +0000 (13:17 -0700)]
Anchor filename locations in .gitignore

In particular, "Makefile" matched "test/Makefile" without the anchor.

16 years agotest/Makefile: Use -Ox instead of -O999
H. Peter Anvin [Fri, 19 Oct 2007 20:16:51 +0000 (13:16 -0700)]
test/Makefile: Use -Ox instead of -O999

16 years agoTest of underscored constants
H. Peter Anvin [Fri, 19 Oct 2007 20:14:06 +0000 (13:14 -0700)]
Test of underscored constants

16 years agoAllow underscores in numbers; better detection of FP
H. Peter Anvin [Fri, 19 Oct 2007 20:10:46 +0000 (13:10 -0700)]
Allow underscores in numbers; better detection of FP

- Allow underscores as group separators in numbers, for example:
  0x1234_5678 is now a legal number.  The underscore is just ignored,
  it adds no meaning.
- Recognize dotless floating-point numbers, such as "1e30".  This
  entails distinguishing hexadecimal numbers in the scanner, since
  e.g. 0x1e30 is a perfectly legitimate hex constant.

16 years agoModernize nasm.spec.in and make it closer to the Fedora version
H. Peter Anvin [Fri, 19 Oct 2007 17:44:56 +0000 (10:44 -0700)]
Modernize nasm.spec.in and make it closer to the Fedora version

16 years agoSuppress datarootdir warnings from configure
Charles Crayne [Fri, 19 Oct 2007 06:33:06 +0000 (23:33 -0700)]
Suppress datarootdir warnings from configure

16 years agoSuppress signedness warnings in disassembler
Charles Crayne [Fri, 19 Oct 2007 04:17:20 +0000 (21:17 -0700)]
Suppress signedness warnings in disassembler

16 years agoCleaner solution for MinGW handling of __STRICT_ANSI__
H. Peter Anvin [Fri, 19 Oct 2007 02:12:39 +0000 (19:12 -0700)]
Cleaner solution for MinGW handling of __STRICT_ANSI__

If MinGW is detected, undefine __STRICT_ANSI__ in compiler.h instead.

16 years agoconfigure: Undefine __STRICT_ANSI__ for mingw's benefit
H. Peter Anvin [Fri, 19 Oct 2007 01:15:18 +0000 (18:15 -0700)]
configure: Undefine __STRICT_ANSI__ for mingw's benefit

mingw makes a bunch of prototypes unavailable if __STRICT_ANSI__ is
defined.  However, they are still detected by configure, which causes
us pain.

16 years agoFix invocation of readnum()
H. Peter Anvin [Fri, 19 Oct 2007 01:14:26 +0000 (18:14 -0700)]
Fix invocation of readnum()

readnum() takes a boolean for error.

16 years agoSuppress a few signedness warnings
Charles Crayne [Fri, 19 Oct 2007 02:02:42 +0000 (19:02 -0700)]
Suppress a few signedness warnings

16 years agoAvoid unnecessary warning on redefinition of section (bug 801180)
root [Fri, 19 Oct 2007 00:04:10 +0000 (17:04 -0700)]
Avoid unnecessary warning on redefinition of section (bug 801180)

16 years agoGenerate stabs entries for any executable section
Charles Crayne [Thu, 18 Oct 2007 00:55:45 +0000 (17:55 -0700)]
Generate stabs entries for any executable section

16 years agoNASM 0.99.05
H. Peter Anvin [Wed, 17 Oct 2007 05:59:09 +0000 (22:59 -0700)]
NASM 0.99.05

16 years agoTests of obscenely large exponents
H. Peter Anvin [Tue, 16 Oct 2007 22:46:04 +0000 (15:46 -0700)]
Tests of obscenely large exponents

16 years agoComma-separate contents of __FLOAT__
H. Peter Anvin [Tue, 16 Oct 2007 21:42:32 +0000 (14:42 -0700)]
Comma-separate contents of __FLOAT__

16 years agoImplement floating-point option control directive
H. Peter Anvin [Tue, 16 Oct 2007 21:40:27 +0000 (14:40 -0700)]
Implement floating-point option control directive

New directive [FLOAT] with associated standard macros; allows the
setting to be saved and restored.

16 years agoFloating-point warning fixes; fix round-to-overflow
H. Peter Anvin [Tue, 16 Oct 2007 18:48:07 +0000 (11:48 -0700)]
Floating-point warning fixes; fix round-to-overflow

Actually generate the appropriate floating-point warnings, and only
one per assembly, pretty please.

Correct the round-to-overflow condition; as written all numbers with a
positive exponent were considered overflows!

16 years agoHandle rounding of denorms correctly; make fp overflow a warning
H. Peter Anvin [Tue, 16 Oct 2007 18:32:58 +0000 (11:32 -0700)]
Handle rounding of denorms correctly; make fp overflow a warning

- Handle rounding of denorms correctly
- Make fp overflow a warning, not an error (produces Inf)
- Make fp warnings controllable

16 years agoAdditional entries for .gitignore
H. Peter Anvin [Tue, 16 Oct 2007 17:35:02 +0000 (10:35 -0700)]
Additional entries for .gitignore

16 years agoRefactor floating-point formatting code; fix 80-bit denorms
H. Peter Anvin [Tue, 16 Oct 2007 17:32:57 +0000 (10:32 -0700)]
Refactor floating-point formatting code; fix 80-bit denorms

Refactor the floating-point formatting code so that the 80-bit format
can be supported with common code.  This fixes 80-bit denorms as a
side effect; the shift value in 80-bit denorms was completely wrong.

16 years agoAdd 1.5 as a test case: representative of an exact fraction
H. Peter Anvin [Tue, 16 Oct 2007 17:31:16 +0000 (10:31 -0700)]
Add 1.5 as a test case: representative of an exact fraction

1.5 is an exactly representable fraction, useful for test.

16 years agoRecognize 'd', 't' and 'y' as radix suffixes
H. Peter Anvin [Tue, 16 Oct 2007 03:06:06 +0000 (20:06 -0700)]
Recognize 'd', 't' and 'y' as radix suffixes

'd', 't' and 'y' now recognized as radix suffixes.

16 years agoFix FISTTP opcodes (BR 689695)
H. Peter Anvin [Tue, 16 Oct 2007 02:53:10 +0000 (19:53 -0700)]
Fix FISTTP opcodes (BR 689695)

16 years agoNew floating-point conversion routines
H. Peter Anvin [Tue, 16 Oct 2007 02:46:32 +0000 (19:46 -0700)]
New floating-point conversion routines

Substitute in nasm64developer's "acfloat4" routine.  This
floating-point conversion routine is not perfect (it gets a fair
number of LSB errors), but the old NASM code was just plain broken.
nasm64developer's code at least gets within ±1 LSB.

16 years agoAdd testnos3 from the gdtoa package (floating-point test)
H. Peter Anvin [Tue, 16 Oct 2007 00:48:43 +0000 (17:48 -0700)]
Add testnos3 from the gdtoa package (floating-point test)

16 years ago.gitignore file doesn't need to be in the release file
H. Peter Anvin [Sun, 14 Oct 2007 06:19:21 +0000 (23:19 -0700)]
.gitignore file doesn't need to be in the release file

16 years agoAdd .gitignore file so "git status" produces something sane
H. Peter Anvin [Sun, 14 Oct 2007 06:17:41 +0000 (23:17 -0700)]
Add .gitignore file so "git status" produces something sane

Add .gitignore file to tell git about files that don't need to be
tracked.

16 years agoautoconf: drop AC_USE_SYSTEM_EXTENSIONS to support autoconf 2.59
H. Peter Anvin [Sun, 14 Oct 2007 06:12:46 +0000 (23:12 -0700)]
autoconf: drop AC_USE_SYSTEM_EXTENSIONS to support autoconf 2.59

AC_USE_SYSTEM_EXTENSIONS requires autoconf 2.61, which is still a
little too new, apparently.  Unless we have a specific reason to
include it, don't.

16 years agoFix 32-bit types in preproc.c and eval.c
Keith Kanios [Sat, 13 Oct 2007 14:09:22 +0000 (07:09 -0700)]
Fix 32-bit types in preproc.c and eval.c

Fix 32-bit types in preproc.c and eval.c that should have been 64-bit
types.  This allows %assign to work correctly with 64-bit integers.

16 years agoMust define types before using them
Charles Crayne [Fri, 12 Oct 2007 03:32:33 +0000 (20:32 -0700)]
Must define types before using them

16 years agopreproc.c: move smacro define/undef to separate functions
H. Peter Anvin [Thu, 11 Oct 2007 20:42:09 +0000 (13:42 -0700)]
preproc.c: move smacro define/undef to separate functions

Instead of tons of replicated code, move smacro define/undef into
separate static functions.

16 years agopreproc.c: PP_DEFINE and PP_XDEFINE are case-sensitive
H. Peter Anvin [Thu, 11 Oct 2007 20:38:38 +0000 (13:38 -0700)]
preproc.c: PP_DEFINE and PP_XDEFINE are case-sensitive

The statement for case-sensitivity had PP_DEFINE and PP_IXDEFINE,
rather than PP_XDEFINE.

16 years agopreproc.c: normalize the handling of case sensitivity
H. Peter Anvin [Thu, 11 Oct 2007 19:52:03 +0000 (12:52 -0700)]
preproc.c: normalize the handling of case sensitivity

Fix a bug relating to case sensitivity, and make remaining code more
similar.

16 years agoDefine macros necessary for <inttypes.h> on C++
H. Peter Anvin [Thu, 11 Oct 2007 19:50:24 +0000 (12:50 -0700)]
Define macros necessary for <inttypes.h> on C++

NASM currently doesn't compile with a C++ compiler, but the error
messages are sometimes useful.  Define macros necessary for
<inttypes.h> to work with a C++ compiler.

16 years agoMore "bool" fixes
H. Peter Anvin [Thu, 11 Oct 2007 17:12:58 +0000 (10:12 -0700)]
More "bool" fixes

A few more variables passed as pointers which are now defined as bool *.

16 years agopreproc.c: allow 64-bit repeat counts
H. Peter Anvin [Thu, 11 Oct 2007 17:11:57 +0000 (10:11 -0700)]
preproc.c: allow 64-bit repeat counts

Allow the count of %rep to exceed 2^31.

16 years agopreproc.c: For an SMacro, in_progress really is a boolean (no %rep)
H. Peter Anvin [Thu, 11 Oct 2007 17:06:19 +0000 (10:06 -0700)]
preproc.c: For an SMacro, in_progress really is a boolean (no %rep)

16 years agoAdditional uses of bool and enum
H. Peter Anvin [Thu, 11 Oct 2007 07:05:31 +0000 (00:05 -0700)]
Additional uses of bool and enum

Proper use of bool and enum makes code easier to debug.  Do more of
it.  In particular, we really should stomp out any residual uses of
magic constants that aren't enums or, in some cases, even #defines.

16 years agopreproc.c: MMacro.in_progress is not a boolean
H. Peter Anvin [Thu, 11 Oct 2007 07:03:26 +0000 (00:03 -0700)]
preproc.c: MMacro.in_progress is not a boolean

Per the comment:

 * In a MMacro describing a `%rep' block, the `in_progress' field
 * isn't merely boolean, but gives the number of repeats left to
 * run.

This fixes the "global" directive not getting recognized, since it
repeats over all its arguments.

16 years agosaa_fread/fwrite: when seeking, must set [rw]ptr as well
H. Peter Anvin [Thu, 11 Oct 2007 01:07:51 +0000 (18:07 -0700)]
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.

16 years agoUse the compiler-provided booleans if available, otherwise emulate
H. Peter Anvin [Wed, 10 Oct 2007 21:58:45 +0000 (14:58 -0700)]
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.

16 years agoowlinux.mak: don't clean things we won't be able to
H. Peter Anvin [Wed, 10 Oct 2007 21:55:14 +0000 (14:55 -0700)]
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.

16 years agoconfigure.in: looks like we need autoconf 2.61 :(
H. Peter Anvin [Wed, 10 Oct 2007 21:29:53 +0000 (14:29 -0700)]
configure.in: looks like we need autoconf 2.61 :(

AC_USE_SYSTEM_EXTENSIONS is really, *really* useful, but apparently
requires autoconf 2.61...

16 years agoCreate option -Ox to tell NASM to do unlimited passes
H. Peter Anvin [Wed, 10 Oct 2007 21:06:59 +0000 (14:06 -0700)]
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.

16 years agoRevert "floatb.asm: fix broken testcase"
H. Peter Anvin [Tue, 9 Oct 2007 02:26:57 +0000 (19:26 -0700)]
Revert "floatb.asm: fix broken testcase"

This reverts commit d9e3116be19165325ee9457bc207d47300075739.

0x513c1704 is 50.49e9, not 50.40e9

16 years agofloatb.asm: fix broken testcase
H. Peter Anvin [Tue, 9 Oct 2007 01:39:24 +0000 (18:39 -0700)]
floatb.asm: fix broken testcase

50.40e9 as a 32-bit float is 0x513c1704

16 years agosaa_rstruct: fix overrun check
H. Peter Anvin [Mon, 8 Oct 2007 19:41:00 +0000 (12:41 -0700)]
saa_rstruct: fix overrun check

The direction of the overrun test in saa_rstruct was backwards.

16 years agoAdd Frank's floattest.asm test file
H. Peter Anvin [Mon, 8 Oct 2007 19:12:23 +0000 (12:12 -0700)]
Add Frank's floattest.asm test file

16 years agosaa_fpwrite: initializing "len" should be part of the loop
H. Peter Anvin [Mon, 8 Oct 2007 04:13:14 +0000 (21:13 -0700)]
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).

16 years agoFix infinite loop in function saa_fpwrite
Charles Crayne [Mon, 8 Oct 2007 01:46:57 +0000 (18:46 -0700)]
Fix infinite loop in function saa_fpwrite

16 years agozerobyte.asm: use a real instruction to avoid confusing ndisasm
H. Peter Anvin [Sat, 6 Oct 2007 00:44:16 +0000 (17:44 -0700)]
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.

16 years agozerobyte.asm: add test cases for non-initial \170 uses
H. Peter Anvin [Sat, 6 Oct 2007 00:42:31 +0000 (17:42 -0700)]
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.

16 years agoCheck in the proper zerobyte test
H. Peter Anvin [Sat, 6 Oct 2007 00:29:01 +0000 (17:29 -0700)]
Check in the proper zerobyte test

The previous checkin checked in zerobyte.bin, not zerobyte.asm

16 years agoEmit REX prefix before literal zero (\170)
H. Peter Anvin [Sat, 6 Oct 2007 00:04:32 +0000 (17:04 -0700)]
Emit REX prefix before literal zero (\170)

16 years agoLICENSE: Break long line
H. Peter Anvin [Sat, 6 Oct 2007 00:01:15 +0000 (17:01 -0700)]
LICENSE: Break long line

16 years agoAdd test for problematic floats
H. Peter Anvin [Fri, 5 Oct 2007 21:36:03 +0000 (14:36 -0700)]
Add test for problematic floats

16 years agofloatx.asm: add Inf and NaN to the boundary condition tests
H. Peter Anvin [Fri, 5 Oct 2007 06:51:08 +0000 (23:51 -0700)]
floatx.asm: add Inf and NaN to the boundary condition tests

16 years agofloatx.asm: add specific tests for exponent boundary conditions
H. Peter Anvin [Fri, 5 Oct 2007 06:09:19 +0000 (23:09 -0700)]
floatx.asm: add specific tests for exponent boundary conditions

Add tests for the exponent boundaries (underflow, denorm, normal).

16 years agofloat.c: correct the exponent
H. Peter Anvin [Fri, 5 Oct 2007 05:51:08 +0000 (22:51 -0700)]
float.c: correct the exponent

We would accidentally produce an exponent which was exactly +1 from
the correct one.

16 years agoAdditional rules in test/Makefile
H. Peter Anvin [Thu, 4 Oct 2007 22:18:23 +0000 (15:18 -0700)]
Additional rules in test/Makefile

Add rules for .pl -> .asm

16 years agoRewrite the handling of SAA's to allow random access
H. Peter Anvin [Thu, 4 Oct 2007 20:42:56 +0000 (13:42 -0700)]
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.

16 years agoChange cloc_t to struct location, and reorder the members
H. Peter Anvin [Thu, 4 Oct 2007 04:30:57 +0000 (21:30 -0700)]
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.

16 years agoBR 1352920: change loc_t -> cloc_t
H. Peter Anvin [Thu, 4 Oct 2007 04:24:51 +0000 (21:24 -0700)]
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.

16 years agoBR 1352920: Handle upper case %line
H. Peter Anvin [Thu, 4 Oct 2007 04:22:16 +0000 (21:22 -0700)]
BR 1352920: Handle upper case %line

16 years agoUse autoconf to request feature macros
H. Peter Anvin [Thu, 4 Oct 2007 00:40:12 +0000 (17:40 -0700)]
Use autoconf to request feature macros

16 years agopreproc.c: constipation
H. Peter Anvin [Wed, 3 Oct 2007 05:04:15 +0000 (22:04 -0700)]
preproc.c: constipation

Add "const" in suitable places

16 years agomake alldeps
H. Peter Anvin [Wed, 3 Oct 2007 04:57:27 +0000 (21:57 -0700)]
make alldeps

16 years agoPortability fixes
H. Peter Anvin [Wed, 3 Oct 2007 04:53:51 +0000 (21:53 -0700)]
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.)

16 years agoRun "make alldeps".
H. Peter Anvin [Wed, 3 Oct 2007 04:13:18 +0000 (21:13 -0700)]
Run "make alldeps".

Run "make alldeps".  This stuff probably shouldn't be checked in...

16 years agoUse the crc64 we already use as the perfect hash function prehash
H. Peter Anvin [Wed, 3 Oct 2007 00:40:00 +0000 (17:40 -0700)]
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.

16 years agoinsns.dat: add systematic names for the hinting NOPs (0F18-0F1F)
H. Peter Anvin [Tue, 2 Oct 2007 22:09:33 +0000 (15:09 -0700)]
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.

16 years agoUnspecified files are null strings, not null pointers
H. Peter Anvin [Mon, 1 Oct 2007 18:28:32 +0000 (11:28 -0700)]
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.

16 years agoCheck for the most basic filename overlaps
H. Peter Anvin [Mon, 1 Oct 2007 18:26:31 +0000 (11:26 -0700)]
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.

16 years agomodified: nasm.1 to add newer command line options
Charles Crayne [Mon, 1 Oct 2007 05:15:36 +0000 (22:15 -0700)]
modified:   nasm.1 to add newer command line options
modified:   nasm.c to fully parse command line before redirecting stderr.

16 years agoMerge branch 'master' of git+ssh://ccrayne@repo.or.cz/srv/git/nasm
Charles Crayne [Sat, 29 Sep 2007 04:27:41 +0000 (21:27 -0700)]
Merge branch 'master' of git+ssh://ccrayne@repo.or.cz/srv/git/nasm

16 years agoconfigure.in: AC_SUBST_FILE should have been AC_SUBST
H. Peter Anvin [Sat, 29 Sep 2007 03:17:12 +0000 (20:17 -0700)]
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.

16 years agoUnbreak relative references to immediate addresses
H. Peter Anvin [Sat, 29 Sep 2007 00:17:20 +0000 (17:17 -0700)]
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.

16 years agoMerge branch 'master' of git+ssh://ccrayne@repo.or.cz/srv/git/nasm
Charles Crayne [Fri, 28 Sep 2007 22:16:47 +0000 (15:16 -0700)]
Merge branch 'master' of git+ssh://ccrayne@repo.or.cz/srv/git/nasm

16 years agolib/vsnprintf.c: correct boundary conditions
H. Peter Anvin [Fri, 28 Sep 2007 19:01:55 +0000 (12:01 -0700)]
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.

16 years agoAdd substitutes for snprintf() and vsnprintf()
H. Peter Anvin [Fri, 28 Sep 2007 17:50:20 +0000 (10:50 -0700)]
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.

16 years agoMerge branch 'master' of git+ssh://fbkotler@repo.or.cz/srv/git/nasm
Frank Kotler [Fri, 28 Sep 2007 06:03:41 +0000 (02:03 -0400)]
Merge branch 'master' of git+ssh://fbkotler@repo.or.cz/srv/git/nasm

16 years agoExclude config.h from the dependency list for the canned makefiles
H. Peter Anvin [Fri, 28 Sep 2007 04:35:04 +0000 (21:35 -0700)]
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.

16 years agoversion.pl: Add support for daily snapshot releases
H. Peter Anvin [Fri, 28 Sep 2007 04:12:17 +0000 (21:12 -0700)]
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.)

16 years agoAdd Makefile for Linux -> DOS, Win32, OS/2 using OpenWatcom
H. Peter Anvin [Fri, 28 Sep 2007 02:46:55 +0000 (19:46 -0700)]
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.

16 years agoAdd Makefile for OpenWatcom (DOS, OS/2 or Win32 output)
H. Peter Anvin [Thu, 27 Sep 2007 02:57:07 +0000 (19:57 -0700)]
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.

16 years agoTest for various addressing modes in 64-bit mode
H. Peter Anvin [Thu, 27 Sep 2007 00:00:18 +0000 (17:00 -0700)]
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!!

16 years agonasm option reshuffling, -E -> -Z
H. Peter Anvin [Wed, 26 Sep 2007 22:19:28 +0000 (15:19 -0700)]
nasm option reshuffling, -E -> -Z

Old -E becomes -Z
New -E is alias for -e
Remove the obsolete -r option

16 years agoVersion 0.99.04
Frank Kotler [Wed, 26 Sep 2007 03:57:21 +0000 (23:57 -0400)]
Version 0.99.04

16 years agonasmdoc: corrections on 64-bit immediates/displacements
H. Peter Anvin [Wed, 26 Sep 2007 03:36:45 +0000 (20:36 -0700)]
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 :(

16 years agonasmdoc: shorten lines which are too long
H. Peter Anvin [Tue, 25 Sep 2007 23:02:21 +0000 (16:02 -0700)]
nasmdoc: shorten lines which are too long

16 years agoDocument NASM behaviour for 64-bit immediates and displacements
H. Peter Anvin [Tue, 25 Sep 2007 23:01:07 +0000 (16:01 -0700)]
Document NASM behaviour for 64-bit immediates and displacements

Document (intended) NASM behaviour for 64-bit immediates and
displacements.

16 years agotest/movimm.asm: add optimizable forms
H. Peter Anvin [Tue, 25 Sep 2007 22:44:40 +0000 (15:44 -0700)]
test/movimm.asm: add optimizable forms

Add optimizable forms that probably should be shrunk by the optimizer.

16 years agoassemble.c: clean up whitespace
H. Peter Anvin [Tue, 25 Sep 2007 22:41:19 +0000 (15:41 -0700)]
assemble.c: clean up whitespace

Remove stray whitespace

16 years agoCorrect the handling of "MOV" with immediate in 64-bit mode
H. Peter Anvin [Tue, 25 Sep 2007 22:40:36 +0000 (15:40 -0700)]
Correct the handling of "MOV" with immediate in 64-bit mode

Correct the handling of "MOV" with immediate in 64-bit mode.  With
these changes, movimm.asm produces the desired results.