platform/upstream/nasm.git
13 years agoBR3079777: Explain %00 in documentation
Frank Kotler [Tue, 5 Oct 2010 14:37:57 +0000 (18:37 +0400)]
BR3079777: Explain %00 in documentation

Signed-off-by: Frank Kotler <fbkotler@zytor.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13 years agoAdd SubmittingPatches file
Cyrill Gorcunov [Sun, 3 Oct 2010 17:02:08 +0000 (21:02 +0400)]
Add SubmittingPatches file

Adopted from Linux's Documentation/SubmittingPatches

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13 years agoBR3079550: NASM crash on run-time for OMF output format
Cyrill Gorcunov [Fri, 1 Oct 2010 21:21:00 +0000 (01:21 +0400)]
BR3079550: NASM crash on run-time for OMF output format

We could have accessed malloc'ed data on external symbols
in obj and ieee output formats. Fix it by using nasm_zalloc.

Reported-by: Jiri Malak
Patch-by: Jiri Malak
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13 years agoNASM 2.10rc1
Cyrill Gorcunov [Thu, 30 Sep 2010 18:45:57 +0000 (22:45 +0400)]
NASM 2.10rc1

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13 years agoBR30730640: Restore preprocessor token concatenation rules
Cyrill Gorcunov [Fri, 24 Sep 2010 22:33:20 +0000 (02:33 +0400)]
BR30730640: Restore preprocessor token concatenation rules

During nasm-2.06 development we broke the rules for
concatenation of preprocessor tokens (d784a083a3f1).

The former candidates for concatenation were (in terms of RE)

expand_smacro
    [(TOK_ID|TOK_PREPROC_ID)][(TOK_ID|TOK_PREPROC_ID|TOK_NUMBER)]

expand_mmac_params
    [(TOK_ID|TOK_NUMBER|TOK_FLOAT)][(TOK_ID|TOK_NUMBER|TOK_FLOAT|TOK_OTHER)]

[ nb: review commits ec88c1beac00 , 20a94ad7fe41 and 984279b1dde9 if
  you going to change this one ]

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13 years agoMore tests automation
Cyrill Gorcunov [Fri, 24 Sep 2010 17:22:30 +0000 (21:22 +0400)]
More tests automation

Not all covered but still worth to put in

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13 years agotest: Add br3074517.asm
Cyrill Gorcunov [Fri, 24 Sep 2010 11:25:59 +0000 (15:25 +0400)]
test: Add br3074517.asm

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13 years agoBR3074517: Print %macro name inside %rep blocks
Cyrill Gorcunov [Fri, 24 Sep 2010 11:24:42 +0000 (15:24 +0400)]
BR3074517: Print %macro name inside %rep blocks

If we're to print inside %rep block we should find
out which %macro it belongs.

Reported-by: Rob Neff
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13 years agophash: move sample function to the sample file
H. Peter Anvin [Wed, 22 Sep 2010 21:02:28 +0000 (14:02 -0700)]
phash: move sample function to the sample file

read_input() shouldn't be part of the phash.ph module; instead it
should go into the sample usage file phash.pl.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
13 years agoMerge branch 'nasm-2.09.xx'
Cyrill Gorcunov [Fri, 17 Sep 2010 22:59:08 +0000 (02:59 +0400)]
Merge branch 'nasm-2.09.xx'

13 years agoNASM 2.09.02
Cyrill Gorcunov [Fri, 17 Sep 2010 22:57:06 +0000 (02:57 +0400)]
NASM 2.09.02

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13 years agodoc/changes.src: Describe changes
Cyrill Gorcunov [Fri, 17 Sep 2010 22:55:46 +0000 (02:55 +0400)]
doc/changes.src: Describe changes

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13 years agoAdd test-case for BR3066383
Cyrill Gorcunov [Fri, 17 Sep 2010 17:53:16 +0000 (21:53 +0400)]
Add test-case for BR3066383

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13 years agoBR3066383: Restore backward compatibility with token pasting
Cyrill Gorcunov [Wed, 15 Sep 2010 20:16:19 +0000 (00:16 +0400)]
BR3066383: Restore backward compatibility with token pasting

