nasm.c: smarter handling of missing directives
[nasm.git] / doc / changes.src
blob1d98a076ed85aa4dda854b5e17ca5b323b7f5b71
1 \#
2 \# NASM revision history in nasmdoc format
3 \#
5 \H{cl-2.xx} NASM 2 Series
7 The NASM 2 series support x86-64, and is the production version of NASM
8 since 2007.
11 \S{cl-2.08} Version 2.08
13 \b A number of enhancements/fixes in macros area.
15 \#\b Support for arbitrarily terminating macro expansions \c{%exitmacro}.
16 \#  See \k{exitmacro}.
18 \#\b Support for recursive macro expansion \c{%rmacro}/\c{%irmacro}.
19 \#  See \k{mlrmacro}.
21 \b Support for converting strings to tokens.  See \k{deftok}.
23 \b Fuzzy operand size logic introduced.
25 \b Fix COFF stack overrun on too long export identifiers.
27 \b Fix Macho-O alignment bug.
29 \b Fix crashes with -fwin32 on file with many exports.
31 \b Fix stack overrun for too long [DEBUG id].
33 \b Fix incorrect sbyte usage in IMUL (hit only if optimization
34   flag passed).
36 \b Append ending token for \c{.stabs} records in the ELF output format.
38 \b New NSIS script which uses ModernUI and MultiUser approach.
40 \b Visual Studio 2008 NASM integration (rules file).
42 \b Warn a user if a constant is too long (and as result will be stripped).
44 \b The obsoleted pre-XOP AMD SSE5 instruction set which was never actualized
45   was removed.
47 \b Fix stack overrun on too long error file name passed from the command line.
49 \b Bind symbols to the .text section by default (ie in case if SECTION
50   directive was omitted) in the ELF output format.
52 \b Fix sync points array index wrapping.
54 \b A few fixes for FMA4 and XOP instruction templates.
56 \b Add AMD Lightweight Profiling (LWP) instructions.
58 \b Fix the offset for \c{%arg} in 64-bit mode.
60 \b An undefined local macro (\c{%$}) no longer matches a global macro
61   with the same name.
63 \b Fix NULL dereference on too long local labels.
66 \S{cl-2.07} Version 2.07
68 \b NASM is now under the 2-clause BSD license.  See \k{legal}.
70 \b Fix the section type for the \c{.strtab} section in the \c{elf64}
71   output format.
73 \b Fix the handling of \c{COMMON} directives in the \c{obj} output format.
75 \b New \c{ith} and \c{srec} output formats; these are variants of the
76   \c{bin} output format which output Intel hex and Motorola S-records,
77   respectively.  See \k{ithfmt} and \k{srecfmt}.
79 \b \c{rdf2ihx} replaced with an enhanced \c{rdf2bin}, which can output
80   binary, COM, Intel hex or Motorola S-records.
82 \b The Windows installer now puts the NASM directory first in the
83   \c{PATH} of the "NASM Shell".
85 \b Revert the early expansion behavior of \c{%+} to pre-2.06 behavior:
86   \c{%+} is only expanded late.
88 \b Yet another Mach-O alignment fix.
90 \b Don't delete the list file on errors.  Also, include error and
91   warning information in the list file.
93 \b Support for 64-bit Mach-O output, see \k{machofmt}.
95 \b Fix assert failure on certain operations that involve strings with
96   high-bit bytes.
99 \S{cl-2.06} Version 2.06
101 \b This release is dedicated to the memory of Charles A. Crayne, long
102   time NASM developer as well as moderator of \c{comp.lang.asm.x86} and
103   author of the book \e{Serious Assembler}.  We miss you, Chuck.
105 \b Support for indirect macro expansion (\c{%[...]}).  See \k{indmacro}.
107 \b \c{%pop} can now take an argument, see \k{pushpop}.
109 \b The argument to \c{%use} is no longer macro-expanded.  Use
110   \c{%[...]} if macro expansion is desired.
112 \b Support for thread-local storage in ELF32 and ELF64.  See \k{elftls}.
114 \b Fix crash on \c{%ifmacro} without an argument.
116 \b Correct the arguments to the \c{POPCNT} instruction.
118 \b Fix section alignment in the Mach-O format.
120 \b Update AVX support to version 5 of the Intel specification.
122 \b Fix the handling of accesses to context-local macros from higher
123   levels in the context stack.
125 \b Treat \c{WAIT} as a prefix rather than as an instruction, thereby
126   allowing constructs like \c{O16 FSAVE} to work correctly.
128 \b Support for structures with a non-zero base offset. See \k{struc}.
130 \b Correctly handle preprocessor token concatenation (see \k{concat})
131    involving floating-point numbers.
133 \b The \c{PINSR} series of instructions have been corrected and
134    rationalized.
136 \b Removed AMD SSE5, replaced with the new XOP/FMA4/CVT16 (rev 3.03)
137    spec.
139 \b The ELF backends no longer automatically generate a \c{.comment} section.
141 \b Add additional "well-known" ELF sections with default attributes.  See
142    \k{elfsect}.
145 \S{cl-2.05.01} Version 2.05.01
147 \b Fix the \c{-w}/\c{-W} option parsing, which was broken in NASM 2.05.
150 \S{cl-2.05} Version 2.05
152 \b Fix redundant REX.W prefix on \c{JMP reg64}.
154 \b Make the behaviour of \c{-O0} match NASM 0.98 legacy behavior.
155   See \k{opt-O}.
157 \b \c{-w-user} can be used to suppress the output of \c{%warning} directives.
158   See \k{opt-w}.
160 \b Fix bug where \c{ALIGN} would issue a full alignment datum instead of
161   zero bytes.
163 \b Fix offsets in list files.
165 \b Fix \c{%include} inside multi-line macros or loops.
167 \b Fix error where NASM would generate a spurious warning on valid
168   optimizations of immediate values.
170 \b Fix arguments to a number of the \c{CVT} SSE instructions.
172 \b Fix RIP-relative offsets when the instruction carries an immediate.
174 \b Massive overhaul of the ELF64 backend for spec compliance.
176 \b Fix the Geode \c{PFRCPV} and \c{PFRSQRTV} instruction.
178 \b Fix the SSE 4.2 \c{CRC32} instruction.
181 \S{cl-2.04} Version 2.04
183 \b Sanitize macro handing in the \c{%error} directive.
185 \b New \c{%warning} directive to issue user-controlled warnings.
187 \b \c{%error} directives are now deferred to the final assembly phase.
189 \b New \c{%fatal} directive to immediately terminate assembly.
191 \b New \c{%strcat} directive to join quoted strings together.
193 \b New \c{%use} macro directive to support standard macro directives.  See
194   \k{use}.
196 \b Excess default parameters to \c{%macro} now issues a warning by default.
197   See \k{mlmacro}.
199 \b Fix \c{%ifn} and \c{%elifn}.
201 \b Fix nested \c{%else} clauses.
203 \b Correct the handling of nested \c{%rep}s.
205 \b New \c{%unmacro} directive to undeclare a multi-line macro.
206   See \k{unmacro}.
208 \b Builtin macro \c{__PASS__} which expands to the current assembly pass.
209   See \k{pass_macro}.
211 \b \c{__utf16__} and \c{__utf32__} operators to generate UTF-16 and UTF-32
212   strings.  See \k{unicode}.
214 \b Fix bug in case-insensitive matching when compiled on platforms that
215   don't use the \c{configure} script.  Of the official release binaries,
216   that only affected the OS/2 binary.
218 \b Support for x87 packed BCD constants.  See \k{bcdconst}.
220 \b Correct the \c{LTR} and \c{SLDT} instructions in 64-bit mode.
222 \b Fix unnecessary REX.W prefix on indirect jumps in 64-bit mode.
224 \b Add AVX versions of the AES instructions (\c{VAES}...).
226 \b Fix the 256-bit FMA instructions.
228 \b Add 256-bit AVX stores per the latest AVX spec.
230 \b VIA XCRYPT instructions can now be written either with or without
231   \c{REP}, apparently different versions of the VIA spec wrote them
232   differently.
234 \b Add missing 64-bit \c{MOVNTI} instruction.
236 \b Fix the operand size of \c{VMREAD} and \c{VMWRITE}.
238 \b Numerous bug fixes, especially to the AES, AVX and VTX instructions.
240 \b The optimizer now always runs until it converges.  It also runs even
241   when disabled, but doesn't optimize.  This allows most forward references
242   to be resolved properly.
244 \b \c{%push} no longer needs a context identifier; omitting the context
245   identifier results in an anonymous context.
248 \S{cl-2.03.01} Version 2.03.01
250 \b Fix buffer overflow in the listing module.
252 \b Fix the handling of hexadecimal escape codes in `...` strings.
254 \b The Postscript/PDF documentation has been reformatted.
256 \b The \c{-F} option now implies \c{-g}.
259 \S{cl-2.03} Version 2.03
261 \b Add support for Intel AVX, CLMUL and FMA instructions,
262 including YMM registers.
264 \b \c{dy}, \c{resy} and \c{yword} for 32-byte operands.
266 \b Fix some SSE5 instructions.
268 \b Intel \c{INVEPT}, \c{INVVPID} and \c{MOVBE} instructions.
270 \b Fix checking for critical expressions when the optimizer is enabled.
272 \b Support the DWARF debugging format for ELF targets.
274 \b Fix optimizations of signed bytes.
276 \b Fix operation on bigendian machines.
278 \b Fix buffer overflow in the preprocessor.
280 \b \c{SAFESEH} support for Win32, \c{IMAGEREL} for Win64 (SEH).
282 \b \c{%?} and \c{%??} to refer to the name of a macro itself.  In particular,
283 \c{%idefine keyword $%?} can be used to make a keyword "disappear".
285 \b New options for dependency generation: \c{-MD}, \c{-MF},
286 \c{-MP}, \c{-MT}, \c{-MQ}.
288 \b New preprocessor directives \c{%pathsearch} and \c{%depend}; INCBIN
289 reimplemented as a macro.
291 \b \c{%include} now resolves macros in a sane manner.
293 \b \c{%substr} can now be used to get other than one-character substrings.
295 \b New type of character/string constants, using backquotes (\c{`...`}),
296 which support C-style escape sequences.
298 \b \c{%defstr} and \c{%idefstr} to stringize macro definitions before
299 creation.
301 \b Fix forward references used in \c{EQU} statements.
304 \S{cl-2.02} Version 2.02
306 \b Additional fixes for MMX operands with explicit \c{qword}, as well as
307   (hopefully) SSE operands with \c{oword}.
309 \b Fix handling of truncated strings with \c{DO}.
311 \b Fix segfaults due to memory overwrites when floating-point constants
312   were used.
314 \b Fix segfaults due to missing include files.
316 \b Fix OpenWatcom Makefiles for DOS and OS/2.
318 \b Add autogenerated instruction list back into the documentation.
320 \b ELF: Fix segfault when generating stabs, and no symbols have been
321   defined.
323 \b ELF: Experimental support for DWARF debugging information.
325 \b New compile date and time standard macros.
327 \b \c{%ifnum} now returns true for negative numbers.
329 \b New \c{%iftoken} test for a single token.
331 \b New \c{%ifempty} test for empty expansion.
333 \b Add support for the \c{XSAVE} instruction group.
335 \b Makefile for Netware/gcc.
337 \b Fix issue with some warnings getting emitted way too many times.
339 \b Autogenerated instruction list added to the documentation.
342 \S{cl-2.01} Version 2.01
344 \b Fix the handling of MMX registers with explicit \c{qword} tags on
345   memory (broken in 2.00 due to 64-bit changes.)
347 \b Fix the PREFETCH instructions.
349 \b Fix the documentation.
351 \b Fix debugging info when using \c{-f elf}
352 (backwards compatibility alias for \c{-f elf32}).
354 \b Man pages for rdoff tools (from the Debian project.)
356 \b ELF: handle large numbers of sections.
358 \b Fix corrupt output when the optimizer runs out of passes.
361 \S{cl-2.00} Version 2.00
363 \b Added c99 data-type compliance.
365 \b Added general x86-64 support.
367 \b Added win64 (x86-64 COFF) output format.
369 \b Added \c{__BITS__} standard macro.
371 \b Renamed the \c{elf} output format to \c{elf32} for clarity.
373 \b Added \c{elf64} and \c{macho} (MacOS X) output formats.
375 \b Added Numeric constants in \c{dq} directive.
377 \b Added \c{oword}, \c{do} and \c{reso} pseudo operands.
379 \b Allow underscores in numbers.
381 \b Added 8-, 16- and 128-bit floating-point formats.
383 \b Added binary, octal and hexadecimal floating-point.
385 \b Correct the generation of floating-point constants.
387 \b Added floating-point option control.
389 \b Added Infinity and NaN floating point support.
391 \b Added ELF Symbol Visibility support.
393 \b Added setting OSABI value in ELF header directive.
395 \b Added Generate Makefile Dependencies option.
397 \b Added Unlimited Optimization Passes option.
399 \b Added \c{%IFN} and \c{%ELIFN} support.
401 \b Added Logical Negation Operator.
403 \b Enhanced Stack Relative Preprocessor Directives.
405 \b Enhanced ELF Debug Formats.
407 \b Enhanced Send Errors to a File option.
409 \b Added SSSE3, SSE4.1, SSE4.2, SSE5 support.
411 \b Added a large number of additional instructions.
413 \b Significant performance improvements.
415 \b \c{-w+warning} and \c{-w-warning} can now be written as -Wwarning and
416  -Wno-warning, respectively.  See \k{opt-w}.
418 \b Add \c{-w+error} to treat warnings as errors.  See \k{opt-w}.
420 \b Add \c{-w+all} and \c{-w-all} to enable or disable all suppressible
421  warnings.  See \k{opt-w}.
424 \H{cl-0.98.xx} NASM 0.98 Series
426 The 0.98 series was the production versions of NASM from 1999 to 2007.
429 \S{cl-0.98.39} Version 0.98.39
431 \b fix buffer overflow
433 \b fix outas86's \c{.bss} handling
435 \b "make spotless" no longer deletes config.h.in.
437 \b \c{%(el)if(n)idn} insensitivity to string quotes difference (#809300).
439 \b (nasm.c)\c{__OUTPUT_FORMAT__} changed to string value instead of symbol.
441 \S{cl-0.98.38} Version 0.98.38
444 \b Add Makefile for 16-bit DOS binaries under OpenWatcom, and modify
445   \c{mkdep.pl} to be able to generate completely pathless dependencies, as
446   required by OpenWatcom wmake (it supports path searches, but not
447   explicit paths.)
449 \b Fix the \c{STR} instruction.
451 \b Fix the ELF output format, which was broken under certain
452   circumstances due to the addition of stabs support.
454 \b Quick-fix Borland format debug-info for \c{-f obj}
456 \b Fix for \c{%rep} with no arguments (#560568)
458 \b Fix concatenation of preprocessor function call (#794686)
460 \b Fix long label causes coredump (#677841)
462 \b Use autoheader as well as autoconf to keep configure from generating
463   ridiculously long command lines.
465 \b Make sure that all of the formats which support debugging output
466   actually will suppress debugging output when \c{-g} not specified.
468 \S{cl-0.98.37} Version 0.98.37
471 \b Paths given in \c{-I} switch searched for \c{incbin}-ed as
472   well as \c{%include}-ed files.
474 \b Added stabs debugging for the ELF output format, patch from
475   Martin Wawro.
477 \b Fix \c{output/outbin.c} to allow origin > 80000000h.
479 \b Make \c{-U} switch work.
481 \b Fix the use of relative offsets with explicit prefixes, e.g.
482 \c{a32 loop foo}.
484 \b Remove \c{backslash()}.
486 \b Fix the \c{SMSW} and \c{SLDT} instructions.
488 \b \c{-O2} and \c{-O3} are no longer aliases for \c{-O10} and \c{-O15}.
489 If you mean the latter, please say so! :)
491 \S{cl-0.98.36} Version 0.98.36
494 \b Update rdoff - librarian/archiver - common rec - docs!
496 \b Fix signed/unsigned problems.
498 \b Fix \c{JMP FAR label} and \c{CALL FAR label}.
500 \b Add new multisection support - map files - fix align bug
502 \b Fix sysexit, movhps/movlps reg,reg bugs in insns.dat
504 \b \c{Q} or \c{O} suffixes indicate octal
506 \b Support Prescott new instructions (PNI).
508 \b Cyrix \c{XSTORE} instruction.
511 \S{cl-0.98.35} Version 0.98.35
513 \b Fix build failure on 16-bit DOS (Makefile.bc3 workaround for compiler bug.)
515 \b Fix dependencies and compiler warnings.
517 \b Add "const" in a number of places.
519 \b Add -X option to specify error reporting format (use -Xvc to
520   integrate with Microsoft Visual Studio.)
522 \b Minor changes for code legibility.
524 \b Drop use of tmpnam() in rdoff (security fix.)
527 \S{cl-0.98.34} Version 0.98.34
529 \b Correct additional address-size vs. operand-size confusions.
531 \b Generate dependencies for all Makefiles automatically.
533 \b Add support for unimplemented (but theoretically available)
534   registers such as tr0 and cr5.  Segment registers 6 and 7 are called
535   segr6 and segr7 for the operations which they can be represented.
537 \b Correct some disassembler bugs related to redundant address-size prefixes.
538   Some work still remains in this area.
540 \b Correctly generate an error for things like "SEG eax".
542 \b Add the JMPE instruction, enabled by "CPU IA64".
544 \b Correct compilation on newer gcc/glibc platforms.
546 \b Issue an error on things like "jmp far eax".
549 \S{cl-0.98.33} Version 0.98.33
551 \b New __NASM_PATCHLEVEL__ and __NASM_VERSION_ID__ standard macros to
552   round out the version-query macros.  version.pl now understands
553   X.YYplWW or X.YY.ZZplWW as a version number, equivalent to
554   X.YY.ZZ.WW (or X.YY.0.WW, as appropriate).
556 \b New keyword "strict" to disable the optimization of specific
557   operands.
559 \b Fix the handing of size overrides with JMP instructions
560   (instructions such as "jmp dword foo".)
562 \b Fix the handling of "ABSOLUTE label", where "label" points into a
563   relocatable segment.
565 \b Fix OBJ output format with lots of externs.
567 \b More documentation updates.
569 \b Add -Ov option to get verbose information about optimizations.
571 \b Undo a braindead change which broke \c{%elif} directives.
573 \b Makefile updates.
576 \S{cl-0.98.32} Version 0.98.32
578 \b Fix NASM crashing when \c{%macro} directives were left unterminated.
580 \b Lots of documentation updates.
582 \b Complete rewrite of the PostScript/PDF documentation generator.
584 \b The MS Visual C++ Makefile was updated and corrected.
586 \b Recognize .rodata as a standard section name in ELF.
588 \b Fix some obsolete Perl4-isms in Perl scripts.
590 \b Fix configure.in to work with autoconf 2.5x.
592 \b Fix a couple of "make cleaner" misses.
594 \b Make the normal "./configure && make" work with Cygwin.
597 \S{cl-0.98.31} Version 0.98.31
599 \b Correctly build in a separate object directory again.
601 \b Derive all references to the version number from the version file.
603 \b New standard macros __NASM_SUBMINOR__ and __NASM_VER__ macros.
605 \b Lots of Makefile updates and bug fixes.
607 \b New \c{%ifmacro} directive to test for multiline macros.
609 \b Documentation updates.
611 \b Fixes for 16-bit OBJ format output.
613 \b Changed the NASM environment variable to NASMENV.
616 \S{cl-0.98.30} Version 0.98.30
618 \b Changed doc files a lot: completely removed old READMExx and
619   Wishlist files, incorporating all information in CHANGES and TODO.
621 \b I waited a long time to rename zoutieee.c to (original) outieee.c
623 \b moved all output modules to output/ subdirectory.
625 \b Added 'make strip' target to strip debug info from nasm & ndisasm.
627 \b Added INSTALL file with installation instructions.
629 \b Added -v option description to nasm man.
631 \b Added dist makefile target to produce source distributions.
633 \b 16-bit support for ELF output format (GNU extension, but useful.)
636 \S{cl-0.98.28} Version 0.98.28
638 \b Fastcooked this for Debian's Woody release:
639 Frank applied the INCBIN bug patch to 0.98.25alt and called
640 it 0.98.28 to not confuse poor little apt-get.
643 \S{cl-0.98.26} Version 0.98.26
645 \b Reorganised files even better from 0.98.25alt
648 \S{cl-0.98.25alt} Version 0.98.25alt
650 \b Prettified the source tree. Moved files to more reasonable places.
652 \b Added findleak.pl script to misc/ directory.
654 \b Attempted to fix doc.
657 \S{cl-0.98.25} Version 0.98.25
659 \b Line continuation character \c{\\}.
661 \b Docs inadvertantly reverted - "dos packaging".
664 \S{cl-0.98.24p1} Version 0.98.24p1
666 \b FIXME: Someone, document this please.
669 \S{cl-0.98.24} Version 0.98.24
671 \b Documentation - Ndisasm doc added to Nasm.doc.
674 \S{cl-0.98.23} Version 0.98.23
676 \b Attempted to remove rdoff version1
678 \b Lino Mastrodomenico's patches to preproc.c (%$$ bug?).
681 \S{cl-0.98.22} Version 0.98.22
683 \b Update rdoff2 - attempt to remove v1.
686 \S{cl-0.98.21} Version 0.98.21
688 \b Optimization fixes.
691 \S{cl-0.98.20} Version 0.98.20
693 \b Optimization fixes.
696 \S{cl-0.98.19} Version 0.98.19
698 \b H. J. Lu's patch back out.
701 \S{cl-0.98.18} Version 0.98.18
703 \b Added ".rdata" to "-f win32".
706 \S{cl-0.98.17} Version 0.98.17
708 \b H. J. Lu's "bogus elf" patch. (Red Hat problem?)
711 \S{cl-0.98.16} Version 0.98.16
713 \b Fix whitespace before "[section ..." bug.
716 \S{cl-0.98.15} Version 0.98.15
718 \b Rdoff changes (?).
720 \b Fix fixes to memory leaks.
723 \S{cl-0.98.14} Version 0.98.14
725 \b Fix memory leaks.
728 \S{cl-0.98.13} Version 0.98.13
730 \b There was no 0.98.13
733 \S{cl-0.98.12} Version 0.98.12
735 \b Update optimization (new function of "-O1")
737 \b Changes to test/bintest.asm (?).
740 \S{cl-0.98.11} Version 0.98.11
742 \b Optimization changes.
744 \b Ndisasm fixed.
747 \S{cl-0.98.10} Version 0.98.10
749 \b There was no 0.98.10
752 \S{cl-0.98.09} Version 0.98.09
754 \b Add multiple sections support to "-f bin".
756 \b Changed GLOBAL_TEMP_BASE in outelf.c from 6 to 15.
758 \b Add "-v" as an alias to the "-r" switch.
760 \b Remove "#ifdef" from Tasm compatibility options.
762 \b Remove redundant size-overrides on "mov ds, ex", etc.
764 \b Fixes to SSE2, other insns.dat (?).
766 \b Enable uppercase "I" and "P" switches.
768 \b Case insinsitive "seg" and "wrt".
770 \b Update install.sh (?).
772 \b Allocate tokens in blocks.
774 \b Improve "invalid effective address" messages.
777 \S{cl-0.98.08} Version 0.98.08
779 \b Add "\c{%strlen}" and "\c{%substr}" macro operators
781 \b Fixed broken c16.mac.
783 \b Unterminated string error reported.
785 \b Fixed bugs as per 0.98bf
788 \S{cl-0.98.09b with John Coffman patches released 28-Oct-2001} Version 0.98.09b with John Coffman patches released 28-Oct-2001
790 Changes from 0.98.07 release to 98.09b as of 28-Oct-2001
792 \b More closely compatible with 0.98 when -O0 is implied
793 or specified.  Not strictly identical, since backward 
794 branches in range of short offsets are recognized, and signed
795 byte values with no explicit size specification will be
796 assembled as a single byte.
798 \b More forgiving with the PUSH instruction.  0.98 requires
799 a size to be specified always.  0.98.09b will imply the size
800 from the current BITS setting (16 or 32).
802 \b Changed definition of the optimization flag:
804         -O0     strict two-pass assembly, JMP and Jcc are
805                 handled more like 0.98, except that back-
806                 ward JMPs are short, if possible.
808         -O1     strict two-pass assembly, but forward
809                 branches are assembled with code guaranteed
810                 to reach; may produce larger code than
811                 -O0, but will produce successful assembly
812                 more often if branch offset sizes are not
813                 specified.
815         -O2     multi-pass optimization, minimize branch
816                 offsets; also will minimize signed immed-
817                 iate bytes, overriding size specification.
819         -O3     like -O2, but more passes taken, if needed
822 \S{cl-0.98.07 released 01/28/01} Version 0.98.07 released 01/28/01
824 \b       Added Stepane Denis' SSE2 instructions to a *working*
825         version of the code - some earlier versions were based on
826         broken code - sorry 'bout that. version "0.98.07"
829 01/28/01
832 \b       Cosmetic modifications to nasm.c, nasm.h,
833         AUTHORS, MODIFIED
836 \S{cl-0.98.06f released 01/18/01} Version 0.98.06f released 01/18/01
839 \b       - Add "metalbrain"s jecxz bug fix in insns.dat
840         - alter nasmdoc.src to match - version "0.98.06f"
843 \S{cl-0.98.06e released 01/09/01} Version 0.98.06e released 01/09/01
846 \b       Removed the "outforms.h" file - it appears to be
847         someone's old backup of "outform.h". version "0.98.06e" 
849 01/09/01
851 \b fbk - finally added the fix for the "multiple %includes bug",
852         known since 7/27/99 - reported originally (?) and sent to
853         us by Austin Lunnen - he reports that John Fine had a fix
854         within the day. Here it is...
856 \b Nelson Rush resigns from the group. Big thanks to Nelson for
857   his leadership and enthusiasm in getting these changes
858   incorporated into Nasm!
860 \b fbk - [list +], [list -] directives - ineptly implemented, should
861         be re-written or removed, perhaps.
863 \b Brian Raiter / fbk - "elfso bug" fix - applied to aoutb format
864                        as well - testing might be desirable...
866 08/07/00
868 \b James Seter - -postfix, -prefix command line switches.
870 \b Yuri Zaporogets - rdoff utility changes.
873 \S{cl-0.98p1} Version 0.98p1
875 \b GAS-like palign (Panos Minos)
877 \b FIXME: Someone, fill this in with details
880 \S{cl-0.98bf (bug-fixed)} Version 0.98bf (bug-fixed)
882 \b Fixed - elf and aoutb bug - shared libraries
883         - multiple "%include" bug in "-f obj"   
884         - jcxz, jecxz bug
885         - unrecognized option bug in ndisasm 
887 \S{cl-0.98.03 with John Coffman's changes released 27-Jul-2000} Version 0.98.03 with John Coffman's changes released 27-Jul-2000
889 \b Added signed byte optimizations for the 0x81/0x83 class
890 of instructions: ADC, ADD, AND, CMP, OR, SBB, SUB, XOR:
891 when used as 'ADD reg16,imm' or 'ADD reg32,imm.'  Also
892 optimization of signed byte form of 'PUSH imm' and 'IMUL
893 reg,imm'/'IMUL reg,reg,imm.'  No size specification is needed.
895 \b Added multi-pass JMP and Jcc offset optimization.  Offsets
896 on forward references will preferentially use the short form,
897 without the need to code a specific size (short or near) for
898 the branch.  Added instructions for 'Jcc label' to use the
899 form 'Jnotcc $+3/JMP label', in cases where a short offset
900 is out of bounds.  If compiling for a 386 or higher CPU, then
901 the 386 form of Jcc will be used instead.
903 This feature is controlled by a new command-line switch: "O",
904 (upper case letter O).  "-O0" reverts the assembler to no
905 extra optimization passes, "-O1" allows up to 5 extra passes,
906 and "-O2"(default), allows up to 10 extra optimization passes.
908 \b Added a new directive:  'cpu XXX', where XXX is any of: 
909 8086, 186, 286, 386, 486, 586, pentium, 686, PPro, P2, P3 or
910 Katmai.  All are case insensitive.  All instructions will
911 be selected only if they apply to the selected cpu or lower.
912 Corrected a couple of bugs in cpu-dependence in 'insns.dat'.
914 \b Added to 'standard.mac', the "use16" and "use32" forms of
915 the "bits 16/32" directive. This is nothing new, just conforms
916 to a lot of other assemblers. (minor)
918 \b Changed label allocation from 320/32 (10000 labels @ 200K+) 
919 to 32/37 (1000 labels); makes running under DOS much easier.
920 Since additional label space is allocated dynamically, this
921 should have no effect on large programs with lots of labels.
922 The 37 is a prime, believed to be better for hashing. (minor)
925 \S{cl-0.98.03} Version 0.98.03
927 "Integrated patchfile 0.98-0.98.01.  I call this version 0.98.03 for
928 historical reasons: 0.98.02 was trashed." --John Coffman
929 <johninsd@san.rr.com>, 27-Jul-2000
931 \b Kendall Bennett's SciTech MGL changes
933 \b Note that you must define "TASM_COMPAT" at compile-time
934 to get the Tasm Ideal Mode compatibility.
936 \b All changes can be compiled in and out using the TASM_COMPAT macros,
937 and when compiled without TASM_COMPAT defined we get the exact same
938 binary as the unmodified 0.98 sources.
940 \b standard.mac, macros.c: Added macros to ignore TASM directives before
941 first include
943 \b nasm.h: Added extern declaration for tasm_compatible_mode
945 \b nasm.c: Added global variable tasm_compatible_mode
947 \b Added command line switch for TASM compatible mode (-t)
949 \b Changed version command line to reflect when compiled with TASM additions
951 \b Added response file processing to allow all arguments on a single
952 line (response file is @resp rather than -@resp for NASM format).
954 \b labels.c: Changes islocal() macro to support TASM style @@local labels.
956 \b Added islocalchar() macro to support TASM style @@local labels.
958 \b parser.c: Added support for TASM style memory references (ie: mov
959 [DWORD eax],10 rather than the NASM style mov DWORD [eax],10).
961 \b preproc.c: Added new directives, \c{%arg}, \c{%local}, \c{%stacksize} to directives
962 table
964 \b Added support for TASM style directives without a leading % symbol.
966 \b Integrated a block of changes from Andrew Zabolotny <bit@eltech.ru>:
968 \b A new keyword \c{%xdefine} and its case-insensitive counterpart \c{%ixdefine}.
969 They work almost the same way as \c{%define} and \c{%idefine} but expand
970 the definition immediately, not on the invocation. Something like a cross
971 between \c{%define} and \c{%assign}. The "x" suffix stands for "eXpand", so
972 "xdefine" can be deciphered as "expand-and-define". Thus you can do
973 things like this:
975 \c      %assign ofs     0
977 \c      %macro  arg     1
978 \c              %xdefine %1 dword [esp+ofs]
979 \c              %assign ofs ofs+4
980 \c      %endmacro
982 \b Changed the place where the expansion of %$name macros are expanded.
983 Now they are converted into ..@ctxnum.name form when detokenizing, so
984 there are no quirks as before when using %$name arguments to macros,
985 in macros etc. For example:
987 \c      %macro  abc     1
988 \c              %define %1 hello
989 \c      %endm
991 \c      abc     %$here
992 \c      %$here
994     Now last line will be expanded into "hello" as expected. This also allows
995     for lots of goodies, a good example are extended "proc" macros included
996     in this archive.
998 \b Added a check for "cstk" in smacro_defined() before calling get_ctx() -
999     this allows for things like:
1001 \c      %ifdef %$abc
1002 \c      %endif
1004     to work without warnings even in no context.
1006 \b Added a check for "cstk" in %if*ctx and %elif*ctx directives -
1007     this allows to use \c{%ifctx} without excessive warnings. If there is
1008     no active context, \c{%ifctx} goes through "false" branch.
1010 \b Removed "user error: " prefix with \c{%error} directive: it just clobbers the
1011     output and has absolutely no functionality. Besides, this allows to write
1012     macros that does not differ from built-in functions in any way.
1014 \b Added expansion of string that is output by \c{%error} directive. Now you
1015     can do things like:
1017 \c      %define hello(x) Hello, x!
1019 \c      %define %$name andy
1020 \c      %error "hello(%$name)"
1022     Same happened with \c{%include} directive.
1024 \b Now all directives that expect an identifier will try to expand and
1025     concatenate everything without whitespaces in between before usage.
1026     For example, with "unfixed" nasm the commands
1028 \c      %define %$abc hello
1029 \c      %define __%$abc goodbye
1030 \c      __%$abc
1032     would produce "incorrect" output: last line will expand to
1034 \c      hello goodbyehello
1036     Not quite what you expected, eh? :-) The answer is that preprocessor
1037     treats the \c{%define} construct as if it would be
1039 \c      %define __ %$abc goodbye
1041     (note the white space between __ and %$abc). After my "fix" it
1042     will "correctly" expand into
1044 \c      goodbye
1046     as expected. Note that I use quotes around words "correct", "incorrect"
1047     etc because this is rather a feature not a bug; however current behaviour
1048     is more logical (and allows more advanced macro usage :-).
1050     Same change was applied to:
1051         \c{%push},\c{%macro},\c{%imacro},\c{%define},\c{%idefine},\c{%xdefine},\c{%ixdefine},
1052         \c{%assign},\c{%iassign},\c{%undef}
1054 \b A new directive [WARNING {+|-}warning-id] have been added. It works only
1055     if the assembly phase is enabled (i.e. it doesn't work with nasm -e).
1057 \b A new warning type: macro-selfref. By default this warning is disabled;
1058     when enabled NASM warns when a macro self-references itself; for example
1059     the following source:
1061 \c        [WARNING macro-selfref]
1063 \c        %macro          push    1-*
1064 \c                %rep    %0
1065 \c                        push    %1
1066 \c                        %rotate 1
1067 \c                %endrep
1068 \c        %endmacro
1070 \c                        push    eax,ebx,ecx
1072     will produce a warning, but if we remove the first line we won't see it
1073     anymore (which is The Right Thing To Do {tm} IMHO since C preprocessor
1074     eats such constructs without warnings at all).
1076 \b Added a "error" routine to preprocessor which always will set ERR_PASS1
1077     bit in severity_code. This removes annoying repeated errors on first
1078     and second passes from preprocessor.
1080 \b Added the %+ operator in single-line macros for concatenating two
1081     identifiers. Usage example:
1083 \c        %define _myfunc _otherfunc
1084 \c        %define cextern(x) _ %+ x
1085 \c        cextern (myfunc)
1087     After first expansion, third line will become "_myfunc". After this
1088     expansion is performed again so it becomes "_otherunc".
1090 \b Now if preprocessor is in a non-emitting state, no warning or error
1091     will be emitted. Example:
1093 \c        %if 1
1094 \c                mov     eax,ebx
1095 \c        %else
1096 \c                put anything you want between these two brackets,
1097 \c                even macro-parameter references %1 or local
1098 \c                labels %$zz or macro-local labels %%zz - no
1099 \c                warning will be emitted.
1100 \c        %endif
1102 \b Context-local variables on expansion as a last resort are looked up
1103     in outer contexts. For example, the following piece:
1105 \c        %push   outer
1106 \c        %define %$a [esp]
1108 \c                %push   inner
1109 \c                %$a
1110 \c                %pop
1111 \c        %pop
1113     will expand correctly the fourth line to [esp]; if we'll define another
1114     %$a inside the "inner" context, it will take precedence over outer
1115     definition. However, this modification has been applied only to
1116     expand_smacro and not to smacro_define: as a consequence expansion
1117     looks in outer contexts, but \c{%ifdef} won't look in outer contexts.
1119     This behaviour is needed because we don't want nested contexts to
1120     act on already defined local macros. Example:
1122 \c        %define %$arg1  [esp+4]
1123 \c        test    eax,eax
1124 \c        if      nz
1125 \c                mov     eax,%$arg1
1126 \c        endif
1128     In this example the "if" mmacro enters into the "if" context, so %$arg1
1129     is not valid anymore inside "if". Of course it could be worked around
1130     by using explicitely %$$arg1 but this is ugly IMHO.
1132 \b Fixed memory leak in \c{%undef}. The origline wasn't freed before
1133     exiting on success.
1135 \b Fixed trap in preprocessor when line expanded to empty set of tokens.
1136     This happens, for example, in the following case:
1138 \c        #define SOMETHING
1139 \c        SOMETHING
1142 \S{cl-0.98} Version 0.98
1144 All changes since NASM 0.98p3 have been produced by H. Peter Anvin <hpa@zytor.com>.
1146 \b The documentation comment delimiter is \# not #.
1148 \b Allow EQU definitions to refer to external labels; reported by
1149   Pedro Gimeno.
1151 \b Re-enable support for RDOFF v1; reported by Pedro Gimeno.
1153 \b Updated License file per OK from Simon and Julian.
1156 \S{cl-0.98p9} Version 0.98p9
1158 \b Update documentation (although the instruction set reference will
1159   have to wait; I don't want to hold up the 0.98 release for it.)
1161 \b Verified that the NASM implementation of the PEXTRW and PMOVMSKB
1162   instructions is correct.  The encoding differs from what the Intel
1163   manuals document, but the Pentium III behaviour matches NASM, not
1164   the Intel manuals.
1166 \b Fix handling of implicit sizes in PSHUFW and PINSRW, reported by
1167   Stefan Hoffmeister.
1169 \b Resurrect the -s option, which was removed when changing the
1170   diagnostic output to stdout.
1173 \S{cl-0.98p8} Version 0.98p8
1175 \b Fix for "DB" when NASM is running on a bigendian machine.
1177 \b Invoke insns.pl once for each output script, making Makefile.in
1178   legal for "make -j".
1180 \b Improve the Unix configure-based makefiles to make package
1181   creation easier.
1183 \b Included an RPM .spec file for building RPM (RedHat Package Manager)
1184   packages on Linux or Unix systems.
1186 \b Fix Makefile dependency problems.
1188 \b Change src/rdsrc.pl to include sectioning information in info
1189   output; required for install-info to work.
1191 \b Updated the RDOFF distribution to version 2 from Jules; minor
1192   massaging to make it compile in my environment.
1194 \b Split doc files that can be built by anyone with a Perl interpreter off
1195   into a separate archive.
1197 \b "Dress rehearsal" release!
1200 \S{cl-0.98p7} Version 0.98p7
1202 \b Fixed opcodes with a third byte-sized immediate argument to not
1203   complain if given "byte" on the immediate.
1205 \b Allow \c{%undef} to remove single-line macros with arguments.  This
1206   matches the behaviour of #undef in the C preprocessor.
1208 \b Allow -d, -u, -i and -p to be specified as -D, -U, -I and -P for
1209   compatibility with most C compilers and preprocessors.  This allows
1210   Makefile options to be shared between cc and nasm, for example.
1212 \b Minor cleanups.
1214 \b Went through the list of Katmai instructions and hopefully fixed the
1215   (rather few) mistakes in it.
1217 \b (Hopefully) fixed a number of disassembler bugs related to ambiguous
1218   instructions (disambiguated by -p) and SSE instructions with REP.
1220 \b Fix for bug reported by Mark Junger: "call dword 0x12345678" should
1221   work and may add an OSP (affected CALL, JMP, Jcc).
1223 \b Fix for environments when "stderr" isn't a compile-time constant.
1226 \S{cl-0.98p6} Version 0.98p6
1229 \b Took officially over coordination of the 0.98 release; so drop
1230   the p3.x notation. Skipped p4 and p5 to avoid confusion with John
1231   Fine's J4 and J5 releases.
1233 \b Update the documentation; however, it still doesn't include
1234   documentation for the various new instructions.  I somehow wonder if
1235   it makes sense to have an instruction set reference in the assembler
1236   manual when Intel et al have PDF versions of their manuals online.
1238 \b Recognize "idt" or "centaur" for the -p option to ndisasm.
1240 \b Changed error messages back to stderr where they belong, but add an
1241   -E option to redirect them elsewhere (the DOS shell cannot redirect
1242   stderr.)
1244 \b -M option to generate Makefile dependencies (based on code from Alex
1245   Verstak.)
1247 \b \c{%undef} preprocessor directive, and -u option, that undefines a
1248   single-line macro.
1250 \b OS/2 Makefile (Mkfiles/Makefile.os2) for Borland under OS/2; from
1251   Chuck Crayne.
1253 \b Various minor bugfixes (reported by):
1254   - Dangling \c{%s} in preproc.c (Martin Junker)
1256 \b THERE ARE KNOWN BUGS IN SSE AND THE OTHER KATMAI INSTRUCTIONS.  I am
1257   on a trip and didn't bring the Katmai instruction reference, so I
1258   can't work on them right now.
1260 \b Updated the License file per agreement with Simon and Jules to
1261   include a GPL distribution clause.
1264 \S{cl-0.98p3.7} Version 0.98p3.7
1266 \b (Hopefully) fixed the canned Makefiles to include the outrdf2 and
1267   zoutieee modules.
1269 \b Renamed changes.asm to changed.asm.
1272 \S{cl-0.98p3.6} Version 0.98p3.6
1274 \b Fixed a bunch of instructions that were added in 0.98p3.5 which had
1275   memory operands, and the address-size prefix was missing from the
1276   instruction pattern.
1279 \S{cl-0.98p3.5} Version 0.98p3.5
1281 \b Merged in changes from John S. Fine's 0.98-J5 release.  John's based
1282   0.98-J5 on my 0.98p3.3 release; this merges the changes.
1284 \b Expanded the instructions flag field to a long so we can fit more
1285   flags; mark SSE (KNI) and AMD or Katmai-specific instructions as
1286   such.
1288 \b Fix the "PRIV" flag on a bunch of instructions, and create new
1289   "PROT" flag for protected-mode-only instructions (orthogonal to if
1290   the instruction is privileged!) and new "SMM" flag for SMM-only
1291   instructions.
1293 \b Added AMD-only SYSCALL and SYSRET instructions.
1295 \b Make SSE actually work, and add new Katmai MMX instructions.
1297 \b Added a -p (preferred vendor) option to ndisasm so that it can
1298   distinguish e.g. Cyrix opcodes also used in SSE.  For example:
1300 \c      ndisasm -p cyrix aliased.bin
1301 \c      00000000  670F514310        paddsiw mm0,[ebx+0x10]
1302 \c      00000005  670F514320        paddsiw mm0,[ebx+0x20]
1303 \c      ndisasm -p intel aliased.bin
1304 \c      00000000  670F514310        sqrtps xmm0,[ebx+0x10]
1305 \c      00000005  670F514320        sqrtps xmm0,[ebx+0x20]
1307 \b Added a bunch of Cyrix-specific instructions.
1310 \S{cl-0.98p3.4} Version 0.98p3.4
1312 \b Made at least an attempt to modify all the additional Makefiles (in
1313   the Mkfiles directory).  I can't test it, but this was the best I
1314   could do.
1316 \b DOS DJGPP+"Opus Make" Makefile from John S. Fine.
1318 \b changes.asm changes from John S. Fine.
1321 \S{cl-0.98p3.3} Version 0.98p3.3
1323 \b Patch from Conan Brink to allow nesting of \c{%rep} directives.
1325 \b If we're going to allow INT01 as an alias for INT1/ICEBP (one of
1326   Jules 0.98p3 changes), then we should allow INT03 as an alias for INT3
1327   as well.
1329 \b Updated changes.asm to include the latest changes.
1331 \b Tried to clean up the <CR>s that had snuck in from a DOS/Windows
1332   environment into my Unix environment, and try to make sure than
1333   DOS/Windows users get them back.
1335 \b We would silently generate broken tools if insns.dat wasn't sorted
1336   properly.  Change insns.pl so that the order doesn't matter.
1338 \b Fix bug in insns.pl (introduced by me) which would cause conditional
1339   instructions to have an extra "cc" in disassembly, e.g. "jnz"
1340   disassembled as "jccnz".
1343 \S{cl-0.98p3.2} Version 0.98p3.2
1345 \b Merged in John S. Fine's changes from his 0.98-J4 prerelease; see
1346   http://www.csoft.net/cz/johnfine/
1348 \b Changed previous "spotless" Makefile target (appropriate for distribution)
1349   to "distclean", and added "cleaner" target which is same as "clean"
1350   except deletes files generated by Perl scripts; "spotless" is union.
1352 \b Removed BASIC programs from distribution.  Get a Perl interpreter
1353   instead (see below.)
1355 \b Calling this "pre-release 3.2" rather than "p3-hpa2" because of
1356   John's contributions.
1358 \b Actually link in the IEEE output format (zoutieee.c); fix a bunch of
1359   compiler warnings in that file.  Note I don't know what IEEE output
1360   is supposed to look like, so these changes were made "blind".
1363 \S{cl-0.98p3-hpa} Version 0.98p3-hpa
1365 \b Merged nasm098p3.zip with nasm-0.97.tar.gz to create a fully
1366   buildable version for Unix systems (Makefile.in updates, etc.)
1368 \b Changed insns.pl to create the instruction tables in nasm.h and
1369   names.c, so that a new instruction can be added by adding it *only*
1370   to insns.dat.
1372 \b Added the following new instructions: SYSENTER, SYSEXIT, FXSAVE,
1373   FXRSTOR, UD1, UD2 (the latter two are two opcodes that Intel
1374   guarantee will never be used; one of them is documented as UD2 in
1375   Intel documentation, the other one just as "Undefined Opcode" --
1376   calling it UD1 seemed to make sense.)
1378 \b MAX_SYMBOL was defined to be 9, but LOADALL286 and LOADALL386 are 10
1379   characters long.  Now MAX_SYMBOL is derived from insns.dat.
1381 \b A note on the BASIC programs included: forget them.  insns.bas is
1382   already out of date.  Get yourself a Perl interpreter for your
1383   platform of choice at
1384   \W{http://www.cpan.org/ports/index.html}{http://www.cpan.org/ports/index.html}.
1387 \S{cl-0.98p3} Version 0.98 pre-release 3
1389 \b added response file support, improved command line handling, new layout
1390 help screen
1392 \b fixed limit checking bug, 'OUT byte nn, reg' bug, and a couple of rdoff
1393 related bugs, updated Wishlist; 0.98 Prerelease 3.
1396 \S{cl-0.98p2} Version 0.98 pre-release 2
1398 \b fixed bug in outcoff.c to do with truncating section names longer
1399 than 8 characters, referencing beyond end of string; 0.98 pre-release 2
1402 \S{cl-0.98p1} Version 0.98 pre-release 1
1404 \b Fixed a bug whereby STRUC didn't work at all in RDF.
1406 \b Fixed a problem with group specification in PUBDEFs in OBJ.
1408 \b Improved ease of adding new output formats. Contribution due to
1409 Fox Cutter.
1411 \b Fixed a bug in relocations in the `bin' format: was showing up when
1412 a relocatable reference crossed an 8192-byte boundary in any output
1413 section.
1415 \b Fixed a bug in local labels: local-label lookups were inconsistent
1416 between passes one and two if an EQU occurred between the definition
1417 of a global label and the subsequent use of a local label local to
1418 that global.
1420 \b Fixed a seg-fault in the preprocessor (again) which happened when
1421 you use a blank line as the first line of a multi-line macro
1422 definition and then defined a label on the same line as a call to
1423 that macro.
1425 \b Fixed a stale-pointer bug in the handling of the NASM environment
1426 variable. Thanks to Thomas McWilliams.
1428 \b ELF had a hard limit on the number of sections which caused
1429 segfaults when transgressed. Fixed.
1431 \b Added ability for ndisasm to read from stdin by using `-' as the
1432 filename.
1434 \b ndisasm wasn't outputting the TO keyword. Fixed.
1436 \b Fixed error cascade on bogus expression in \c{%if} - an error in
1437 evaluation was causing the entire \c{%if} to be discarded, thus creating
1438 trouble later when the \c{%else} or \c{%endif} was encountered.
1440 \b Forward reference tracking was instruction-granular not operand-
1441 granular, which was causing 286-specific code to be generated
1442 needlessly on code of the form `shr word [forwardref],1'. Thanks to
1443 Jim Hague for sending a patch.
1445 \b All messages now appear on stdout, as sending them to stderr serves
1446 no useful purpose other than to make redirection difficult.
1448 \b Fixed the problem with EQUs pointing to an external symbol - this
1449 now generates an error message.
1451 \b Allowed multiple size prefixes to an operand, of which only the first
1452 is taken into account.
1454 \b Incorporated John Fine's changes, including fixes of a large number
1455 of preprocessor bugs, some small problems in OBJ, and a reworking of
1456 label handling to define labels before their line is assembled, rather
1457 than after.
1459 \b Reformatted a lot of the source code to be more readable. Included
1460 'coding.txt' as a guideline for how to format code for contributors.
1462 \b Stopped nested \c{%reps} causing a panic - they now cause a slightly more
1463 friendly error message instead.
1465 \b Fixed floating point constant problems (patch by Pedro Gimeno)
1467 \b Fixed the return value of insn_size() not being checked for -1, indicating
1468 an error.
1470 \b Incorporated 3Dnow! instructions.
1472 \b Fixed the 'mov eax, eax + ebx' bug.
1474 \b Fixed the GLOBAL EQU bug in ELF. Released developers release 3.
1476 \b Incorporated John Fine's command line parsing changes
1478 \b Incorporated David Lindauer's OMF debug support
1480 \b Made changes for LCC 4.0 support (\c{__NASM_CDecl__}, removed register size
1481 specification warning when sizes agree).
1484 \H{cl-0.9x} NASM 0.9 Series
1486 Revisions before 0.98.
1489 \S{cl-0.97} Version 0.97 released December 1997
1491 \b This was entirely a bug-fix release to 0.96, which seems to have got
1492 cursed. Silly me.
1494 \b Fixed stupid mistake in OBJ which caused `MOV EAX,<constant>' to
1495 fail. Caused by an error in the `MOV EAX,<segment>' support.
1497 \b ndisasm hung at EOF when compiled with lcc on Linux because lcc on
1498 Linux somehow breaks feof(). ndisasm now does not rely on feof().
1500 \b A heading in the documentation was missing due to a markup error in
1501 the indexing. Fixed.
1503 \b Fixed failure to update all pointers on realloc() within extended-
1504 operand code in parser.c. Was causing wrong behaviour and seg faults
1505 on lines such as `dd 0.0,0.0,0.0,0.0,...'
1507 \b Fixed a subtle preprocessor bug whereby invoking one multi-line
1508 macro on the first line of the expansion of another, when the second
1509 had been invoked with a label defined before it, didn't expand the
1510 inner macro. 
1512 \b Added internal.doc back in to the distribution archives - it was
1513 missing in 0.96 *blush*
1515 \b Fixed bug causing 0.96 to be unable to assemble its own test files,
1516 specifically objtest.asm. *blush again*
1518 \b Fixed seg-faults and bogus error messages caused by mismatching
1519 \c{%rep} and \c{%endrep} within multi-line macro definitions.
1521 \b Fixed a problem with buffer overrun in OBJ, which was causing
1522 corruption at ends of long PUBDEF records.
1524 \b Separated DOS archives into main-program and documentation to reduce
1525 download size.
1528 \S{cl-0.96} Version 0.96 released November 1997
1530 \b Fixed a bug whereby, if `nasm sourcefile' would cause a filename
1531 collision warning and put output into `nasm.out', then `nasm
1532 sourcefile -o outputfile' still gave the warning even though the
1533 `-o' was honoured.
1534 Fixed name pollution under Digital UNIX: one of its header files
1535 defined R_SP, which broke the enum in nasm.h.
1537 \b Fixed minor instruction table problems: FUCOM and FUCOMP didn't have
1538 two-operand forms; NDISASM didn't recognise the longer register
1539 forms of PUSH and POP (eg FF F3 for PUSH BX); TEST mem,imm32 was
1540 flagged as undocumented; the 32-bit forms of CMOV had 16-bit operand
1541 size prefixes; `AAD imm' and `AAM imm' are no longer flagged as
1542 undocumented because the Intel Architecture reference documents
1543 them.
1545 \b Fixed a problem with the local-label mechanism, whereby strange
1546 types of symbol (EQUs, auto-defined OBJ segment base symbols)
1547 interfered with the `previous global label' value and screwed up
1548 local labels.
1550 \b Fixed a bug whereby the stub preprocessor didn't communicate with
1551 the listing file generator, so that the -a and -l options in
1552 conjunction would produce a useless listing file.
1554 \b Merged `os2' object file format back into `obj', after discovering
1555 that `obj' _also_ shouldn't have a link pass separator in a module
1556 containing a non-trivial MODEND. Flat segments are now declared
1557 using the FLAT attribute. `os2' is no longer a valid object format
1558 name: use `obj'.
1560 \b Removed the fixed-size temporary storage in the evaluator. Very very
1561 long expressions (like `mov ax,1+1+1+1+...' for two hundred 1s or
1562 so) should now no longer crash NASM.
1564 \b Fixed a bug involving segfaults on disassembly of MMX instructions,
1565 by changing the meaning of one of the operand-type flags in nasm.h.
1566 This may cause other apparently unrelated MMX problems; it needs to
1567 be tested thoroughly.
1569 \b Fixed some buffer overrun problems with large OBJ output files.
1570 Thanks to DJ Delorie for the bug report and fix.
1572 \b Made preprocess-only mode actually listen to the \c{%line} markers as it
1573 prints them, so that it can report errors more sanely.
1575 \b Re-designed the evaluator to keep more sensible track of expressions
1576 involving forward references: can now cope with previously-nightmare
1577 situations such as:
1579 \c   mov ax,foo | bar
1580 \c   foo equ 1
1581 \c   bar equ 2
1583 \b Added the ALIGN and ALIGNB standard macros.
1585 \b Added PIC support in ELF: use of WRT to obtain the four extra
1586 relocation types needed.
1588 \b Added the ability for output file formats to define their own
1589 extensions to the GLOBAL, COMMON and EXTERN directives.
1591 \b Implemented common-variable alignment, and global-symbol type and
1592 size declarations, in ELF.
1594 \b Implemented NEAR and FAR keywords for common variables, plus
1595 far-common element size specification, in OBJ.
1597 \b Added a feature whereby EXTERNs and COMMONs in OBJ can be given a
1598 default WRT specification (either a segment or a group).
1600 \b Transformed the Unix NASM archive into an auto-configuring package.
1602 \b Added a sanity-check for people applying SEG to things which are
1603 already segment bases: this previously went unnoticed by the SEG
1604 processing and caused OBJ-driver panics later.
1606 \b Added the ability, in OBJ format, to deal with `MOV EAX,<segment>'
1607 type references: OBJ doesn't directly support dword-size segment
1608 base fixups, but as long as the low two bytes of the constant term
1609 are zero, a word-size fixup can be generated instead and it will
1610 work.
1612 \b Added the ability to specify sections' alignment requirements in
1613 Win32 object files and pure binary files.
1615 \b Added preprocess-time expression evaluation: the \c{%assign} (and
1616 \c{%iassign}) directive and the bare \c{%if} (and \c{%elif}) conditional. Added
1617 relational operators to the evaluator, for use only in \c{%if}
1618 constructs: the standard relationals = < > <= >= <> (and C-like
1619 synonyms == and !=) plus low-precedence logical operators &&, ^^ and
1622 \b Added a preprocessor repeat construct: \c{%rep} / \c{%exitrep} / \c{%endrep}.
1624 \b Added the __FILE__ and __LINE__ standard macros.
1626 \b Added a sanity check for number constants being greater than
1627 0xFFFFFFFF. The warning can be disabled.
1629 \b Added the %0 token whereby a variadic multi-line macro can tell how
1630 many parameters it's been given in a specific invocation.
1632 \b Added \c{%rotate}, allowing multi-line macro parameters to be cycled.
1634 \b Added the `*' option for the maximum parameter count on multi-line
1635 macros, allowing them to take arbitrarily many parameters.
1637 \b Added the ability for the user-level forms of EXTERN, GLOBAL and
1638 COMMON to take more than one argument.
1640 \b Added the IMPORT and EXPORT directives in OBJ format, to deal with
1641 Windows DLLs.
1643 \b Added some more preprocessor \c{%if} constructs: \c{%ifidn} / \c{%ifidni} (exact
1644 textual identity), and \c{%ifid} / \c{%ifnum} / \c{%ifstr} (token type testing).
1646 \b Added the ability to distinguish SHL AX,1 (the 8086 version) from
1647 SHL AX,BYTE 1 (the 286-and-upwards version whose constant happens to
1648 be 1).
1650 \b Added NetBSD/FreeBSD/OpenBSD's variant of a.out format, complete
1651 with PIC shared library features.
1653 \b Changed NASM's idiosyncratic handling of FCLEX, FDISI, FENI, FINIT,
1654 FSAVE, FSTCW, FSTENV, and FSTSW to bring it into line with the
1655 otherwise accepted standard. The previous behaviour, though it was a
1656 deliberate feature, was a deliberate feature based on a
1657 misunderstanding. Apologies for the inconvenience.
1659 \b Improved the flexibility of ABSOLUTE: you can now give it an
1660 expression rather than being restricted to a constant, and it can
1661 take relocatable arguments as well.
1663 \b Added the ability for a variable to be declared as EXTERN multiple
1664 times, and the subsequent definitions are just ignored.
1666 \b We now allow instruction prefixes (CS, DS, LOCK, REPZ etc) to be
1667 alone on a line (without a following instruction).
1669 \b Improved sanity checks on whether the arguments to EXTERN, GLOBAL
1670 and COMMON are valid identifiers.
1672 \b Added misc/exebin.mac to allow direct generation of .EXE files by
1673 hacking up an EXE header using DB and DW; also added test/binexe.asm
1674 to demonstrate the use of this. Thanks to Yann Guidon for
1675 contributing the EXE header code.
1677 \b ndisasm forgot to check whether the input file had been successfully
1678 opened. Now it does. Doh!
1680 \b Added the Cyrix extensions to the MMX instruction set.
1682 \b Added a hinting mechanism to allow [EAX+EBX] and [EBX+EAX] to be
1683 assembled differently. This is important since [ESI+EBP] and
1684 [EBP+ESI] have different default base segment registers.
1686 \b Added support for the PharLap OMF extension for 4096-byte segment
1687 alignment.
1690 \S{cl-0.95 released July 1997} Version 0.95 released July 1997
1692 \b Fixed yet another ELF bug. This one manifested if the user relied on
1693 the default segment, and attempted to define global symbols without
1694 first explicitly declaring the target segment.
1696 \b Added makefiles (for NASM and the RDF tools) to build Win32 console
1697 apps under Symantec C++. Donated by Mark Junker.
1699 \b Added `macros.bas' and `insns.bas', QBasic versions of the Perl
1700 scripts that convert `standard.mac' to `macros.c' and convert
1701 `insns.dat' to `insnsa.c' and `insnsd.c'. Also thanks to Mark
1702 Junker.
1704 \b Changed the diassembled forms of the conditional instructions so
1705 that JB is now emitted as JC, and other similar changes. Suggested
1706 list by Ulrich Doewich.
1708 \b Added `@' to the list of valid characters to begin an identifier
1709 with.
1711 \b Documentary changes, notably the addition of the `Common Problems'
1712 section in nasm.doc.
1714 \b Fixed a bug relating to 32-bit PC-relative fixups in OBJ.
1716 \b Fixed a bug in perm_copy() in labels.c which was causing exceptions
1717 in cleanup_labels() on some systems.
1719 \b Positivity sanity check in TIMES argument changed from a warning to
1720 an error following a further complaint.
1722 \b Changed the acceptable limits on byte and word operands to allow
1723 things like `~10111001b' to work.
1725 \b Fixed a major problem in the preprocessor which caused seg-faults if
1726 macro definitions contained blank lines or comment-only lines.
1728 \b Fixed inadequate error checking on the commas separating the
1729 arguments to `db', `dw' etc.
1731 \b Fixed a crippling bug in the handling of macros with operand counts
1732 defined with a `+' modifier.
1734 \b Fixed a bug whereby object file formats which stored the input file
1735 name in the output file (such as OBJ and COFF) weren't doing so
1736 correctly when the output file name was specified on the command
1737 line.
1739 \b Removed [INC] and [INCLUDE] support for good, since they were
1740 obsolete anyway.
1742 \b Fixed a bug in OBJ which caused all fixups to be output in 16-bit
1743 (old-format) FIXUPP records, rather than putting the 32-bit ones in
1744 FIXUPP32 (new-format) records.
1746 \b Added, tentatively, OS/2 object file support (as a minor variant on
1747 OBJ).
1749 \b Updates to Fox Cutter's Borland C makefile, Makefile.bc2.
1751 \b Removed a spurious second fclose() on the output file.
1753 \b Added the `-s' command line option to redirect all messages which
1754 would go to stderr (errors, help text) to stdout instead.
1756 \b Added the `-w' command line option to selectively suppress some
1757 classes of assembly warning messages.
1759 \b Added the `-p' pre-include and `-d' pre-define command-line options.
1761 \b Added an include file search path: the `-i' command line option.
1763 \b Fixed a silly little preprocessor bug whereby starting a line with a
1764 `%!' environment-variable reference caused an `unknown directive'
1765 error.
1767 \b Added the long-awaited listing file support: the `-l' command line
1768 option.
1770 \b Fixed a problem with OBJ format whereby, in the absence of any
1771 explicit segment definition, non-global symbols declared in the
1772 implicit default segment generated spurious EXTDEF records in the
1773 output.
1775 \b Added the NASM environment variable.
1777 \b From this version forward, Win32 console-mode binaries will be
1778 included in the DOS distribution in addition to the 16-bit binaries.
1779 Added Makefile.vc for this purpose.
1781 \b Added `return 0;' to test/objlink.c to prevent compiler warnings.
1783 \b Added the __NASM_MAJOR__ and __NASM_MINOR__ standard defines.
1785 \b Added an alternative memory-reference syntax in which prefixing an
1786 operand with `&' is equivalent to enclosing it in square brackets,
1787 at the request of Fox Cutter.
1789 \b Errors in pass two now cause the program to return a non-zero error
1790 code, which they didn't before.
1792 \b Fixed the single-line macro cycle detection, which didn't work at
1793 all on macros with no parameters (caused an infinite loop). Also
1794 changed the behaviour of single-line macro cycle detection to work
1795 like cpp, so that macros like `extrn' as given in the documentation
1796 can be implemented.
1798 \b Fixed the implementation of WRT, which was too restrictive in that
1799 you couldn't do `mov ax,[di+abc wrt dgroup]' because (di+abc) wasn't
1800 a relocatable reference.
1803 \S{cl-0.94 released April 1997} Version 0.94 released April 1997
1806 \b Major item: added the macro processor.
1808 \b Added undocumented instructions SMI, IBTS, XBTS and LOADALL286. Also
1809 reorganised CMPXCHG instruction into early-486 and Pentium forms.
1810 Thanks to Thobias Jones for the information.
1812 \b Fixed two more stupid bugs in ELF, which were causing `ld' to
1813 continue to seg-fault in a lot of non-trivial cases.
1815 \b Fixed a seg-fault in the label manager.
1817 \b Stopped FBLD and FBSTP from _requiring_ the TWORD keyword, which is
1818 the only option for BCD loads/stores in any case.
1820 \b Ensured FLDCW, FSTCW and FSTSW can cope with the WORD keyword, if
1821 anyone bothers to provide it. Previously they complained unless no
1822 keyword at all was present.
1824 \b Some forms of FDIV/FDIVR and FSUB/FSUBR were still inverted: a
1825 vestige of a bug that I thought had been fixed in 0.92. This was
1826 fixed, hopefully for good this time...
1828 \b Another minor phase error (insofar as a phase error can _ever_ be
1829 minor) fixed, this one occurring in code of the form
1831 \c   rol ax,forward_reference
1832 \c   forward_reference equ 1
1834 \b The number supplied to TIMES is now sanity-checked for positivity,
1835 and also may be greater than 64K (which previously didn't work on
1836 16-bit systems).
1838 \b Added Watcom C makefiles, and misc/pmw.bat, donated by Dominik Behr.
1840 \b Added the INCBIN pseudo-opcode.
1842 \b Due to the advent of the preprocessor, the [INCLUDE] and [INC]
1843 directives have become obsolete. They are still supported in this
1844 version, with a warning, but won't be in the next.
1846 \b Fixed a bug in OBJ format, which caused incorrect object records to
1847 be output when absolute labels were made global.
1849 \b Updates to RDOFF subdirectory, and changes to outrdf.c.
1852 \S{cl-0.93 released January 1997} Version 0.93 released January 1997
1854 This release went out in a great hurry after semi-crippling bugs
1855 were found in 0.92.
1857 \b Really \e{did} fix the stack overflows this time. *blush*
1859 \b Had problems with EA instruction sizes changing between passes, when
1860 an offset contained a forward reference and so 4 bytes were
1861 allocated for the offset in pass one; by pass two the symbol had
1862 been defined and happened to be a small absolute value, so only 1
1863 byte got allocated, causing instruction size mismatch between passes
1864 and hence incorrect address calculations. Fixed.
1866 \b Stupid bug in the revised ELF section generation fixed (associated
1867 string-table section for .symtab was hard-coded as 7, even when this
1868 didn't fit with the real section table). Was causing `ld' to
1869 seg-fault under Linux.
1871 \b Included a new Borland C makefile, Makefile.bc2, donated by Fox
1872 Cutter <lmb@comtch.iea.com>.
1875 \S{cl-0.92 released January 1997} Version 0.92 released January 1997
1877 \b The FDIVP/FDIVRP and FSUBP/FSUBRP pairs had been inverted: this was
1878 fixed. This also affected the LCC driver.
1880 \b Fixed a bug regarding 32-bit effective addresses of the form
1881 \c{[other_register+ESP]}.
1883 \b Documentary changes, notably documentation of the fact that Borland
1884 Win32 compilers use `obj' rather than `win32' object format.
1886 \b Fixed the COMENT record in OBJ files, which was formatted
1887 incorrectly.
1889 \b Fixed a bug causing segfaults in large RDF files.
1891 \b OBJ format now strips initial periods from segment and group
1892 definitions, in order to avoid complications with the local label
1893 syntax.
1895 \b Fixed a bug in disassembling far calls and jumps in NDISASM.
1897 \b Added support for user-defined sections in COFF and ELF files.
1899 \b Compiled the DOS binaries with a sensible amount of stack, to
1900 prevent stack overflows on any arithmetic expression containing
1901 parentheses.
1903 \b Fixed a bug in handling of files that do not terminate in a newline.
1906 \S{cl-0.91 released November 1996} Version 0.91 released November 1996
1908 \b Loads of bug fixes.
1910 \b Support for RDF added.
1912 \b Support for DBG debugging format added.
1914 \b Support for 32-bit extensions to Microsoft OBJ format added.
1916 \b Revised for Borland C: some variable names changed, makefile added.
1918 \b LCC support revised to actually work.
1920 \b JMP/CALL NEAR/FAR notation added.
1922 \b `a16', `o16', `a32' and `o32' prefixes added.
1924 \b Range checking on short jumps implemented.
1926 \b MMX instruction support added.
1928 \b Negative floating point constant support added.
1930 \b Memory handling improved to bypass 64K barrier under DOS.
1932 \b \c{$} prefix to force treatment of reserved words as identifiers added.
1934 \b Default-size mechanism for object formats added.
1936 \b Compile-time configurability added.
1938 \b \c{#}, \c{@}, \c{~} and c\{?} are now valid characters in labels.
1940 \b \c{-e} and \c{-k} options in NDISASM added.
1943 \S{cl-0.90 released October 1996} Version 0.90 released October 1996
1945 First release version. First support for object file output. Other
1946 changes from previous version (0.3x) too numerous to document.