From 4464fee50386ebff4d8a1e9f4e28917f1791918a Mon Sep 17 00:00:00 2001 From: "Kenneth D. Merry" Date: Wed, 4 Apr 2001 22:50:57 +0000 Subject: [PATCH] Don't allow immediate values of 0 for operations that can take either an immediate value or the accumulator. 0 is the chip's internal representation for the accumulator, and so 0 is an invalid immediate value when the accumulator can also be specified as an argument. Submitted by: gibbs --- sys/dev/aic7xxx/aicasm/aicasm_gram.y | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sys/dev/aic7xxx/aicasm/aicasm_gram.y b/sys/dev/aic7xxx/aicasm/aicasm_gram.y index d0bc6714acdc..91425f38c30a 100644 --- a/sys/dev/aic7xxx/aicasm/aicasm_gram.y +++ b/sys/dev/aic7xxx/aicasm/aicasm_gram.y @@ -623,6 +623,11 @@ immediate_or_a: expression { $$ = $1; + if ($$.value == 0) { + stop("Immediate value of 0 not valid for opcode", + EX_DATAERR); + /* NOTREACHED */ + } } | T_A {