Yasm Assembler mainline development tree (ffmpeg 依赖)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
785 B

Preliminary GAS parser. Only a few instructions are supported at present. 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
19 years ago
# $Id$
libyasm_a_SOURCES += modules/parsers/gas/gas-parser.c
libyasm_a_SOURCES += modules/parsers/gas/gas-parser.h
libyasm_a_SOURCES += modules/parsers/gas/gas-defs.h
libyasm_a_SOURCES += modules/parsers/gas/gas-bison.y
libyasm_a_SOURCES += gas-bison.h
libyasm_a_SOURCES += gas-token.c
YASM_MODULES += parser_gas
gas-token.c: $(srcdir)/modules/parsers/gas/gas-token.re re2c$(EXEEXT)
$(top_builddir)/re2c$(EXEEXT) -b -o $@ $(srcdir)/modules/parsers/gas/gas-token.re
Preliminary GAS parser. Only a few instructions are supported at present. 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
19 years ago
BUILT_SOURCES += gas-bison.c
BUILT_SOURCES += gas-bison.h
BUILT_SOURCES += gas-token.c
CLEANFILES += gas-bison.c
CLEANFILES += gas-bison.h
CLEANFILES += gas-token.c
EXTRA_DIST += modules/parsers/gas/tests/Makefile.inc
EXTRA_DIST += modules/parsers/gas/gas-token.re
include modules/parsers/gas/tests/Makefile.inc