diff options
author | Justin T. Gibbs <gibbs@FreeBSD.org> | 2002-09-26 21:46:19 +0000 |
---|---|---|
committer | Justin T. Gibbs <gibbs@FreeBSD.org> | 2002-09-26 21:46:19 +0000 |
commit | 4ff10146c39cf889337b66e5535e70411e4c5308 (patch) | |
tree | 11ece05ef6f5beabd35ea69bfaa0350e63979453 /sys/dev/aic7xxx/aicasm/aicasm_gram.y | |
parent | ea396d5bfa2a536966805ea5062a16103e20f8dd (diff) |
Use inttypes.h
Upgrade assembler to allow a move immediate of 0.
This is helpful in certain macros where we can't know the value of the
immediate in advance.
Notes
Notes:
svn path=/head/; revision=104019
Diffstat (limited to 'sys/dev/aic7xxx/aicasm/aicasm_gram.y')
-rw-r--r-- | sys/dev/aic7xxx/aicasm/aicasm_gram.y | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/sys/dev/aic7xxx/aicasm/aicasm_gram.y b/sys/dev/aic7xxx/aicasm/aicasm_gram.y index d6ba9931315f..0d2ff3ee7213 100644 --- a/sys/dev/aic7xxx/aicasm/aicasm_gram.y +++ b/sys/dev/aic7xxx/aicasm/aicasm_gram.y @@ -38,11 +38,12 @@ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGES. * - * $Id: //depot/aic7xxx/aic7xxx/aicasm/aicasm_gram.y#21 $ + * $Id: //depot/aic7xxx/aic7xxx/aicasm/aicasm_gram.y#24 $ * * $FreeBSD$ */ +#include <inttypes.h> #include <sys/types.h> #include <inttypes.h> @@ -937,6 +938,8 @@ immediate_or_a: | T_A { SLIST_INIT(&$$.referenced_syms); + symlist_add(&$$.referenced_syms, accumulator.symbol, + SYMLIST_INSERT_HEAD); $$.value = 0; } ; @@ -1236,9 +1239,22 @@ code: ; code: - T_MVI destination ',' immediate_or_a ret ';' + T_MVI destination ',' immediate ret ';' { - format_1_instr(AIC_OP_OR, &$2, &$4, &allzeros, $5); + if ($4.value == 0 + && is_download_const(&$4) == 0) { + expression_t immed; + + /* + * Allow move immediates of 0 so that macros, + * that can't know the immediate's value and + * otherwise compensate, still work. + */ + make_expression(&immed, 0xff); + format_1_instr(AIC_OP_AND, &$2, &immed, &allzeros, $5); + } else { + format_1_instr(AIC_OP_OR, &$2, &$4, &allzeros, $5); + } } ; |