platform/upstream/nasm.git
15 years agoDocument __PASS__
H. Peter Anvin [Thu, 25 Sep 2008 00:34:37 +0000 (17:34 -0700)]
Document __PASS__

Document __PASS__, but discourage users from using it.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agoAdd __PASS__ builtin macro
H. Peter Anvin [Wed, 24 Sep 2008 17:20:40 +0000 (10:20 -0700)]
Add __PASS__ builtin macro

Add a new builtin macro, __PASS__, which is either 1 (for a
preparatory pass), 2 (for a final pass, including preprocessor only),
or 0 (for dependency generation.)  This might be useful in special
contexts.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agoUnbreak %warning
H. Peter Anvin [Wed, 24 Sep 2008 16:14:49 +0000 (09:14 -0700)]
Unbreak %warning

Since the error directives, including %warning, are now issued in the
final pass only, it is important that we do *not* pass ERR_PASS1 with
%warning.  Rather than playing even more ugly games in error(),
require ERR_PASS1 to be passed in with warnings elsewhere in the
preprocessor, just like the rest of the system.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agodoc/changes.src: something closer to final release notes for 2.04
H. Peter Anvin [Wed, 24 Sep 2008 15:59:29 +0000 (08:59 -0700)]
doc/changes.src: something closer to final release notes for 2.04

doc/changes.src should contain the user-visible changes in human
comprehensible form (release notes, not a changelog.)  Get something
closer to what it should look like for 2.04.

15 years agonasmdoc.src: more consistent indentation in %error section
H. Peter Anvin [Wed, 24 Sep 2008 15:46:50 +0000 (08:46 -0700)]
nasmdoc.src: more consistent indentation in %error section

We had different indentation levels only two paragraphs apart.
Overall, the document is horribly inconsistent about indentation,
which should be fixed.

15 years agotest/fwdoptpp: test %error, %warning, %fatal
H. Peter Anvin [Wed, 24 Sep 2008 07:30:46 +0000 (00:30 -0700)]
test/fwdoptpp: test %error, %warning, %fatal

Test all of %error, %warning, and %fatal.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agoNASM 2.04rc5
H. Peter Anvin [Wed, 24 Sep 2008 07:26:09 +0000 (00:26 -0700)]
NASM 2.04rc5

15 years ago%error, %warning out on the final pass, add %fatal
H. Peter Anvin [Wed, 24 Sep 2008 07:21:58 +0000 (00:21 -0700)]
%error, %warning out on the final pass, add %fatal

Only process %error or %warning directives on the final pass.  Add a
new %fatal directive which terminates assembly immediately.

15 years agoAllow value to TIMES to be negative while optimization is in progress
Charles Crayne [Wed, 24 Sep 2008 04:49:09 +0000 (21:49 -0700)]
Allow value to TIMES to be negative while optimization is in progress

Change the parser to only issue the "TIMES value %d is negative"
error message if all optimization passes have completed.

15 years agotest: test for code that relies on the optimizer to be valid
H. Peter Anvin [Wed, 24 Sep 2008 00:09:52 +0000 (17:09 -0700)]
test: test for code that relies on the optimizer to be valid

There exists a fair bit of code out there which relies on the
optimizer in order to fit inside a predefined envelope.  NASM 2.04rc4
breaks this; write a simple test to demonstrate.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agoNASM 2.04rc4
H. Peter Anvin [Tue, 23 Sep 2008 00:16:30 +0000 (17:16 -0700)]
NASM 2.04rc4

15 years agoBR 1239818 - handle multiple %else clauses
Victor van den Elzen [Thu, 18 Sep 2008 11:51:36 +0000 (13:51 +0200)]
BR 1239818 - handle multiple %else clauses

Using multiple %else clauses or mixing %else and %elif
caused strange results.
Warn about it and produce sensible results.

15 years agoNASM 2.04rc3
H. Peter Anvin [Sat, 13 Sep 2008 01:12:03 +0000 (18:12 -0700)]
NASM 2.04rc3