It seems to be a bit long story for the reason if this bug. But
lets be verbose and describe all byte-to-byte. And it is all about
preprocessor code, in particular paste_tokens and expand_mmac_params.

Initially the problem (not the same but similar) was noticed and
fixed in commit ec88c1be. The problem reveals itself with code snippets
like

 | %macro m 1
 |  %push
 |      %define %$arg %1
 | %%top_%$arg:
 |      resb ($ - %%top_%$arg)
 |  %pop
 | %endmacro

So with commits ec88c1be51fd86e01f6741fc985d880c we did expand
local single macro before processing tokens pasting unconditionally.

But then it being found that such approach breaks %assign directive.
The snippets like below didn't work

 | %macro m 1
 |  %push
 |      %assign %$arg %1
 |      %assign %$arg %1+%$arg
 |  %pop
 | %endmacro

So all these commits were reverted and we just stop pasting tokens
in paste_tokens() after TOK_PREPROC_ID (commit 20a94ad7). Unfortunately
this breaks %assign with compound preproc id

 | %macro m3 1
 |    %push
 |        %assign %$_uses 0
 |        %rep 4
 |            %assign %$_ur%$_uses %$_uses
 |            mov ecx, %$_ur%$_uses
 |            %assign %$_uses %$_uses+1
 |        %endrep
 |    %pop
 | %endmacro

To fix this bug we have to combine two approaches at once,
we should continue pasting after TOK_PREPROC_ID and expand
sequential TOK_PREPROC_IDs except first one.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13 years agoMerge branch 'nasm-2.09.xx'
Cyrill Gorcunov [Wed, 15 Sep 2010 17:18:01 +0000 (21:18 +0400)]
Merge branch 'nasm-2.09.xx'

13 years agochanges.src: Describe changes for 2.09.02
Cyrill Gorcunov [Wed, 15 Sep 2010 17:13:48 +0000 (21:13 +0400)]
changes.src: Describe changes for 2.09.02

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13 years agoBR3064376: ndisasm crash
Cyrill Gorcunov [Sun, 12 Sep 2010 09:37:53 +0000 (13:37 +0400)]
BR3064376: ndisasm crash

ndisasm may crash due to lack of check of VEX table index.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13 years agoBR3064459: Missing %endif doesn't always cause error
Cyrill Gorcunov [Sat, 11 Sep 2010 22:00:05 +0000 (02:00 +0400)]
BR3064459: Missing %endif doesn't always cause error

error() routine is conditional dependent so we should
use nasm_error instead to yield message unconditionally.

Reported-by: Christian Masloch
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13 years agodoc/nasmdoc.src: Fix octal number prefix misprint
Cyrill Gorcunov [Fri, 10 Sep 2010 18:40:27 +0000 (22:40 +0400)]
doc/nasmdoc.src: Fix octal number prefix misprint

Reported-by: Anthony <anthony@cloudnet.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13 years agoMerge branch 'nasm-2.09.xx'
H. Peter Anvin [Wed, 15 Sep 2010 15:59:51 +0000 (08:59 -0700)]
Merge branch 'nasm-2.09.xx'

13 years agochanges: document fixed token reversal for %deftok
H. Peter Anvin [Wed, 15 Sep 2010 15:59:12 +0000 (08:59 -0700)]
changes: document fixed token reversal for %deftok

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
13 years agopreproc: reverse the order of the tokens in %deftok
H. Peter Anvin [Wed, 15 Sep 2010 15:57:21 +0000 (08:57 -0700)]
preproc: reverse the order of the tokens in %deftok

