summaryrefslogtreecommitdiff
path: root/parser.c
AgeCommit message (Collapse)AuthorFilesLines
2009-06-27parser.c: fix stylistic nitpickH. Peter Anvin1-1/+0
Fix stray blank line in parser.c Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-06-23parser: don't use midcode declarationsH. Peter Anvin1-1/+2
OpenWatcom can't handle midcode variable declarations. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-06-23BR 2782055: reject invalid tokens after ]Victor van den Elzen1-8/+16
A bracketed memory reference should be followed by a comma or the end of the line. Enforce this.
2009-02-25Do not confuse segmentless adresses and unknown forward referencesVictor van den Elzen1-0/+8
Also be optimistic with immediate forward references.
2009-02-21BR 2592476: Treat WAIT as a prefix even though it's really an instructionH. Peter Anvin1-0/+2
WAIT is technically an instruction, but from an assembler standpoint it behaves as if it had been a prefix. In particular, it has to be ordered *before* any real hardware prefixes.
2008-09-23Allow value to TIMES to be negative while optimization is in progressCharles Crayne1-1/+1
Change the parser to only issue the "TIMES value %d is negative" error message if all optimization passes have completed.
2008-09-10Decouple forward references from optimizationCharles Crayne1-11/+3
Users who wish to control the level of optimization can continue to specify -O0, -O1, or -Ox, where x can be the letter itself, or any number > 1. However, even with optimization turned off, NASM will always make enough passes to resolve forward references. As a result, INCBIN is now the only item left in the critical expressions list, although TIMES still has its own constant value check.
2008-06-15Free EOT_DB_STRING_FREE in cleanup_insn()H. Peter Anvin1-3/+4
Free EOT_DB_STRING_FREE data in cleanup_insn(), which is where we free all the other extop data.
2008-06-14Implement __utf16__() and __utf32__() for the DB familyH. Peter Anvin1-72/+102
Implement __utf16__() and __utf32__() for the DB family of pseudo-instructions. Not yet implemented for evaluation context.
2008-06-09Make strings a first-class token type; defer evaluationH. Peter Anvin1-1/+1
Make strings a proper, first-class token type, instead of relying on the "TOKEN_NUM with tv_charptr" hack. Only convert a string to a number if requested in an expression context; this also makes it possible to actually issue a warning when it overflows.
2008-06-04Remove EQU for critical expression listCharles Crayne1-1/+1
Allow redefine_label to update segment as well as offset, thereby fixing bug which required EQU to be on the critical expression list.
2008-05-20No 32-byte floating point format: fix error for DYH. Peter Anvin1-0/+5
Output a more legible error message for floating-point with "DY".
2008-05-20Avoid #including .c files; instead compile as separate unitsH. Peter Anvin1-7/+6
Don't #include .c files, even if they are auto-generated; instead compile them as separate compilation units and let the linker do its job.
2008-05-20Add DY, YWORD, and the SY instruction flagH. Peter Anvin1-2/+12
Add the DY instruction, YWORD keyword, and an SY marker for instruction sizes. Add a few more AVX sample instructions.
2008-04-04Correctly identify SBYTE in the optimizerH. Peter Anvin1-3/+10
Correctly identify SBYTE in the optimizer, *HOWEVER*, this change will cause nuisance warnings to be issued; that will have to be fixed.
2008-03-26Restore critical expression checking when optimizer enabledCharles Crayne1-1/+2
In the prior code, enabling optimization effectively diabled critical expression checking, because the optimization passes took place before checking was enabled.
2007-12-29regularized spelling of license to match name of LICENSE fileBeroset1-1/+1
2007-11-18Clean up remaining build warningsH. Peter Anvin1-3/+4
Clean up remaining build warnings. None of this should affect code operations. The only warnings which were actually relevant might have been the ones in ldrdf.c, but it's not clear if anyone ever uses that.
2007-11-04Permit opcode names as labels as long as they are followed by a colonH. Peter Anvin1-2/+20
Permit opcode names to be used as labels if and only if they are succeeded by a colon. Opcode names occurring when parsing expressions are all treated as labels; a leading colon occurred when parsing an instruction forces a parser restart with the instruction forcibly treated as an identifier.
2007-10-29Use a 32-bit floating-point limb size; support 8-bit floatH. Peter Anvin1-1/+4
Use a 32-bit limb size ("like a digit, but bigger") for floating-point conversion. This cuts the number of multiplications per constant by a factor of four. This means supporting fractional-limb-sized numbers, so while we're at it, add support for 8-bit floating point numbers (apparently used in graphics and in audio compression applications.)
2007-10-29Reduce severity of redundant prefixes from error to warning.Charles Crayne1-1/+5
2007-10-28Clean up stealth whitespaceH. Peter Anvin1-1/+1
Remove stealth whitespace
2007-10-2864-bit addressing and prefix handling changesH. Peter Anvin1-103/+152
Revamp the address- and prefix-handling code to make more sense in 64-bit mode. We are now a lot closer to where we want to be, but we're not quite there yet. ndisasm may very well have problems, or give counterintuitive output. However, checking it in so we can make forward progress.
2007-10-10Use the compiler-provided booleans if available, otherwise emulateH. Peter Anvin1-9/+9
Both C and C++ have "bool", "true" and "false" in lower case; C requires <stdbool.h> for this, in C++ it is an inherent type built into the compiler. Use those instead of the old macros; emulate with a simple typedef enum if unavailable.
2007-10-03Change cloc_t to struct location, and reorder the membersH. Peter Anvin1-2/+2
Change cloc_t to struct location, and reorder the members so that it should fit in 16 bytes instead of needing 8 bytes of extra padding on 64-bit machines.
2007-10-03BR 1352920: change loc_t -> cloc_tH. Peter Anvin1-2/+2
Change loc_t to cloc_t to avoid AIX conflict. We really shouldn't use _t names at all; they are usually considered platform types, but worry about that later.
2007-10-02Portability fixesH. Peter Anvin1-0/+2
Concentrate compiler dependencies to compiler.h; make sure compiler.h is included first in every .c file (since some prototypes may depend on the presence of feature request macros.) Actually use the conditional inclusion of various functions (totally broken in previous releases.)
2007-09-18Fix handling of DO; support unary + for floating-point numbersH. Peter Anvin1-7/+11
Floating-point users generally expect to be able to use a unary plus. Fix support for the DO instruction in several places.
2007-09-18Support 16-bit IEEE floating point; used in SSE5H. Peter Anvin1-9/+15
SSE5 supports standard IEEE 16-bit floating point, so we should support that too.
2007-09-18Implement "oword" (128 bits) as a first-class sizeH. Peter Anvin1-10/+25
Implement oword, reso, do, as well as the SO flag to instructions. No instructions are actually flagged with SO yet, but this allows us to specify 128-bit sizes in instruction patterns.
2007-09-17Fix a few instances of missing renumbersH. Peter Anvin1-2/+2
parser.c: change hard-coded argument count 3 to MAX_ARGUMENTS assemble.c: change a few missed code renumbers
2007-09-12Support r/m operands for non-integer typesH. Peter Anvin1-1/+2
Support r/m operands for non-integer operands types, i.e. mmx or xmm operands. This allows mmx and xmm operands to be written more compactly, speeding up the assembler.
2007-09-12Use enumerations where practical to ease debuggingH. Peter Anvin1-0/+2
We have a lot of enumerations; by declaring fields as such, we make it easier when debugging, since the debugger can display the enumerations in cleartext. However, make sure exceptional values (like -1) are included in the enumeration, since the compiler otherwise may not include it in the valid range of the enumeration.
2007-08-30Finishing touches on perfect hash tokenizer; actually turn the thing onH. Peter Anvin1-0/+1
Finish the perfect hash tokenizer, and actually enable it. Move stdscan() et al to a separate file, since it's not needed in any of the clients of nasmlib other than nasm itself. Run make alldeps.
2007-08-29Correct the logic for recording fs: and gs: overrides.H. Peter Anvin1-1/+1
2007-08-29Add [default] directiveH. Peter Anvin1-5/+0
Add the [default {abs|rel}] directive, and clean up directive parsing.
2007-08-29Suppress IP-relative only for fs: and gs: overridesH. Peter Anvin1-2/+3
AMD has (undocumented) segment limits even in 64-bit mode, so people may want to use cs/ds/es/ss overrides. Since there are no bases, however, IP-relative still applies. See: http://www.amd.com.hk/us-en/assets/content_type/DownloadableAssets/dwamd_kernel_summit_08_RB.pdf
2007-08-28Implement REL/ABS modifiersH. Peter Anvin1-7/+29
Implement "REL" and "ABS" modifiers for offsets in 64-bit mode. This replaces "rip+XXX" type addressing. The infrastructure to set the default mode is there, but there is nothing to throw the switch just yet.
2007-04-16Fixed 64-bit offset generation.Keith Kanios1-1/+1
2007-04-13Fixed distinction between char and int8_t data types.Keith Kanios1-4/+4
2007-04-12General push for x86-64 support, dubbed 0.99.00.Keith Kanios1-10/+11
2005-01-15Apply Nindent to all .c and .h filesH. Peter Anvin1-661/+657
2002-09-19Fixes from Bart OldemanH. Peter Anvin1-1/+2
2002-09-13Fix missing test for e->type being set.H. Peter Anvin1-1/+2
2002-09-12Clean up unnecessary dependencies.H. Peter Anvin1-0/+1
2002-06-06This is the "megapatch":H. Peter Anvin1-12/+1
a) Automatically generate dependencies for all Makefiles; b) Move register definitions to a separate .dat file; c) Add support for "unimplemented but there in theory" registers.
2002-06-04Added code to prevent FAR from being used with a registerDebbie Wiles1-0/+5
2002-05-26Make "ABSOLUTE <label>" work again; code based on 0.97.H. Peter Anvin1-1/+5
2002-05-22Fix the handling of the STRICT keywordH. Peter Anvin1-1/+2
2002-05-21Implement new "strict" keyword to inhibit optimization.H. Peter Anvin1-1/+4