15 years agoHalt assembly if addresses are not converging.
Charles Crayne [Fri, 12 Sep 2008 01:54:06 +0000 (18:54 -0700)]
Halt assembly if addresses are not converging.

Change global_offset_changed from bool to int so that
progress of convergence can be monitored. If change count
does not decrease from previous pass, increment stall counter.
If stall count reaches threshold, terminate assembly
with error message.

15 years agoLimit number of passes to 1000
Victor van den Elzen [Thu, 11 Sep 2008 13:07:05 +0000 (15:07 +0200)]
Limit number of passes to 1000

Now NASM won't take unreasonable an amount of time to generate
wrong code when it encounters equ's that don't converge, ex:

FOO equ FOO + 1

15 years agoRemove obsolete ROL-EQU hack
Victor van den Elzen [Thu, 11 Sep 2008 11:14:23 +0000 (13:14 +0200)]
Remove obsolete ROL-EQU hack

Now that there is proper forward reference resolution,
we can get rid of this junk. Wiping the flags also
removed the SBYTEnn flags, causing

cmp eax, a-b
a: nop
b:

to assemble with -Ox like

cmp eax, strict dword -1

This is now fixed.

15 years agodoc: document the use of macros in %error
H. Peter Anvin [Thu, 11 Sep 2008 06:34:39 +0000 (23:34 -0700)]
doc: document the use of macros in %error

Document the use of macros in %error and %warning, valid since 2.03.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agodoc: Call %xdefine a "resolving define" instead of "enhancing define"
H. Peter Anvin [Thu, 11 Sep 2008 06:29:45 +0000 (23:29 -0700)]
doc: Call %xdefine a "resolving define" instead of "enhancing define"

%xdefine is an early-binding %define (%define being late-binding.)
There is nothing "enhanced" about it, it just specifies a different
policy.  Call it a "resolving define" instead.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agodoc: clean up formatting around -O option
H. Peter Anvin [Thu, 11 Sep 2008 06:27:10 +0000 (23:27 -0700)]
doc: clean up formatting around -O option

Clean up the formatting in descriptions of the -O option.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agoNASM 2.04rc2
H. Peter Anvin [Thu, 11 Sep 2008 06:05:18 +0000 (23:05 -0700)]
NASM 2.04rc2

15 years agochanges: document optimizer change
H. Peter Anvin [Thu, 11 Sep 2008 06:04:56 +0000 (23:04 -0700)]
changes: document optimizer change

15 years agoDecouple forward references from optimization
Charles Crayne [Thu, 11 Sep 2008 02:21:52 +0000 (19:21 -0700)]
Decouple forward references from optimization

Users who wish to control the level of optimization can
continue to specify -O0, -O1, or -Ox,
where x can be the letter itself, or any number > 1.

However, even with optimization turned off,
NASM will always make enough passes to resolve
forward references. As a result, INCBIN is now the only
item left in the critical expressions list, although TIMES
still has its own constant value check.

15 years agoRun "make alldeps"
H. Peter Anvin [Tue, 9 Sep 2008 16:54:47 +0000 (09:54 -0700)]
Run "make alldeps"

15 years agomacros.pl: don't include macros for disabled output formats
H. Peter Anvin [Tue, 9 Sep 2008 16:54:03 +0000 (09:54 -0700)]
macros.pl: don't include macros for disabled output formats

Don't include macros for output formats we aren't compiling in.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agooutaout.mac: aoutb is an alias for aout
H. Peter Anvin [Tue, 9 Sep 2008 16:53:20 +0000 (09:53 -0700)]
outaout.mac: aoutb is an alias for aout

aoutb is an alias format for aout (in the sense they use the same
macro set.)

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agomacros.pl: be a bit more careful with open()
H. Peter Anvin [Tue, 9 Sep 2008 16:43:16 +0000 (09:43 -0700)]
macros.pl: be a bit more careful with open()