Smacros are apparently stored with the token stream reversed, so make
sure %deftok matches that sense of relatity.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
13 years agopreproc.c: Get rid of new TABs brought in recently
Cyrill Gorcunov [Sun, 12 Sep 2010 17:39:40 +0000 (21:39 +0400)]
preproc.c: Get rid of new TABs brought in recently

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13 years agoBR3064376: ndisasm crash
Cyrill Gorcunov [Sun, 12 Sep 2010 09:37:53 +0000 (13:37 +0400)]
BR3064376: ndisasm crash

ndisasm may crash due to lack of check of VEX table index.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13 years agoBR3064459: Missing %endif doesn't always cause error
Cyrill Gorcunov [Sat, 11 Sep 2010 22:00:05 +0000 (02:00 +0400)]
BR3064459: Missing %endif doesn't always cause error

error() routine is conditional dependent so we should
use nasm_error instead to yield message unconditionally.

Reported-by: Christian Masloch
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13 years agodoc/nasmdoc.src: Fix octal number prefix misprint
Cyrill Gorcunov [Fri, 10 Sep 2010 18:40:27 +0000 (22:40 +0400)]
doc/nasmdoc.src: Fix octal number prefix misprint

Reported-by: Anthony <anthony@cloudnet.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13 years agoeval.c: Use OPFLAG_FORWARD instead of opencoded number
Cyrill Gorcunov [Thu, 9 Sep 2010 21:02:12 +0000 (01:02 +0400)]
eval.c: Use OPFLAG_FORWARD instead of opencoded number

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13 years agoMerge branches 'master' and 'nasm-2.09.xx'
Cyrill Gorcunov [Tue, 7 Sep 2010 17:16:06 +0000 (21:16 +0400)]
Merge branches 'master' and 'nasm-2.09.xx'

13 years agoNASM 2.09.01
Cyrill Gorcunov [Tue, 7 Sep 2010 17:00:19 +0000 (21:00 +0400)]
NASM 2.09.01

A couple of NULL dereferences fixed.
See NASM version history in documentation.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13 years agochanges.src: Describe changes for 2.09.01
Cyrill Gorcunov [Tue, 7 Sep 2010 16:57:36 +0000 (20:57 +0400)]
changes.src: Describe changes for 2.09.01

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13 years agopreproc.c: Make %substr robust
Cyrill Gorcunov [Tue, 7 Sep 2010 16:31:11 +0000 (20:31 +0400)]
preproc.c: Make %substr robust

Make %substr robust to handle -1,-1 parameters
and restore old behavior when number of characters
in substring is greater then length of string itself.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13 years agoHandle %substr invalid parameters preventing NULL dereference
Cyrill Gorcunov [Tue, 7 Sep 2010 06:42:02 +0000 (10:42 +0400)]
Handle %substr invalid parameters preventing NULL dereference

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13 years agonasm_quote: Use memcpy only if length provided
Cyrill Gorcunov [Tue, 7 Sep 2010 05:52:47 +0000 (09:52 +0400)]
nasm_quote: Use memcpy only if length provided

No need to call memcpy on empty strings

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13 years agopreproc.c: Make %substr robust
Cyrill Gorcunov [Tue, 7 Sep 2010 16:31:11 +0000 (20:31 +0400)]
preproc.c: Make %substr robust

Make %substr robust to handle -1,-1 parameters
and restore old behavior when number of characters
in substring is greater then length of string itself.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13 years agoHandle %substr invalid parameters preventing NULL dereference
Cyrill Gorcunov [Tue, 7 Sep 2010 06:42:02 +0000 (10:42 +0400)]
Handle %substr invalid parameters preventing NULL dereference

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13 years agonasm_quote: Use memcpy only if length provided
Cyrill Gorcunov [Tue, 7 Sep 2010 05:52:47 +0000 (09:52 +0400)]
nasm_quote: Use memcpy only if length provided

