Commit Graph

2219 Commits

Author SHA1 Message Date
Cyrill Gorcunov
84b4cbab54 preproc.c: Get rid of new TABs brought in recently
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-09-12 21:39:40 +04:00
Cyrill Gorcunov
9e1c9ce8e9 BR3064376: ndisasm crash
ndisasm may crash due to lack of check of VEX table index.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-09-12 13:37:53 +04:00
Cyrill Gorcunov
5ace91d681 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>
2010-09-12 02:07:06 +04:00
Cyrill Gorcunov
9bcdd21efd doc/nasmdoc.src: Fix octal number prefix misprint
Reported-by: Anthony <anthony@cloudnet.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-09-10 22:40:27 +04:00
Cyrill Gorcunov
e2457c76d1 eval.c: Use OPFLAG_FORWARD instead of opencoded number
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-09-10 01:02:12 +04:00
Cyrill Gorcunov
55ce00907e Merge branches 'master' and 'nasm-2.09.xx' 2010-09-07 21:16:06 +04:00
Cyrill Gorcunov
e6e6a9ae2c NASM 2.09.01
A couple of NULL dereferences fixed.
See NASM version history in documentation.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-09-07 21:00:19 +04:00
Cyrill Gorcunov
234e4edce7 changes.src: Describe changes for 2.09.01
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-09-07 20:57:36 +04:00
Cyrill Gorcunov
bf11db6aca 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>
2010-09-07 20:55:03 +04:00
Cyrill Gorcunov
8fccbf33db Handle %substr invalid parameters preventing NULL dereference
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-09-07 20:54:50 +04:00
Cyrill Gorcunov
e165c1b69a nasm_quote: Use memcpy only if length provided
No need to call memcpy on empty strings

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-09-07 20:54:39 +04:00
Cyrill Gorcunov
cff031e1f7 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>
2010-09-07 20:31:11 +04:00
Cyrill Gorcunov
ab12287b4c Handle %substr invalid parameters preventing NULL dereference
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-09-07 19:10:15 +04:00
Cyrill Gorcunov
a26efa45d8 nasm_quote: Use memcpy only if length provided
No need to call memcpy on empty strings

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-09-07 19:10:10 +04:00
Cyrill Gorcunov
35519d6719 Fix NULL dereferences on %substr missing operands
%substr with dangling id issues SIGSEV. Fix it.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-09-07 00:11:47 +04:00
Cyrill Gorcunov
49cd6fbccf Fix NULL dereferences on %substr missing operands
%substr with dangling id issues SIGSEV. Fix it.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-09-07 00:10:23 +04:00
Cyrill Gorcunov
e12c50d274 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>
2010-09-06 19:44:51 +04:00
Cyrill Gorcunov
6908e58560 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>
2010-09-06 19:36:15 +04:00
Cyrill Gorcunov
68a344003a 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>
2010-08-27 23:25:04 +04:00
H. Peter Anvin
21d4ccc3c3 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>
2010-08-24 17:30:00 -07:00
H. Peter Anvin
96e8d96045 doc: untabify
Fix tab-related problems

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2010-08-24 14:20:40 -07:00
H. Peter Anvin
d68466a33d doc: override optimization with STRICT
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2010-08-24 14:14:48 -07:00
H. Peter Anvin
af5cb1b4de doc: document imm64 optimization
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2010-08-24 14:13:32 -07:00
H. Peter Anvin
9df010725f 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>
2010-08-24 14:08:16 -07:00
H. Peter Anvin
47fb7bc088 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>
2010-08-24 13:53:22 -07:00
H. Peter Anvin
2d3dce2fd7 doc: document the %use fp macro package
Documentation for %use fp was missing...

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2010-08-24 09:55:27 -07:00
H. Peter Anvin
83baad7d9a NASM 2.09 2010-08-24 09:13:34 -07:00
H. Peter Anvin
e7854b98fd 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>
2010-08-19 17:20:18 -07:00
H. Peter Anvin
5d62e57a0c 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>
2010-08-19 17:04:36 -07:00
H. Peter Anvin
23f0b16c21 ndisasm: unify VEX handling
Unify VEX handling between the 026x and 0270 bytecodes.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2010-08-19 16:59:35 -07:00
H. Peter Anvin
7023d638de 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>
2010-08-16 22:13:14 -07:00
H. Peter Anvin
8810e0f794 NASM 2.09rc7 2010-08-16 15:24:01 -07:00
H. Peter Anvin
dbdb6d3df6 test/avx: remove deleted instructions
Remove the deleted VPERMIL2 instructions.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2010-08-16 15:23:16 -07:00
H. Peter Anvin
96ba233088 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>
2010-08-16 15:22:21 -07:00
H. Peter Anvin
229fa6c465 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>
2010-08-16 15:21:48 -07:00
H. Peter Anvin
cfe6d20e3a insns.dat: fix encoding of VCVTSD2SS
Fix typo in the definition of VCVTSD2SS.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2010-08-16 15:08:51 -07:00
H. Peter Anvin
c23c52040f 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>
2010-08-16 15:05:25 -07:00
H. Peter Anvin
0217039cdb 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>
2010-08-16 14:57:09 -07:00
H. Peter Anvin
421059c689 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>
2010-08-16 14:56:33 -07:00
H. Peter Anvin
978c2170fc 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>
2010-08-16 13:48:43 -07:00
Cyrill Gorcunov
84a9e308c3 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>
2010-08-16 13:53:22 +04:00
Cyrill Gorcunov
327edcfc7a doc: Fix typo in changes.src
Reported-by: Frank Kotler <fbkotler@zytor.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-08-16 13:47:24 +04:00
Keith Kanios
88d947e909 preproc.c: revamped context-local fall-through warning message 2010-08-14 12:47:45 -05:00
Keith Kanios
c71cb6b72a doc/nasmdoc.src: revamped context fall-through entry 2010-08-14 12:36:49 -05:00
Cyrill Gorcunov
e1b6e5712b 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>
2010-08-13 12:32:53 +04:00
H. Peter Anvin
e54805b30d LICENSE: update year
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2010-08-12 20:15:27 -07:00
Cyrill Gorcunov
8cb43d3f68 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>
2010-08-12 19:09:28 +04:00
Cyrill Gorcunov
41b17b1e31 standart.mac: Style nitfix
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-08-12 18:47:52 +04:00
Cyrill Gorcunov
d90693c79c 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>
2010-08-11 20:31:46 +04:00
Keith Kanios
404589e558 preproc.c: modified deprecation warning for context-local label fallthrough 2010-08-10 20:12:57 -05:00