Be a bit more strict with open() calls.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agomacros: win32 and win64 are COFF, not Mach-O
H. Peter Anvin [Tue, 9 Sep 2008 16:37:37 +0000 (09:37 -0700)]
macros: win32 and win64 are COFF, not Mach-O

Somehow the win32 and win64 aliases got listed on Mach-O, not on
COFF.  This doesn't have any effect on the current code, but might in
the future.  Correct.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agoNASM 2.04rc1
H. Peter Anvin [Wed, 3 Sep 2008 22:25:33 +0000 (15:25 -0700)]
NASM 2.04rc1

15 years agoRemove obsolete tagrelease script (duplicate of tag-release)
H. Peter Anvin [Wed, 3 Sep 2008 22:22:23 +0000 (15:22 -0700)]
Remove obsolete tagrelease script (duplicate of tag-release)

15 years agoUpdate doc/changes.src
H. Peter Anvin [Wed, 3 Sep 2008 22:16:44 +0000 (15:16 -0700)]
Update doc/changes.src

15 years agoDocument %use smartalign
H. Peter Anvin [Wed, 3 Sep 2008 22:03:20 +0000 (15:03 -0700)]
Document %use smartalign

15 years agoDocument %unmacro
H. Peter Anvin [Wed, 3 Sep 2008 21:31:20 +0000 (14:31 -0700)]
Document %unmacro

15 years agooutcoff: stylistic cleanups
H. Peter Anvin [Tue, 2 Sep 2008 19:56:39 +0000 (12:56 -0700)]
outcoff: stylistic cleanups

Don't use explicit L's for things which are really size_t; not only is
it unnecessarily ugly, but it's wrong in a lot of ways.  Do some other
minor stylistic cleanups.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agooutcoff: default output symbols to T_NULL
H. Peter Anvin [Tue, 2 Sep 2008 19:55:35 +0000 (12:55 -0700)]
outcoff: default output symbols to T_NULL

We would leave the output symbol type uninitialized.  Explicitly
initialize it to zero (T_NULL, meaning no symbol type information),
since that's what was effectively done.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agoBR 2048950: fix crash due to mmacro list overflow
H. Peter Anvin [Mon, 1 Sep 2008 17:56:33 +0000 (10:56 -0700)]
BR 2048950: fix crash due to mmacro list overflow

When allocating the buffer for an mmacro list, we apparently failed to
guarantee space for the terminating NULL.  This almost certainly
caused the crash described in BR 2048950, and quite possibly BR
1284169.

15 years agotest/new: clean up whitespace
H. Peter Anvin [Sat, 30 Aug 2008 01:04:16 +0000 (18:04 -0700)]
test/new: clean up whitespace

15 years agoScript to create new test case boilerplate
H. Peter Anvin [Sat, 30 Aug 2008 00:27:00 +0000 (17:27 -0700)]
Script to create new test case boilerplate

15 years agoAccept implicit memory size for VMREAD/VMWRITE
H. Peter Anvin [Fri, 29 Aug 2008 01:05:23 +0000 (18:05 -0700)]
Accept implicit memory size for VMREAD/VMWRITE

15 years agoBR 2029472: Wrong operand size for VMREAD/VMWRITE in 64-bit mode
H. Peter Anvin [Fri, 29 Aug 2008 01:03:49 +0000 (18:03 -0700)]
BR 2029472: Wrong operand size for VMREAD/VMWRITE in 64-bit mode

Fix the operand size for VMREAD/VMWRITE in 64-bit mode

15 years ago.gitignore: ignore some editor backup files
H. Peter Anvin [Fri, 29 Aug 2008 00:56:17 +0000 (17:56 -0700)]
.gitignore: ignore some editor backup files

Ignore a couple of variants of editor backup files.