No need to call memcpy on empty strings

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13 years agoFix NULL dereferences on %substr missing operands
Cyrill Gorcunov [Mon, 6 Sep 2010 19:49:52 +0000 (23:49 +0400)]
Fix NULL dereferences on %substr missing operands

%substr with dangling id issues SIGSEV. Fix it.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13 years agoFix NULL dereferences on %substr missing operands
Cyrill Gorcunov [Mon, 6 Sep 2010 19:49:52 +0000 (23:49 +0400)]
Fix NULL dereferences on %substr missing operands

%substr with dangling id issues SIGSEV. Fix it.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13 years agoBR3060469: Fix SIGSEV on missed %deftok second parameter
Cyrill Gorcunov [Mon, 6 Sep 2010 15:36:15 +0000 (19:36 +0400)]
BR3060469: Fix SIGSEV on missed %deftok second parameter

In case if a second parameter of %deftok is missed we hit
NULL dereference. Fix it.

Reported-by: Christian Masloch
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13 years agoBR3060469: Fix SIGSEV on missed %deftok second parameter
Cyrill Gorcunov [Mon, 6 Sep 2010 15:36:15 +0000 (19:36 +0400)]
BR3060469: Fix SIGSEV on missed %deftok second parameter

In case if a second parameter of %deftok is missed we hit
NULL dereference. Fix it.

Reported-by: Christian Masloch
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13 years agoparser.c: Drop space line and use hex notation
Cyrill Gorcunov [Fri, 27 Aug 2010 19:25:04 +0000 (23:25 +0400)]
parser.c: Drop space line and use hex notation

For big numbers it's easier to estimate bytes count
if they are written in hex notation. Let it be so.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13 years agoBR 3052618: handle segment register operations in 64-bit mode
H. Peter Anvin [Wed, 25 Aug 2010 00:28:00 +0000 (17:28 -0700)]
BR 3052618: handle segment register operations in 64-bit mode

Handle segment register operations in 64-bit mode, and add a few
optimization patterns.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
13 years agodoc: untabify
H. Peter Anvin [Tue, 24 Aug 2010 21:20:40 +0000 (14:20 -0700)]
doc: untabify

Fix tab-related problems

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
13 years agodoc: override optimization with STRICT
H. Peter Anvin [Tue, 24 Aug 2010 21:14:48 +0000 (14:14 -0700)]
doc: override optimization with STRICT

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
13 years agodoc: document imm64 optimization
H. Peter Anvin [Tue, 24 Aug 2010 21:13:32 +0000 (14:13 -0700)]
doc: document imm64 optimization

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
13 years agoOptimize mov r64,imm
H. Peter Anvin [Tue, 24 Aug 2010 21:08:16 +0000 (14:08 -0700)]
Optimize mov r64,imm

Handle immediate-size optimization for "mov r64,imm" -- reduce it to
"mov r32,imm32" or "mov r64,imm32" as appropriate.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
13 years agoassemble: add an OPT instruction flags for optimizing assembly only
H. Peter Anvin [Tue, 24 Aug 2010 20:53:22 +0000 (13:53 -0700)]
assemble: add an OPT instruction flags for optimizing assembly only

Add an OPT flag to only use a pattern for optimizing assembly only.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
13 years agodoc: document the %use fp macro package
H. Peter Anvin [Tue, 24 Aug 2010 16:55:27 +0000 (09:55 -0700)]
doc: document the %use fp macro package

Documentation for %use fp was missing...

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
13 years agoNASM 2.09
H. Peter Anvin [Tue, 24 Aug 2010 16:13:34 +0000 (09:13 -0700)]
NASM 2.09

13 years agoinsns.pl: make insnsd.c a bit easier to read
H. Peter Anvin [Fri, 20 Aug 2010 00:20:18 +0000 (17:20 -0700)]
insns.pl: make insnsd.c a bit easier to read

