summaryrefslogtreecommitdiff
path: root/nasm.c
AgeCommit message (Collapse)AuthorFilesLines
2014-05-09options: Add --v optionCyrill Gorcunov1-4/+13
It's been requested a long ago to handle '--v' option same was as a regualar '-v'. From initial report | NASM and yasm are in many respects compatible but yasm uses --v | instead of -v for version. As often --v is used for version I | end up using --v initially in NASM. This patch allows me to compile | Mozilla apps which use yasm with NASM by merely renaming NASM to yasm | so that the build environment does not have to be updated (Mozilla | would not accept changes to allow use of NASM). Reported-by: Andy Willis <abwillis1@gmail.com> Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com> Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2013-12-04bnd: Add a new nobnd prefixJin Kyu Song1-1/+8
bnd and nobnd prifixes can be used for each instruction line to direct whether bnd registers should be preserved or not. And those are also added as options for DEFAULT directive. Once bnd is set with default, DEFAULT BND, all bnd-prefix available instructions are prefixed with bnd. To override it, nobnd prefix can be used. In the other way, DEFAULT NOBND can disable DEFAULT BND and have nasm encode in the normal way. Signed-off-by: Jin Kyu Song <jin.kyu.song@intel.com>
2013-12-04bnd: Show warning when bnd prefix is droppedJin Kyu Song1-0/+1
When bnd prefix is dropped as jmp is encoded as jmp short, nasm shows a warning message, which can be suppressed with a new command line option, -w-bnd. Signed-off-by: Jin Kyu Song <jin.kyu.song@intel.com>
2013-11-24iflag: Start using new instruction flags engineCyrill Gorcunov1-42/+57
Here we start using instruction flags generator. Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-08-28AVX-512: Change the data type for instruction flagsJin Kyu Song1-4/+4
Increased the size of data type for instruction flags from 32bits to 64bits. And a new type (iflags_t) is defined for better maintainability. Bigger data type is needed because more instruction set types are coming but there were not enough space for them. Since they are not bit masks, only one instruction set is allowed for each instruction. Signed-off-by: Jin Kyu Song <jin.kyu.song@intel.com> Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-04-20BR3392248: Update nasm -h outputCyrill Gorcunov1-0/+4
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-02-15nasm.c: Convert GET_CURR_OFFS/SET_CURR_OFFS to functionsCyrill Gorcunov1-12/+17
In future better to not work with global variables but rather pass arguments. Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-02-15nasm.c: Update year in headerCyrill Gorcunov1-1/+1
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-02-15nasm.c: Tabs to spaces in emit_dependenciesCyrill Gorcunov1-18/+18
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-02-15nasm.c: Tabs to spaces in mainCyrill Gorcunov1-21/+20
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-02-15nasm.c: Tabs to spaces in copy_filenameCyrill Gorcunov1-2/+2
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-02-15nasm.c: Tabs to spaces in copy_filenameCyrill Gorcunov1-52/+52
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-02-15nasm.c: Tabs to spaces in process_argCyrill Gorcunov1-154/+154
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-02-15nasm.c: Tabs to spaces in process_response_fileCyrill Gorcunov1-3/+3
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-02-15nasm.c: Tabs to spaces in assemble_fileCyrill Gorcunov1-187/+183
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-02-15nasm.c: Tabs to spaces in nasm_verror_gnuCyrill Gorcunov1-3/+3
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-02-15nasm.c: Tabs to spaces in nasm_verror_commonCyrill Gorcunov1-9/+9
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-02-15nasm.c: Tabs to spaces in define_macros_earlyCyrill Gorcunov1-25/+25
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2012-09-09When generate dependency names internally, quote filenamesH. Peter Anvin1-4/+8
Quote filenames for Make when generated for filenames internally. Only skip quoting when using the -MT option (rather than -MQ). Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2012-05-07preproc: Move NOP preprocessor into separate fileCyrill Gorcunov1-147/+1
No need to carry it in nasm.c, let it be more modular. Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2012-05-07preproc: Split get rid of global preproc methodsCyrill Gorcunov1-17/+52
This will allow to hook on updated preprocessor without breaking existing one. Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2012-03-11help: Print that -Ox is a default optimization levelCyrill Gorcunov1-2/+2
Reported-by: Frank Kotler <fbkotler@myfairpoint.net> Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2012-02-25Make the LOCK and HLE warnings suppressable.H. Peter Anvin1-1/+3
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2012-02-24nasm.c: Fix is_suppressed_warning()H. Peter Anvin1-8/+5
The logic in is_suppressed_warning() was severely wrong, which would cause a lot of legitimate warnings to be suppressed while some warnings would be duplicated. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2011-12-05Don't forget to setup warning levels on preprocessor phaseCyrill Gorcunov1-1/+2
http://bugzilla.nasm.us/show_bug.cgi?id=3143109 Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-12-05Drop tab/space mess from parse_cmdlineCyrill Gorcunov1-23/+27
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-12-05Use proper bracing on setting warnings in comman line parsingCyrill Gorcunov1-14/+16
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-12-05Add WARN_IDX helper and ERR_WARN_TERM named constantCyrill Gorcunov1-3/+3
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-12-04Simplify is_suppressed_warning helperCyrill Gorcunov1-9/+18
The former is really hard to read. Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-07-17Drop unused 'arg' variableCyrill Gorcunov1-2/+1
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-07-02preproc: Move Preproc type to preproc_ops structureCyrill Gorcunov1-4/+6
There is no need to hide this structure into a type. The former preproc_ops is a way more descriptive. Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-06-25nassm.c: Use evaluate for section alignmentCyrill Gorcunov1-4/+16
This allow us to write the whole expressions on section alignments, such as align 0xa+6 or whatever math. Should be a way more convenient than hardnumbers scheme we had. Reported-by: Frank Kotler <fbkotler@zytor.com> Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-04-06ofmt: Alias shortname must be used for __OUTPUT_FORMAT__ macroCyrill Gorcunov1-3/+9
__OUTPUT_FORMAT__ must consist of shortname of output format or its alias, otherwise userspace ABI gets broken. For example source code still can refer to __OUTPUT_FORMAT__=elf, instead of __OUTPUT_FORMAT__=elf32. BR3246990 Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-03-07BR3200749: Fix "use after close" file pointerCyrill Gorcunov1-1/+4
Cleanup routine might be called several times so be ready for that. Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-07-25Revert "Improve process_ea and introduce -OL"H. Peter Anvin1-16/+7
This reverts commit ac732cb6a599836bf4c988e59ac6de4498758c72. Resolved Conflicts: doc/nasmdoc.src Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2010-07-24Improve process_ea and introduce -OLVictor van den Elzen1-7/+16
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.
2010-07-15Make -Ox the defaultH. Peter Anvin1-5/+14
Make -Ox the default; it's the optimization level expected by most users, and it is clearly still causing confusion that it has to be specified manually. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2010-07-13No need for \n at __OUTPUT_FORMAT__ macro endCyrill Gorcunov1-1/+1
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-04-21Rename SEGALIGN to SECTALIGNCyrill Gorcunov1-3/+3
"sectalign" is preferred over "segalign" since it operates over section attributes. Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-04-21ofmt: Implement null_segalign stubsCyrill Gorcunov1-0/+2
Set stubs for all targets Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-04-21Introduce SEGALIGN directiveCyrill Gorcunov1-1/+13
No real handling yet though. Definition only. Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-04-21nasm.c: Delete redundant gotoCyrill Gorcunov1-2/+2
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-04-07nasm.c: smarter handling of missing directivesH. Peter Anvin1-4/+7
If we get D_unknown, we definitely don't need to pass it to the backend for analysis. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2010-04-06Distinguish no directive present from unknown directiveH. Peter Anvin1-4/+4
Distinguish the case of no directive present (D_none) from the case of an unknown specified directive (D_unknown). This is reflected in different error messages. Furthermore, change the special case symbols to lower case in case we ever have a directive called [none] or [unknown]. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2010-01-09nasm.c: Restore strings broken by `indent`Cyrill Gorcunov1-30/+14
A number of strings are broken by nindent passed over the nasm.c. Though the compiler doesn't care about this fact it's really unpleasant to have a string split at "dot" symbol. Lets restore it in a sake of readability. (No change on binary level) Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2009-12-04nasm.c: Use copy_filename to set error message fileCyrill Gorcunov1-1/+1
To prevent errname buffer overwrite we should use copy_filename instead of strcpy. Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2009-10-31stdscan: switch to stdscan_get/set routinesCyrill Gorcunov1-2/+2
Instead of manipulating stdscan buffer pointer directly we switch to a routine interface. This allow us to unify stdscan access: ie caller should "talk" to stdscan via stdscan_get/set routines. Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2009-10-13nasm: rename nasm_zap_spaces() to nasm_zap_spaces_fwd()H. Peter Anvin1-1/+1
By analogy with nasm_zap_spaces_rev() have nasm_zap_spaces_fwd(). The forward version isn't a super-common operation, and it might be possible to think the reverse one is the "normal" version... therefore we might as well be explicit. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-10-13nasm.c: use string helpersCyrill Gorcunov1-19/+7
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2009-10-13nasm.c: getkw -- use string helpersCyrill Gorcunov1-36/+27
This allow us to shrink code a bit and make it easy to read. Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>