15 years agoBR 2028995: Missing MOVNTI m64, r64
H. Peter Anvin [Fri, 29 Aug 2008 00:54:55 +0000 (17:54 -0700)]
BR 2028995: Missing MOVNTI m64, r64

Fix MOVNTI with a 64-bit argument.

15 years agoTestcase for XCRYPT
H. Peter Anvin [Fri, 29 Aug 2008 00:48:34 +0000 (17:48 -0700)]
Testcase for XCRYPT

15 years agoBR 2029829: Accept VIA XCRYPT instructions with or without REP
H. Peter Anvin [Fri, 29 Aug 2008 00:47:16 +0000 (17:47 -0700)]
BR 2029829: Accept VIA XCRYPT instructions with or without REP

Accept the VIA XCRYPT instructions either with or without a REP
prefix, as documented.

Add the missing XCRYPTCTR instruction.

15 years agoBR 2039212: Handle indirect far jumps in 64-bit mode
H. Peter Anvin [Fri, 29 Aug 2008 00:35:25 +0000 (17:35 -0700)]
BR 2039212: Handle indirect far jumps in 64-bit mode

Handle indirect far jumps in 64-bit mode.  Default to 64 bit unless
overridden, for consistency with other jumps.

15 years agoInclude "nasm.h" in "float.h"
H. Peter Anvin [Thu, 28 Aug 2008 20:36:10 +0000 (13:36 -0700)]
Include "nasm.h" in "float.h"

"float.h" references efunc, so it needs "nasm.h".
It also has uint8_t and so need <inttypes.h>, but that's part of
"nasm.h".

15 years agoAdd 256-bit AVX stores per the latest AVX spec.
H. Peter Anvin [Thu, 28 Aug 2008 01:47:05 +0000 (18:47 -0700)]
Add 256-bit AVX stores per the latest AVX spec.

Add 256-bit forms of VMOVNTPD, VMOVNTPS, and VMOVNT[DQ]Q.

15 years agoAdd AVX forms of the AES instructions (new in the latest AVX spec)
H. Peter Anvin [Thu, 28 Aug 2008 01:42:26 +0000 (18:42 -0700)]
Add AVX forms of the AES instructions (new in the latest AVX spec)

The AES instructions, too, have gotten VEX forms.

15 years agotest: Fix file with no final newline
H. Peter Anvin [Mon, 25 Aug 2008 01:17:09 +0000 (18:17 -0700)]
test: Fix file with no final newline

Fix test/br2030823.asm, which had no final newline.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agoBR 2067820: add the MOVSXD instruction
H. Peter Anvin [Mon, 25 Aug 2008 01:12:20 +0000 (18:12 -0700)]
BR 2067820: add the MOVSXD instruction

The official mnemonic for 32-to-64-bit sign extension is MOVSXD for
some idiotic reason.  Add support for it while continue to recognize
MOVSX for this as an alias.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agoBR 2067837: remove double add of VEX instruction length
H. Peter Anvin [Mon, 25 Aug 2008 01:09:04 +0000 (18:09 -0700)]
BR 2067837: remove double add of VEX instruction length

We added the length of VEX prefixes twice in calcsize(); this resulted
in the wrong symbol addresses when compiling without the optimizer.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agoBR 2062342: ndisasm: r12 *can* be an index register
H. Peter Anvin [Wed, 20 Aug 2008 16:42:47 +0000 (09:42 -0700)]
BR 2062342: ndisasm: r12 *can* be an index register

R12 can be used as an index register.  Special encodings in the modr/m
byte are done *without* consideration for the REX prefix, but special
encodings in the SIB byte *do* take the REX prefix into consideration,
since it doesn't affect the overall instruction format.

15 years agoBR 2030823: Problem with the 256-bit FMA instructions
H. Peter Anvin [Wed, 13 Aug 2008 23:25:08 +0000 (16:25 -0700)]
BR 2030823: Problem with the 256-bit FMA instructions

Fix the 256-bit FMA instructions per bug report.

