aicasm_gram.y (102668) | aicasm_gram.y (104019) |
---|---|
1%{ 2/* 3 * Parser for the Aic7xxx SCSI Host adapter sequencer assembler. 4 * 5 * Copyright (c) 1997, 1998, 2000 Justin T. Gibbs. 6 * Copyright (c) 2001, 2002 Adaptec Inc. 7 * All rights reserved. 8 * --- 24 unchanged lines hidden (view full) --- 33 * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 34 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 35 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 36 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 37 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 38 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 39 * POSSIBILITY OF SUCH DAMAGES. 40 * | 1%{ 2/* 3 * Parser for the Aic7xxx SCSI Host adapter sequencer assembler. 4 * 5 * Copyright (c) 1997, 1998, 2000 Justin T. Gibbs. 6 * Copyright (c) 2001, 2002 Adaptec Inc. 7 * All rights reserved. 8 * --- 24 unchanged lines hidden (view full) --- 33 * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 34 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 35 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 36 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 37 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 38 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 39 * POSSIBILITY OF SUCH DAMAGES. 40 * |
41 * $Id: //depot/aic7xxx/aic7xxx/aicasm/aicasm_gram.y#21 $ | 41 * $Id: //depot/aic7xxx/aic7xxx/aicasm/aicasm_gram.y#24 $ |
42 * | 42 * |
43 * $FreeBSD: head/sys/dev/aic7xxx/aicasm/aicasm_gram.y 102668 2002-08-31 06:39:41Z gibbs $ | 43 * $FreeBSD: head/sys/dev/aic7xxx/aicasm/aicasm_gram.y 104019 2002-09-26 21:46:19Z gibbs $ |
44 */ 45 | 44 */ 45 |
46#include <inttypes.h> |
|
46#include <sys/types.h> 47 48#include <inttypes.h> 49#include <regex.h> 50#include <stdio.h> 51#include <stdlib.h> 52#include <string.h> 53#include <sysexits.h> --- 878 unchanged lines hidden (view full) --- 932 "instead.\n"); 933 stop(errbuf, EX_DATAERR); 934 } 935 $$ = $1; 936 } 937| T_A 938 { 939 SLIST_INIT(&$$.referenced_syms); | 47#include <sys/types.h> 48 49#include <inttypes.h> 50#include <regex.h> 51#include <stdio.h> 52#include <stdlib.h> 53#include <string.h> 54#include <sysexits.h> --- 878 unchanged lines hidden (view full) --- 933 "instead.\n"); 934 stop(errbuf, EX_DATAERR); 935 } 936 $$ = $1; 937 } 938| T_A 939 { 940 SLIST_INIT(&$$.referenced_syms); |
941 symlist_add(&$$.referenced_syms, accumulator.symbol, 942 SYMLIST_INSERT_HEAD); |
|
940 $$.value = 0; 941 } 942; 943 944source: 945 reg_symbol 946 { 947 test_readable_symbol($1.symbol); --- 283 unchanged lines hidden (view full) --- 1231 expression_t immed; 1232 1233 make_expression(&immed, 1); 1234 format_1_instr(AIC_OP_BMOV, &$2, &immed, &$4, $5); 1235 } 1236; 1237 1238code: | 943 $$.value = 0; 944 } 945; 946 947source: 948 reg_symbol 949 { 950 test_readable_symbol($1.symbol); --- 283 unchanged lines hidden (view full) --- 1234 expression_t immed; 1235 1236 make_expression(&immed, 1); 1237 format_1_instr(AIC_OP_BMOV, &$2, &immed, &$4, $5); 1238 } 1239; 1240 1241code: |
1239 T_MVI destination ',' immediate_or_a ret ';' | 1242 T_MVI destination ',' immediate ret ';' |
1240 { | 1243 { |
1241 format_1_instr(AIC_OP_OR, &$2, &$4, &allzeros, $5); | 1244 if ($4.value == 0 1245 && is_download_const(&$4) == 0) { 1246 expression_t immed; 1247 1248 /* 1249 * Allow move immediates of 0 so that macros, 1250 * that can't know the immediate's value and 1251 * otherwise compensate, still work. 1252 */ 1253 make_expression(&immed, 0xff); 1254 format_1_instr(AIC_OP_AND, &$2, &immed, &allzeros, $5); 1255 } else { 1256 format_1_instr(AIC_OP_OR, &$2, &$4, &allzeros, $5); 1257 } |
1242 } 1243; 1244 1245code: 1246 T_NOT destination opt_source ret ';' 1247 { 1248 expression_t immed; 1249 --- 690 unchanged lines hidden --- | 1258 } 1259; 1260 1261code: 1262 T_NOT destination opt_source ret ';' 1263 { 1264 expression_t immed; 1265 --- 690 unchanged lines hidden --- |