This work is being done under contract with a company that has requested
to remain unnamed at the present time.
* bc-int.h (yasm_effaddr): Add strong flag to indicate if the effective
address is definitely an effective address; GAS does not use [] to designate
effective addresses so it's otherwise impossible to tell the difference
between "expr(,1)" and just "expr" (important for the relative jump
instructions).
* bytecode.h (yasm_ea_set_strong): New function to set the strong flag.
* bytecode.c (yasm_ea_set_strong): Implementation.
* x86bc.c (yasm_x86__ea_create_reg): Initialize strong flag.
* arch.h (yasm_insn_operand): Add deref flag to indicate use of "*foo" in
GAS syntax.
* arch.c (yasm_operand_create_reg, yasm_operand_create_segreg)
(yasm_operand_create_mem, yasm_operand_create_imm): Set deref flag to 0.
* gas: GAS syntax lexer and parser. Not all directives are implemented yet
(some will require additional core bytecodes).
* elf-objfmt.c (elf_objfmt_section_switch): Add support for GAS-style
section flags.
* x86arch.h (yasm_arch_x86): Add parser setting.
* x86arch.c (x86_create): Check for gas parser and initialize setting.
* x86bc.c (yasm_x86__ea_create_expr): Transform val+RIP to val wrt RIP when
using the GAS parser (this is how GAS interprets "expr(%rip)").
* x86id.re: Too many changes to enumerate in detail. Add new modifiers for
GAS suffixes. Start using them in a couple instructions. Split check_id
into subfunctions (still one entry point at present).
(yasm_x86__finalize_insn): Support new modifiers, reverse operands, derefs.
* yasm.c (main): Change all undef to extern when using GAS parser (this is
default GAS behavior).
svn path=/trunk/yasm/; revision=1239
represent a register group (e.g. indexed registers).
(yasm_arch_reggroup_get_reg): New function to get a specific register from
a register group and index.
(yasm_arch_module): Add module version of yasm_arch_reggroup_get_reg().
* lc3barch.c (lc3b_reggroup_get_reg): Implement.
(yasm_lc3b_LTX_arch): Point to implementation.
* x86arch.c (x86_reggroup_get_reg, yasm_x86_LTX_arch): Likewise.
svn path=/trunk/yasm/; revision=1234
undefined symbols extern if unused rather than causing undef errors.
* symrec.c (yasm_symtab_parser_finalize): Implement.
(symtab_finalize_info): New (more data to pass to
(symtab_parser_finalize_checksym): Update finalize helper.
* yasm.c (main): Update call to yasm_symtab_parser_finalize().
svn path=/trunk/yasm/; revision=1232
(yasm_arch_create): Add parser and error parameters; now the arch is given
the keyword of the parser in use. The error parameter allows the caller to
find out whether it was the machine name or the parser name that was in
error.
(yasm_arch_module): Change create definition to match yasm_arch_create().
(yasm_arch_create_error): New error typedef for yasm_arch_create() errors.
* lc3barch.c (lc3b_create): Update to match new yasm_arch_create().
* x86arch.c (x86_create): Likewise.
* yasm.c (main): Use new yasm_arch_create() and handle the two kinds of
errors it can now generate. Move parser creation up in the sequence so it
happens before the arch is created.
svn path=/trunk/yasm/; revision=1230
the object format default BITS setting. This makes it so [bits 64] is not
necessary to explicitly specify in the source file.
svn path=/trunk/yasm/; revision=1228
shortening to signed 8-bit immediate from a larger immediate size. This
yields much smaller code for many arithmetic instructions.
Noticed by: Brian Gladman <brg@gladman.plus.com>
svn path=/trunk/yasm/; revision=1227
sections. This breaks section numbering between the file section headers
and the section numbering used by symbols to reference sections.
While we're here, don't even try to number sections during parse... this
numbering is getting overwritten anyway.
Fixes#59 (reported by hkmaly@gmail.com).
svn path=/trunk/yasm/; revision=1226
platforms (notably Win64), unsigned long is not big enough to hold a
pointer.
* Makefile.am, configure.ac: Use ax_create_stdint_h to get us uintptr_t.
* ax_create_stdint_h.m4: Implementation of ax_create_stdint_h autoconf
macro from http://ac-archive.sourceforge.net/guidod/ax_create_stdint_h.html
svn path=/trunk/yasm/; revision=1223
works (was broken for >1 byte files).
(yasm_bc_tobytes): Fix handling of bytecodes that are larger than provided
buffer.
Patch by: Stephen Polkowski <stephen@centtech.com>
svn path=/trunk/yasm/; revision=1219
the .pdata section. This is needed for structured exception handling on AMD64.
Yasm in the long run should generate this info itself via the use of objfmt
specific directives.
Noticed By: Andrew Dunstan <a_dunstan@hotmail.com>
svn path=/trunk/yasm/; revision=1215
Initial patch by: Thomas Weidenmueller <thomas@reactsoft.com>
The NASM preprocessor implementation of this is ugly; the preprocessor
really needs a rewrite to clean it up, but there's other higher-priority
items on the TODO list.
svn path=/trunk/yasm/; revision=1211
Initial patch: Stephen Polkowski <stephen@centtech.com>
Added test case and tightened up so that vmread/vmwrite to/from 32-bit reg
is illegal in 64-bit mode.
svn path=/trunk/yasm/; revision=1209
nasm-macros.c is built. Now they build genmacro and generate nasm-macros.c
at build time, as it's no longer contained in the distribution.
svn path=/trunk/yasm/; revision=1205
* x86id.re (yasm_x86__parse_cpu): Add cases for "PRESCOTT", "SSE3", and "PNI".
(yasm_x86__parse_check_id): Add cases for all 13 new instructions.
Update FILD and FISTP so that common fildstp_insn can be used.
(lddqu_insn): New instruction format.
* x86arch.h (CPU_SSE3): New. Renumber others.
* sse3.asm, sse3.hex, sse3.errwarn: New test case for SSE3 instructions.
* x86/tests/Makefile.inc: Include test in build.
svn path=/trunk/yasm/; revision=1204
much easier to see the bad news when necessary. Thanks go to Peter for
updates to the C tests. Kudos to him having us send most of our tests
through a single shell script!
svn path=/trunk/yasm/; revision=1203
global symbols in ELF. Search for STV_HIDDEN for explanations; these
don't seem to appear in the base ELF documentation.
Sample syntax:
global foo:hidden
Inspiration and base patch provided by Oskari Saarenmaa under our BSD
license. This checkin tweaks and extends Oskari's patch and adds tests.
svn path=/trunk/yasm/; revision=1202
undocumented (in NASM) win32 object format "export" directive.
(yasm_win32_LTX_objfmt): Reference above instead of coff_objfmt_directive.
(coff_objfmt_section_switch): Add support for ".drectve" section.
(coff_objfmt_init_new_section): Refactored from coff_objfmt_section_switch.
* preproc.h (yasm_preproc_module): Add define_builtin for defining macros
before standard.mac macros are processed.
(yasm_preproc_builtin_define): Add prototype and macro to call above.
* raw-preproc.c (raw_preproc_define_builtin): Add (empty).
(yasm_raw_LTX_preproc): Use.
* nasm-preproc.c (nasm_preproc_define_builtin): Add wrapper around new
pp_builtin_define.
(yasm_nasm_LTX_preproc): Use.
* nasm-pp.h (pp_builtin_define): Add prototype.
* nasm-pp.c (builtindef): New list of builtin definitions.
(read_line): Iterate through builtindef.
(pp_builtin_define): Add to builtindef.
* standard.mac: Add wrapper around definition of ORG (only for bin objfmt),
add wrappered EXPORT definition.
* yasm.c (apply_preproc_builtins): Define __YASM_OBJFMT__ to selected objfmt.
(main): Call above in correct places.
* export.asm, export.hex, export.errwarn: New test for use of "export" macro
and directive.
svn path=/trunk/yasm/; revision=1199
* yasm-options.c (parse_cmdline): Make unrecognized options warnings instead
of errors.
These two changes make yasm more closely match the nasm command line. The
long-term fix for this will be making a nasm-like frontend.
Requested by: Brian Gladman <brg@gladman.plus.com>
svn path=/trunk/yasm/; revision=1197
expressions by outputting a 0 if the expr does not have an intnum equivalent.
This is not a fix: the real fix will need to be changing how listfmts get the
final data bytes for a bytecode. This "fix" only replaces the garbage with
0's, not the correct value (e.g. for relative jumps).
Found by: Albrecht Kleine <kleine@ak.sax.de>
svn path=/trunk/yasm/; revision=1196
expression processing. A crash is possible if we don't do this.
* nomem64-err.asm, nomem64-err.errwarn: New order forces split of this into:
* nomem64-err2.asm, nomem64-err2.errwarn: move two cases here.
Found by: Ewout Prangsma <ewout@prangsma.net>
svn path=/trunk/yasm/; revision=1194