15 years agoBR 2043111: Typo in insns.dat: VCMPFT_OQPD VCMPFT_OQPS
H. Peter Anvin [Wed, 13 Aug 2008 23:18:23 +0000 (16:18 -0700)]
BR 2043111: Typo in insns.dat: VCMPFT_OQPD VCMPFT_OQPS

Fix typo

15 years agominor bugfix in performtest.pl
Victor van den Elzen [Wed, 6 Aug 2008 13:15:01 +0000 (15:15 +0200)]
minor bugfix in performtest.pl

15 years agoAdd macro-defaults warning class and documentation.
Victor van den Elzen [Wed, 6 Aug 2008 12:47:54 +0000 (14:47 +0200)]
Add macro-defaults warning class and documentation.

15 years agoBR 2034542: fix crash when touching __FILE__
H. Peter Anvin [Fri, 1 Aug 2008 01:46:11 +0000 (18:46 -0700)]
BR 2034542: fix crash when touching __FILE__

Touching __FILE__ would cause a dereference of an uninitialized
pointer.  Fix.

15 years agoBR 2028910: fix decoding of VEX prefixes in 16- and 32-bit mode
H. Peter Anvin [Thu, 31 Jul 2008 00:30:12 +0000 (17:30 -0700)]
BR 2028910: fix decoding of VEX prefixes in 16- and 32-bit mode

We would incorrectly set a bunch of VEX-related state for C4 and C5
bytes, even though we had already rejected it as not a VEX prefix due
to the top two bits of the following byte not being 11.

15 years agoBR 2025977: Handle SLDT with a 64-bit register operand
H. Peter Anvin [Thu, 31 Jul 2008 00:25:56 +0000 (17:25 -0700)]
BR 2025977: Handle SLDT with a 64-bit register operand

Handle SLDT with a 64-bit register operand.  Don't generate a REX.W
prefix in the assembler, since zero-extending is just fine, but do
support it in the disassembler.

15 years agopreproc: restore correct break; in do_directive()
H. Peter Anvin [Wed, 23 Jul 2008 14:49:26 +0000 (10:49 -0400)]
preproc: restore correct break; in do_directive()

Checkin a26433db6805cf1f1d711eb820f6a50a98f54f36 incorrectly changed a
few break;s in do_directive() that were *inside loops* to returns.
This broke single-line macros as well as %exitrep; fix.

15 years agoBR 560960: warn about trailing garbage in %macro/%ifmacro
Victor van den Elzen [Wed, 23 Jul 2008 13:14:22 +0000 (15:14 +0200)]
BR 560960: warn about trailing garbage in %macro/%ifmacro

16 years agoImprove checking and documentation for %ifctx
Victor van den Elzen [Wed, 23 Jul 2008 11:21:29 +0000 (13:21 +0200)]
Improve checking and documentation for %ifctx

16 years agoBR 2023036: MOV reg32,dreg and vice versa are NOLONG
H. Peter Anvin [Sun, 20 Jul 2008 21:59:18 +0000 (14:59 -0700)]
BR 2023036: MOV reg32,dreg and vice versa are NOLONG

MOV reg32,dreg and MOV dreg,reg32 are NOLONG; in 64-bit mode we always
move to/from reg64.

16 years agoErr, "alignr" was really the same as the previous "alignb"
H. Peter Anvin [Sun, 20 Jul 2008 16:40:14 +0000 (09:40 -0700)]
Err, "alignr" was really the same as the previous "alignb"

Replace "alignb" with the (slightly more optimized) "alignr" macro,
but keep the name "alignb".

16 years agoAdd "alignr" standard macro (using resb)
H. Peter Anvin [Sun, 20 Jul 2008 16:32:31 +0000 (09:32 -0700)]
Add "alignr" standard macro (using resb)

Add an "alignr" standard macro, for use in BSS (nobits) and absolute
segments.