Formatting changes (no object code difference) to insnsd.c for
readability.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
13 years agondisasm: handle VEX.LIG
H. Peter Anvin [Fri, 20 Aug 2010 00:04:36 +0000 (17:04 -0700)]
ndisasm: handle VEX.LIG

A lot of instructions ignore the L bit in the VEX prefix, just like
a lot of instructions ignore the W bit, so don't use them in the
sub-table select.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
13 years agondisasm: unify VEX handling
H. Peter Anvin [Thu, 19 Aug 2010 23:59:35 +0000 (16:59 -0700)]
ndisasm: unify VEX handling

Unify VEX handling between the 026x and 0270 bytecodes.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
13 years agondisasm: fix handing of byte codes 250-253, 324
H. Peter Anvin [Tue, 17 Aug 2010 05:13:14 +0000 (22:13 -0700)]
ndisasm: fix handing of byte codes 250-253, 324

Fix handling of byte codes 250-253 (sign-extended 32-bit immediate,
extended to 64 bits) and 324 (instruction must have osize 64).

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
13 years agoNASM 2.09rc7
H. Peter Anvin [Mon, 16 Aug 2010 22:24:01 +0000 (15:24 -0700)]
NASM 2.09rc7

13 years agotest/avx: remove deleted instructions
H. Peter Anvin [Mon, 16 Aug 2010 22:23:16 +0000 (15:23 -0700)]
test/avx: remove deleted instructions

Remove the deleted VPERMIL2 instructions.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
13 years agoinsns.dat: permit contracted forms for VBLENDVP
H. Peter Anvin [Mon, 16 Aug 2010 22:22:21 +0000 (15:22 -0700)]
insns.dat: permit contracted forms for VBLENDVP

Allow implicit operands for VBLENDVP, just as for other instructions,
since the semi-legacy forms now are removed.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
13 years agoassmemble.c: fix VEX.W logic
H. Peter Anvin [Mon, 16 Aug 2010 22:21:48 +0000 (15:21 -0700)]
assmemble.c: fix VEX.W logic

Fix the generation logic for VEX.W, which unfortunately got the wrong
constants.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
13 years agoinsns.dat: fix encoding of VCVTSD2SS
H. Peter Anvin [Mon, 16 Aug 2010 22:08:51 +0000 (15:08 -0700)]
insns.dat: fix encoding of VCVTSD2SS

Fix typo in the definition of VCVTSD2SS.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
13 years agoinsns.dat: SSE encoding of VBLEND with VEX prefix is forbidden
H. Peter Anvin [Mon, 16 Aug 2010 22:05:25 +0000 (15:05 -0700)]
insns.dat: SSE encoding of VBLEND with VEX prefix is forbidden

