]> granicus.if.org Git - yasm/commit
Implement align and org bytecodes. While we're here, implement .zero
authorPeter Johnson <peter@tortall.net>
Mon, 3 Oct 2005 05:52:04 +0000 (05:52 -0000)
committerPeter Johnson <peter@tortall.net>
Mon, 3 Oct 2005 05:52:04 +0000 (05:52 -0000)
commitd660906db518af6802fa41d47f47f1474d39a12d
tree4479d3925a93190694b71aff5a0fbf7ac9b4f894
parentb92df685aa99c870e1b41a2b2da6f0df93e303b3
Implement align and org bytecodes.  While we're here, implement .zero
directive for GAS (it's generated by GCC).

* bytecode.c (bytecode_align): Update for full align implementation.
(yasm_bc_create_align): Likewise.
(bc_align_finalize): New.
(bc_align_resolve, bc_align_tobytes): Real implementation.
* bytecode.h (yasm_bc_create_align): Update to match.
* arch.h (get_fill, yasm_arch_get_fill): New, to get NOP fill patterns.
* x86arch.c (x86_get_fill): Implement.
* lc3barch.c (lc3b_get_fill): Likewise (probably buggy, there's no real NOP).

* bytecode.c (bytecode_org): New org bytecode.
(bc_org_callback, bc_org_destroy, bc_org_print, bc_org_resolve)
(bc_org_tobytes, yasm_bc_create_org): Implement.

* gas-parser.h (yasm_parser_gas): Add code_section flag to indicate when to
use code fill vs. data fill.
* gas-parser.c: Initialize flag.
* gas-bison.y: Update flag in various places.  Generate org bytecode.
Call gas_parser_align to generate align bytecode.
(gas_parser_align): Generate align bytecode.

* gas-bison.y: Implement .zero directive.
* gas-token.re: Likewise.

* align32, align64: New tests to test align directive NOP generation.

svn path=/trunk/yasm/; revision=1263
17 files changed:
libyasm/arch.h
libyasm/bytecode.c
libyasm/bytecode.h
modules/arch/lc3b/lc3barch.c
modules/arch/x86/tests/gas32/Makefile.inc
modules/arch/x86/tests/gas32/align32.asm [new file with mode: 0644]
modules/arch/x86/tests/gas32/align32.errwarn [new file with mode: 0644]
modules/arch/x86/tests/gas32/align32.hex [new file with mode: 0644]
modules/arch/x86/tests/gas64/Makefile.inc
modules/arch/x86/tests/gas64/align64.asm [new file with mode: 0644]
modules/arch/x86/tests/gas64/align64.errwarn [new file with mode: 0644]
modules/arch/x86/tests/gas64/align64.hex [new file with mode: 0644]
modules/arch/x86/x86arch.c
modules/parsers/gas/gas-bison.y
modules/parsers/gas/gas-parser.c
modules/parsers/gas/gas-parser.h
modules/parsers/gas/gas-token.re