16 years agoAvoid redundant "const" for macros_t
H. Peter Anvin [Sun, 20 Jul 2008 04:44:26 +0000 (21:44 -0700)]
Avoid redundant "const" for macros_t

Don't use a redundant "const" for macros_t (which is const unsigned
char), since OpenWatcom doesn't like it, and I believe it is incorrect
per the C standard.

16 years agoBR 2003451: add test case
H. Peter Anvin [Sun, 20 Jul 2008 04:40:07 +0000 (21:40 -0700)]
BR 2003451: add test case

Add test case for BR 2003451: forwardness leakage between operands.

16 years agoBR 2003451: avoid "forwardness" leaks between operands
H. Peter Anvin [Sun, 20 Jul 2008 04:38:56 +0000 (21:38 -0700)]
BR 2003451: avoid "forwardness" leaks between operands

Any use of ins->forw_ref that isn't related to control of the
optimizer is fundamentally broken.  Use
operand->opflags & OPERAND_FORWARD instead.  This even has the nice
side benefit of simplifying the code.

16 years agoBR 2010180: outobj: Garbage may be written in a last PUBDEF
Slavik Gnatenko [Sun, 20 Jul 2008 02:27:41 +0000 (19:27 -0700)]
BR 2010180: outobj: Garbage may be written in a last PUBDEF

The testcase illustrates the problem. After "nasm -f obj
alonesym.nasm"
let's look to dump:

======
PUBDEF386(91) recnum:5, offset:0000005bh, len:03f9h, chksum:bbh(bb)
Group: 0, Seg: 1
00020000h - 'sym0000' Type:0
00020004h - 'sym0001' Type:0
....
00020134h - 'sym0077' Type:0

PUBDEF(90) recnum:6, offset:00000457h, len:000ah, chksum:b6h(b6)
Group: 0, Seg: 1
00000138h - 's' Type:2
0000b600h - '' Type:0
======

The problem is while 's' offset is 20138h it is marked as type 90h not
91h.  The root cause is located in obj_x():

static ObjRecord *obj_x(ObjRecord * orp, uint32_t val)
{
    if (orp->type & 1)
     orp->x_size = 32;
    if (val > 0xFFFF)
        orp = obj_force(orp, 32);
    if (orp->x_size == 32)
        return (obj_dword(orp, val));
    orp->x_size = 16;
    return (obj_word(orp, val));
}