Version 7 of the AVX spec specifically forbids (#UD) using the
66 0F 38 14/15 forms of the BLENDV instructions with a VEX prefix;
those encodings are strictly legacy SSE 4.1.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
13 years agoinsns.dat: updates from AVX v7
H. Peter Anvin [Mon, 16 Aug 2010 21:57:09 +0000 (14:57 -0700)]
insns.dat: updates from AVX v7

Updates from the AVX version 7 specification: mostly tightening of the
rules for VEX.L and VEX.W, but remove the VPERMIL2 instructions.

Also encode all the full-length forms of the VCMP instructions and
prefer those for the disassembly.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
13 years agoassemble: handle vex.lig
H. Peter Anvin [Mon, 16 Aug 2010 21:56:33 +0000 (14:56 -0700)]
assemble: handle vex.lig

AVX version 7 introduces the concept of .lig, meaning VEX.L is
ignored.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
13 years agovex: change .wx to .wig to match the latest AVX spec
H. Peter Anvin [Mon, 16 Aug 2010 20:48:43 +0000 (13:48 -0700)]
vex: change .wx to .wig to match the latest AVX spec

Change the .wx (ignore the W field) to .wig, to match the latest
version of the AVX specification.  This is not a functional change,
but just makes instruction patterns a little easier to write.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
13 years agodoc: Update -O option description
Cyrill Gorcunov [Mon, 16 Aug 2010 09:53:22 +0000 (13:53 +0400)]
doc: Update -O option description

We use -Ox by default since Nasm-2.09 so "-O0" is not
longer "default" option. But first paragraph still has
the reference which confuses people. Get rid of it.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13 years agodoc: Fix typo in changes.src
Cyrill Gorcunov [Mon, 16 Aug 2010 09:47:24 +0000 (13:47 +0400)]
doc: Fix typo in changes.src

Reported-by: Frank Kotler <fbkotler@zytor.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13 years agopreproc.c: revamped context-local fall-through warning message
Keith Kanios [Sat, 14 Aug 2010 17:47:45 +0000 (12:47 -0500)]
preproc.c: revamped context-local fall-through warning message

13 years agodoc/nasmdoc.src: revamped context fall-through entry
Keith Kanios [Sat, 14 Aug 2010 17:36:49 +0000 (12:36 -0500)]
doc/nasmdoc.src: revamped context fall-through entry

13 years agodoc: Describe context-through lookup
Cyrill Gorcunov [Fri, 13 Aug 2010 08:32:53 +0000 (12:32 +0400)]
doc: Describe context-through lookup

Feel free to update this text as well,
and check it please for being more/less
readable.

CC: Keith Kanios <keith@kanios.net>
CC: "H. Peter Anvin" <hpa@zytor.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13 years agoLICENSE: update year
H. Peter Anvin [Fri, 13 Aug 2010 02:53:37 +0000 (19:53 -0700)]
LICENSE: update year

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
13 years agosectalign: Implement on/off mode
Cyrill Gorcunov [Thu, 12 Aug 2010 15:09:28 +0000 (19:09 +0400)]
sectalign: Implement on/off mode

And describe it in documentation. We've introduced
sectalign in 2.09rc series and have to provide an
ability to steer this feature.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13 years agostandart.mac: Style nitfix
Cyrill Gorcunov [Tue, 10 Aug 2010 10:19:03 +0000 (14:19 +0400)]
standart.mac: Style nitfix

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13 years agopreproc.c: Context-through single macros expansion is deprecated
Cyrill Gorcunov [Wed, 11 Aug 2010 16:31:46 +0000 (20:31 +0400)]
preproc.c: Context-through single macros expansion is deprecated

For now we inform users about their sources need to be
updated and also since _all_ context case are legit
for single macros only we split lookup into two phases:

1) Lookup in active context, which is perfectly valid
2) Lookup in external contexts, which will be deprecated soon.

If (2) happens we yield warning.

A typical testcase is
---
  %macro one 0
  %push
    %$a:
    %assign %$b 12
      %push
        mov eax, %$a
        mov eax, %$b  ; hit -- context through
      %pop
    %pop
  %endmacro
  one
---

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13 years agopreproc.c: modified deprecation warning for context-local label fallthrough
Keith Kanios [Wed, 11 Aug 2010 01:12:57 +0000 (20:12 -0500)]
preproc.c: modified deprecation warning for context-local label fallthrough

13 years agopreproc.c: Fix error message typo
Cyrill Gorcunov [Mon, 9 Aug 2010 16:17:17 +0000 (20:17 +0400)]
preproc.c: Fix error message typo

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13 years agotest: Add br3041451 testcase
Cyrill Gorcunov [Mon, 9 Aug 2010 14:42:57 +0000 (18:42 +0400)]
test: Add br3041451 testcase

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13 years agoBR3041451: Implement upper bound for %rep counter
Cyrill Gorcunov [Mon, 9 Aug 2010 09:58:22 +0000 (13:58 +0400)]
BR3041451: Implement upper bound for %rep counter

Since %rep counter is a 64 bit signed integer we have to use some
"maximum possible value" limit (upper bound) otherwise there may be
a situation when %rep counter is 0 or even negative while user
has been passing big positive integer value.

Reported-by: nasm64developer
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13 years agopreproc.c: added deprecation warning for context-local label fallthrough
Keith Kanios [Mon, 9 Aug 2010 05:55:44 +0000 (00:55 -0500)]
preproc.c: added deprecation warning for context-local label fallthrough

13 years agoNASM 2.09rc6
Cyrill Gorcunov [Fri, 6 Aug 2010 15:23:31 +0000 (19:23 +0400)]
NASM 2.09rc6

It likely to be the last -rc before final relase.
Give it a good testing. We should be in pretty good
shape.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13 years agotest: Add automatizing annotations to imm64.asm
Cyrill Gorcunov [Wed, 4 Aug 2010 13:27:17 +0000 (17:27 +0400)]
test: Add automatizing annotations to imm64.asm

H. Peter Anvin pointed
|
| Btw, test/imm64.asm needs test engine annotations.
|

Make it so.

Reported-by: "H. Peter Anvin" <hpa@zytor.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13 years agoinsns.dat: unbreak test/imm64.bin
H. Peter Anvin [Mon, 2 Aug 2010 19:04:50 +0000 (12:04 -0700)]
insns.dat: unbreak test/imm64.bin

Unbreak the following subtest in test/imm64.bin:

mov qword [rax],dword 11223344h

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
13 years agoelf: Move stabs symbol table format into outelf.h
Cyrill Gorcunov [Thu, 29 Jul 2010 06:12:29 +0000 (10:12 +0400)]
elf: Move stabs symbol table format into outelf.h

Get rid of code duplication

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13 years agonasmlib.c: fix typo in nasm_init_malloc_error
Cyrill Gorcunov [Wed, 28 Jul 2010 19:27:11 +0000 (23:27 +0400)]
nasmlib.c: fix typo in nasm_init_malloc_error

Typo happened in 9b603082 so -DLOGALLOC gets broken.
Not that important since this is a developer oriented
feature but should be fixed anyway.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13 years agoNASM 2.09rc5
Cyrill Gorcunov [Wed, 28 Jul 2010 18:03:43 +0000 (22:03 +0400)]
NASM 2.09rc5

13 years agodoc: Updates on macro ranges
Cyrill Gorcunov [Wed, 28 Jul 2010 09:57:01 +0000 (13:57 +0400)]
doc: Updates on macro ranges

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13 years agolabels.c: cleanup
Cyrill Gorcunov [Wed, 28 Jul 2010 06:18:48 +0000 (10:18 +0400)]
labels.c: cleanup

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13 years agoGet rid of misc/altreg.inc
Cyrill Gorcunov [Tue, 27 Jul 2010 11:41:03 +0000 (15:41 +0400)]
Get rid of misc/altreg.inc

It's the same as macros/altreg.mac which is already included.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13 years agodoc: Explain SECTALIGN
Cyrill Gorcunov [Wed, 28 Jul 2010 13:59:49 +0000 (17:59 +0400)]
doc: Explain SECTALIGN

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13 years agodoc: Fix ..sym section name misprint
Cyrill Gorcunov [Mon, 26 Jul 2010 21:48:27 +0000 (01:48 +0400)]
doc: Fix ..sym section name misprint

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13 years agoassemble.c: Style nitfix
Cyrill Gorcunov [Mon, 26 Jul 2010 19:14:40 +0000 (23:14 +0400)]
assemble.c: Style nitfix

Various tabs/space mixture cleaned and some more.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
14 years agoRevert "Improve process_ea and introduce -OL"
H. Peter Anvin [Sun, 25 Jul 2010 19:43:30 +0000 (12:43 -0700)]
Revert "Improve process_ea and introduce -OL"

This reverts commit ac732cb6a599836bf4c988e59ac6de4498758c72.

Resolved Conflicts:

doc/nasmdoc.src

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agonasm.h: move "regs.h" to top; make is_register() a bool
H. Peter Anvin [Sun, 25 Jul 2010 07:17:12 +0000 (00:17 -0700)]
nasm.h: move "regs.h" to top; make is_register() a bool

Move the #include of regs.h to the top with the other includes, and
make is_register() -- being a boolean predicate -- return bool.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agomove is_register helper to nasm.h
Cyrill Gorcunov [Sun, 25 Jul 2010 07:09:56 +0000 (11:09 +0400)]
move is_register helper to nasm.h

 H. Peter Anvin noted:
 |
 | Could we avoid putting static code that has no dynamic content in
 | dynamically generated files... it just complicates things unnecessarily.
 |
 | The above can move into nasm.h for example.
 |

Good idea.

CC: "H. Peter Anvin" <hpa@zytor.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
14 years agoUse is_register helper
Cyrill Gorcunov [Sat, 24 Jul 2010 21:16:33 +0000 (01:16 +0400)]
Use is_register helper

Save us some line of code

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
14 years agoregs.pl: Introduce is_register() helper
Cyrill Gorcunov [Sat, 24 Jul 2010 21:10:17 +0000 (01:10 +0400)]
regs.pl: Introduce is_register() helper

Instead of opencoded check use inline helper.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
14 years agoRemove redundant sentence in docs
Victor van den Elzen [Sat, 24 Jul 2010 20:24:15 +0000 (22:24 +0200)]
Remove redundant sentence in docs

14 years agoImprove process_ea and introduce -OL
Victor van den Elzen [Tue, 31 Mar 2009 02:59:44 +0000 (04:59 +0200)]
Improve process_ea and introduce -OL

Two fixes:
1. Optimization of [bx+0xFFFF] etc
   0xFFFF is an sbyte under 16-bit semantics,
   so make sure to check it right.

2. Don't optimize displacements in -O0
   Displacements that fit into an sbyte or
   can be removed should *not* be optimized in -O0.

   Implicit zero displacements are still optimized, e.g.:
   [eax] -> 0 bit displacement, [ebp] -> 8 bit displacement.
   However explicit displacements are not optimized:
   [eax+0] -> 32 bit displacement, [ebp+0] -> 32 bit displacement.

Because #2 breaks compatibility with 0.98,
I introduced a new optimization level: -OL, legacy.

14 years agodoc: Update changes.src
Cyrill Gorcunov [Fri, 23 Jul 2010 14:57:40 +0000 (18:57 +0400)]
doc: Update changes.src

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
14 years agopreproc.: Fix NULL dereference on broken %strlen argument
Cyrill Gorcunov [Fri, 23 Jul 2010 14:51:51 +0000 (18:51 +0400)]
preproc.: Fix NULL dereference on broken %strlen argument

Under particular circumstances %strlen may cause SIGSEG. A typical
example is %strlen with nonexistent macro argument.

[ Testcase test/strlen.asm ]

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
14 years agopreproc: allow non-identifier character in environment variables
H. Peter Anvin [Tue, 20 Jul 2010 21:56:30 +0000 (14:56 -0700)]
preproc: allow non-identifier character in environment variables

Allow non-identifier characters in the name of environment variables,
by surrounding them with string quotes (subject to ordinary
string-quoting rules.)

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
14 years agochanges.src: Fix misprint in "instructions" word.
Cyrill Gorcunov [Sat, 17 Jul 2010 14:24:13 +0000 (18:24 +0400)]
changes.src: Fix misprint in "instructions" word.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
14 years agonasmdoc: we still miss Chuck, but...
H. Peter Anvin [Fri, 16 Jul 2010 05:51:26 +0000 (22:51 -0700)]
nasmdoc: we still miss Chuck, but...

We still miss Chuck, but I don't think we can really say anymore we're
doing this particular release in his memory.

Requiescat in pace, our friend.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>