It sets up x_size and than writes data. In the testcase data are the
offset and this offset overflows a record. In this case the record is
emitted and its x_size is cleared. Because this is last PUBDEF the new
record with only 's' symbol is emitted also but its x_size is not 32
(it's still zero) so obj_fwrite doesn't switch to 91h type.

The problem seems to be very generic and expected to be occurred on
many other record types as well.

        ----

And the fix is simple:

if (orp->x_size == 32)
{
  ObjRecord * nxt = obj_dword(orp, val);
  nxt->x_size = 32; /* x_size is cleared when a record overflows */
  return nxt;
}

16 years agotest: more smart alignment test
H. Peter Anvin [Thu, 17 Jul 2008 21:29:07 +0000 (14:29 -0700)]
test: more smart alignment test

16 years agosmartalign: use context-local label
H. Peter Anvin [Thu, 17 Jul 2008 21:28:29 +0000 (14:28 -0700)]
smartalign: use context-local label

Use a context-local label in the smart align macro.

16 years agosmartalign: adjust the alignment threshold
H. Peter Anvin [Thu, 17 Jul 2008 21:22:10 +0000 (14:22 -0700)]
smartalign: adjust the alignment threshold

Apparently the current recommendation is for a smaller threshold when
using the "generic"-style alignment macros (short jumps are cheaper on
newer CPUs.)

Also change the alignment threshold definition to reflect the maximum
number of padding instead of when to start using jumps.

16 years agosmartalign: 16-bit generic alignment macros
H. Peter Anvin [Thu, 17 Jul 2008 21:20:06 +0000 (14:20 -0700)]
smartalign: 16-bit generic alignment macros

Smart alignment content for 16-bit "generic" mode

16 years agosmartalign: 16-bit P6 NOPs
H. Peter Anvin [Thu, 17 Jul 2008 21:13:53 +0000 (14:13 -0700)]
smartalign: 16-bit P6 NOPs

Add 16-bit P6 NOPs

16 years agosmartalign.mac: smart alignments macro package
H. Peter Anvin [Wed, 16 Jul 2008 21:41:39 +0000 (14:41 -0700)]
smartalign.mac: smart alignments macro package

"%use smartalign" followed by an optional "alignmode" can be used to
enable smart macros.

16 years agopreproc: add %un[i]macro, add cleanups
H. Peter Anvin [Wed, 16 Jul 2008 21:40:01 +0000 (14:40 -0700)]
preproc: add %un[i]macro, add cleanups

Add %un[i]macro, and a few stylistic cleanups.

Note: unlike %undef, %un[i]macro takes an argument specification,
which must *exactly* match the macro being undefined.  Similarly,
%unimacro has to be used to undefine a macro defined with %imacro, and
vice versa.

16 years agostandard.mac: allow non-power-of-2 alignments
H. Peter Anvin [Wed, 16 Jul 2008 21:38:58 +0000 (14:38 -0700)]
standard.mac: allow non-power-of-2 alignments

Allow aligning to a non-power-of-2 boundary.  It's probably useless,
but doesn't really hurt.

16 years agopreproc.c: fix %ifn, %elifn
H. Peter Anvin [Wed, 16 Jul 2008 21:38:24 +0000 (14:38 -0700)]
preproc.c: fix %ifn, %elifn

The sense of %ifn and %elifn was reversed due to a bogus nonstandard
return sequence.

16 years agoFix multipass inline warning (dis/en)abling
Victor van den Elzen [Wed, 16 Jul 2008 13:20:56 +0000 (15:20 +0200)]
Fix multipass inline warning (dis/en)abling

Also add a new form: resetting warnings to their original value.

16 years agoFix %rep ... %endmacro crash
Victor van den Elzen [Wed, 16 Jul 2008 11:41:37 +0000 (13:41 +0200)]
Fix %rep ... %endmacro crash

Also improved a comment and an error message.

16 years agoupdate tests
Victor van den Elzen [Wed, 25 Jun 2008 10:00:21 +0000 (12:00 +0200)]
update tests

16 years agofix unitialized variable in eval_strfunc
Victor van den Elzen [Wed, 25 Jun 2008 09:41:40 +0000 (11:41 +0200)]
fix unitialized variable in eval_strfunc

16 years agoFix fclose bug on error.
Victor van den Elzen [Wed, 4 Jun 2008 13:24:20 +0000 (15:24 +0200)]
Fix fclose bug on error.

Contrary to the comments, the fclose is needed.
Failure to close the file caused remove to fail on Windows.

16 years agoAdd a 'make test' target.
Victor van den Elzen [Wed, 4 Jun 2008 10:44:31 +0000 (12:44 +0200)]
Add a 'make test' target.

16 years agoImprove performtest.pl
Victor van den Elzen [Wed, 28 May 2008 12:02:37 +0000 (14:02 +0200)]
Improve performtest.pl

Improve arguments and documentation of performtest.pl
Remove carriage returns in .stdout/.stderr so *nix can
read Windows test results

16 years agochanges.src: put \c{...} around macro directives
H. Peter Anvin [Mon, 14 Jul 2008 06:54:00 +0000 (02:54 -0400)]
changes.src: put \c{...} around macro directives

Put \c{...} around macro directives.  Not the only ones that should
have that, of course, but they were easy to do with search and replace.

16 years agochanges.src: remove double entry for %warning
H. Peter Anvin [Mon, 14 Jul 2008 06:49:52 +0000 (02:49 -0400)]
changes.src: remove double entry for %warning

16 years agoMove the revision history into the documentation
H. Peter Anvin [Mon, 14 Jul 2008 06:45:57 +0000 (02:45 -0400)]
Move the revision history into the documentation

Clumsily convert the revision history to nasmdoc format, so it can be
included in the documentation as Appendix C.

16 years agodoc: document packed BCD constants
H. Peter Anvin [Sun, 13 Jul 2008 22:55:55 +0000 (15:55 -0700)]
doc: document packed BCD constants

16 years agodoc: update NASM Version Macros
H. Peter Anvin [Sun, 13 Jul 2008 22:44:25 +0000 (15:44 -0700)]
doc: update NASM Version Macros

Clean up and slightly update the section on NASM version macros.

16 years agodoc: move %error/%warning to a separate section
H. Peter Anvin [Sun, 13 Jul 2008 22:41:36 +0000 (15:41 -0700)]
doc: move %error/%warning to a separate section

They don't really belong in the section on conditional assembly.

16 years agodoc: Document %strcat
H. Peter Anvin [Sun, 13 Jul 2008 22:35:07 +0000 (15:35 -0700)]
doc: Document %strcat

16 years agoUpdate CHANGES to current delta from 2.03.x.
H. Peter Anvin [Sun, 13 Jul 2008 22:25:54 +0000 (15:25 -0700)]
Update CHANGES to current delta from 2.03.x.

16 years agoBR 2017453: indirect jumps in 64-bit mode are implicitly 64 bits
H. Peter Anvin [Sun, 13 Jul 2008 22:21:01 +0000 (15:21 -0700)]
BR 2017453: indirect jumps in 64-bit mode are implicitly 64 bits

Indirect jumps in 64-bit mode implicitly have 64-bit operand size.
Fix this; the disassembly is still unnecessarily ugly, however.

16 years agotest: add test of nested %rep, BCD constants, and %warning
H. Peter Anvin [Sun, 13 Jul 2008 22:06:55 +0000 (15:06 -0700)]
test: add test of nested %rep, BCD constants, and %warning

Add a test case which has smoked out errors in the handling of nested
%rep, BCD constants, and %warning...

16 years agopreproc.c: make %warning actually issue a warning...
H. Peter Anvin [Sun, 13 Jul 2008 22:05:53 +0000 (15:05 -0700)]
preproc.c: make %warning actually issue a warning...

The calculation of "severity" was buggered up, with the result that
%warning actually issued an error.

16 years agoversion.mak for the version Makefile fragment
H. Peter Anvin [Sun, 13 Jul 2008 20:54:47 +0000 (13:54 -0700)]
version.mak for the version Makefile fragment

Be consistent about the naming of the version Makefile fragment.  We
use .mak elsewhere for Makefiles, so use that.

16 years agoFix Bugs item #2017455 (LTR in long mode)
Charles Crayne [Sun, 13 Jul 2008 19:52:02 +0000 (12:52 -0700)]
Fix Bugs item #2017455 (LTR in long mode)

LTR is valid in long (64-bit) mode, but still uses
16-bit operand, so remove NOLONG restriction.

16 years ago%EXITREP inside nested %REPs
Charles Crayne [Sat, 12 Jul 2008 23:42:33 +0000 (16:42 -0700)]
%EXITREP inside nested %REPs

Apply updated version of fix submitted with feature request 803785.
This fix causes %exitrep to terminate only the innermost %rep block,
and also allows the count for nested blocks to be calculated in the
containing block.

16 years agoAdd version.make to PERLREQ
H. Peter Anvin [Sun, 6 Jul 2008 00:45:01 +0000 (17:45 -0700)]
Add version.make to PERLREQ

version.make is produced by a Perl script, and therefore should be in
PERLREQ.

16 years agotest: simple test of packed BCD.
H. Peter Anvin [Fri, 4 Jul 2008 03:16:40 +0000 (20:16 -0700)]
test: simple test of packed BCD.