Frankenstein Cross Assemblers, Phillips/Signetics 2650, Part 2 of 2

Mark Zenier markz at ssc.UUCP
Fri Dec 7 11:16:14 AEST 1990


---- Cut Here and feed the following to sh ----
#!/bin/sh
# This is part 02 of Frankasm/As2650
# ============= as2650.y ==============
if test -f 'as2650.y' -a X"$1" != X"-c"; then
	echo 'x - skipping as2650.y (File already exists)'
else
echo 'x - extracting as2650.y (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'as2650.y' &&
X%{
X
X/*
XHEADER: 	;
XTITLE: 		Frankenstein Cross Assemblers;
XVERSION: 	2.0;
XDESCRIPTION: "	Reconfigurable Cross-assembler producing Intel (TM)
X		Hex format object records.  ";
XKEYWORDS: 	cross-assemblers, 1805, 2650, 6301, 6502, 6805, 6809, 
X		6811, tms7000, 8048, 8051, 8096, z8, z80;
XSYSTEM: 	UNIX, MS-Dos ;
XFILENAME: 	as2650.y;
XWARNINGS: 	"This software is in the public domain.  
X		Any prior copyright claims are relinquished.  
X
X		This software is distributed with no warranty whatever.  
X		The author takes no responsibility for the consequences 
X		of its use.
X
X		Yacc (or Bison) required to compile."  ;
XSEE-ALSO: 	as2650.doc,frasmain.c;	
XAUTHORS: 	Mark Zenier;
XCOMPILERS: 	Microport Sys V/AT, ATT Yacc, Turbo C V1.5, Bison (CUG disk 285)
X		(previous versions Xenix, Unisoft 68000 Version 7, Sun 3);
X*/
X/* 2650 instruction generation file, standard syntax */
X/* November 17, 1990 */
X
X/*
X	description	frame work parser description for framework cross
X			assemblers
X	history		February 2, 1988
X			September 11, 1990 - merge table definition
X			September 12, 1990 - short file names
X			September 14, 1990 - short variable names
X			September 17, 1990 - use yylex as external
X*/
X#include <stdio.h>
X#include "frasmdat.h"
X#include "fragcon.h"
X
X#define yylex lexintercept
X
X	/* selectors for register */
X	/* 0000 0000 0000 xxxx */
X#define REGMASK	0xf 
X#define REG0	0x1
X#define REG1	0x2
X#define REG2	0x4
X#define REG3	0x8
X	/* selectors for conditions */
X	/* 0000 0000 xxxx 0000 */
X#define CONDMASK	0xf0
X#define COND0	0x10
X#define COND1	0x20
X#define COND2	0x40
X#define COND3 0x80
X
X#define PAGEBITS 0x6000
X#define ST_INH 0x1
X#define ST_EXP 0x2
X#define ST_INDIR 0x4
X#define ST_REG 0x8
X#define ST_REGCOMMA 0x10
X#define ST_REGEXP 0x20
X#define ST_REGINDIR 0x40
X#define ST_COND 0x80
X#define ST_CONDEXP 0x100
X#define ST_CONDINDIR 0x200
X#define ST_BINDEX 0x400
X#define ST_BINDIRX 0x800
X#define	API_ABS	0
X#define	API_INC	2
X#define	API_DEC	4
X#define	API_IND	6
X#define	API_IABS	8
X#define	API_IINC	0xa
X#define	API_IDEC	0xc
X#define	API_IIND	0xe
X#define ST_ABSOLUTE 0x1
X#define ST_INDEX 0x2
X#define ST_INCINDEX 0x4
X#define ST_DECINDEX 0x8
X#define ST_AREGINDIR 0x10
X#define ST_INDIRX 0x20
X#define ST_INCINDIRX 0x40
X#define ST_DECINDIRX 0x80
X	
X	static int	regsel[4] = {REG0, REG1, REG2, REG3};
X	static int	condsel[4] = {COND0, COND1, COND2, COND3};
X	static int	prevpage;
X	static char	genbdef[] = "[1=];";
X	static char	genwdef[] = "[1=]x"; /* x for normal, y for byte rev */
X	char ignosyn[] = "[Xinvalid syntax for instruction";
X	char ignosel[] = "[Xinvalid operands";
X
X	long	labelloc;
X	static int satsub;
X	int	ifstkpt = 0;
X	int	fraifskip = FALSE;
X
X	struct symel * endsymbol = SYMNULL;
X
X%}
X%union {
X	int	intv;
X	long 	longv;
X	char	*strng;
X	struct symel *symb;
X}
X
X%token <intv> REGISTER 
X%token <intv> CONDITION 
X%token <intv> KOC_BDEF
X%token <intv> KOC_ELSE
X%token <intv> KOC_END
X%token <intv> KOC_ENDI
X%token <intv> KOC_EQU
X%token <intv> KOC_IF
X%token <intv> KOC_INCLUDE
X%token <intv> KOC_ORG
X%token <intv> KOC_RESM
X%token <intv> KOC_SDEF
X%token <intv> KOC_SET
X%token <intv> KOC_WDEF
X%token <intv> KOC_CHSET
X%token <intv> KOC_CHDEF
X%token <intv> KOC_CHUSE
X%token <intv> KOC_ACON
X%token <intv> KOC_opcode
X%token <intv> KOC_indexabs
X
X%token <longv> CONSTANT
X%token EOL
X%token KEOP_AND
X%token KEOP_DEFINED
X%token KEOP_EQ
X%token KEOP_GE
X%token KEOP_GT
X%token KEOP_HIGH
X%token KEOP_LE
X%token KEOP_LOW
X%token KEOP_LT
X%token KEOP_MOD
X%token KEOP_MUN
X%token KEOP_NE
X%token KEOP_NOT
X%token KEOP_OR
X%token KEOP_SHL
X%token KEOP_SHR
X%token KEOP_XOR
X%token KEOP_locctr
X%token <symb> LABEL
X%token <strng> STRING
X%token <symb> SYMBOL
X
X%token KTK_invalid
X
X%right	KEOP_HIGH KEOP_LOW
X%left	KEOP_OR KEOP_XOR
X%left	KEOP_AND
X%right	KEOP_NOT
X%nonassoc	KEOP_GT KEOP_GE KEOP_LE KEOP_LT KEOP_NE KEOP_EQ
X%left	'+' '-'
X%left	'*' '/' KEOP_MOD KEOP_SHL KEOP_SHR
X%right	KEOP_MUN
X
X
X%type <intv> expr exprlist stringlist
X
X%start file
X
X%%
X
Xfile	:	file allline
X	|	allline
X	;
X
Xallline	: 	line EOL
X			{
X				clrexpr();
X			}
X	|	EOL
X	|	error EOL
X			{
X				clrexpr();
X				yyerrok;
X			}
X	;
X
Xline	:	LABEL KOC_END 
X			{
X				endsymbol = $1;
X				nextreadact = Nra_end;
X			}
X	|	      KOC_END 
X			{
X				nextreadact = Nra_end;
X			}
X	|	KOC_INCLUDE STRING
X			{
X		if(nextfstk >= FILESTKDPTH)
X		{
X			fraerror("include file nesting limit exceeded");
X		}
X		else
X		{
X			infilestk[nextfstk].fnm = savestring($2,strlen($2));
X			if( (infilestk[nextfstk].fpt = fopen($2,"r"))
X				==(FILE *)NULL )
X			{
X				fraerror("cannot open include file");
X			}
X			else
X			{
X				nextreadact = Nra_new;
X			}
X		}
X			}
X	|	LABEL KOC_EQU expr 
X			{
X				if($1 -> seg == SSG_UNDEF)
X				{
X					pevalexpr(0, $3);
X					if(evalr[0].seg == SSG_ABS)
X					{
X						$1 -> seg = SSG_EQU;
X						$1 -> value = evalr[0].value;
X						prtequvalue("C: 0x%lx\n",
X							evalr[0].value);
X					}
X					else
X					{
X						fraerror(
X					"noncomputable expression for EQU");
X					}
X				}
X				else
X				{
X					fraerror(
X				"cannot change symbol value with EQU");
X				}
X			}
X	|	LABEL KOC_SET expr 
X			{
X				if($1 -> seg == SSG_UNDEF
X				   || $1 -> seg == SSG_SET)
X				{
X					pevalexpr(0, $3);
X					if(evalr[0].seg == SSG_ABS)
X					{
X						$1 -> seg = SSG_SET;
X						$1 -> value = evalr[0].value;
X						prtequvalue("C: 0x%lx\n",
X							evalr[0].value);
X					}
X					else
X					{
X						fraerror(
X					"noncomputable expression for SET");
X					}
X				}
X				else
X				{
X					fraerror(
X				"cannot change symbol value with SET");
X				}
X			}
X	|	KOC_IF expr 
X			{
X		if((++ifstkpt) < IFSTKDEPTH)
X		{
X			pevalexpr(0, $2);
X			if(evalr[0].seg == SSG_ABS)
X			{
X				if(evalr[0].value != 0)
X				{
X					elseifstk[ifstkpt] = If_Skip;
X					endifstk[ifstkpt] = If_Active;
X				}
X				else
X				{
X					fraifskip = TRUE;
X					elseifstk[ifstkpt] = If_Active;
X					endifstk[ifstkpt] = If_Active;
X				}
X			}
X			else
X			{
X				fraifskip = TRUE;
X				elseifstk[ifstkpt] = If_Active;
X				endifstk[ifstkpt] = If_Active;
X			}
X		}
X		else
X		{
X			fraerror("IF stack overflow");
X		}
X			}
X						
X	|	KOC_IF 
X			{
X		if(fraifskip) 
X		{
X			if((++ifstkpt) < IFSTKDEPTH)
X			{
X					elseifstk[ifstkpt] = If_Skip;
X					endifstk[ifstkpt] = If_Skip;
X			}
X			else
X			{
X				fraerror("IF stack overflow");
X			}
X		}
X		else
X		{
X			yyerror("syntax error");
X			YYERROR;
X		}
X				}
X						
X	|	KOC_ELSE 
X			{
X				switch(elseifstk[ifstkpt])
X				{
X				case If_Active:
X					fraifskip = FALSE;
X					break;
X				
X				case If_Skip:
X					fraifskip = TRUE;
X					break;
X				
X				case If_Err:
X					fraerror("ELSE with no matching if");
X					break;
X				}
X			}
X
X	|	KOC_ENDI 
X			{
X				switch(endifstk[ifstkpt])
X				{
X				case If_Active:
X					fraifskip = FALSE;
X					ifstkpt--;
X					break;
X				
X				case If_Skip:
X					fraifskip = TRUE;
X					ifstkpt--;
X					break;
X				
X				case If_Err:
X					fraerror("ENDI with no matching if");
X					break;
X				}
X			}
X	|	LABEL KOC_ORG expr 
X			{
X				pevalexpr(0, $3);
X				if(evalr[0].seg == SSG_ABS)
X				{
X					locctr = labelloc = evalr[0].value;
X					if($1 -> seg == SSG_UNDEF)
X					{
X						$1 -> seg = SSG_ABS;
X						$1 -> value = labelloc;
X					}
X					else
X						fraerror(
X						"multiple definition of label");
X					prtequvalue("C: 0x%lx\n",
X						evalr[0].value);
X				}
X				else
X				{
X					fraerror(
X					 "noncomputable expression for ORG");
X				}
X			}
X	|	      KOC_ORG expr 
X			{
X				pevalexpr(0, $2);
X				if(evalr[0].seg == SSG_ABS)
X				{
X					locctr = labelloc = evalr[0].value;
X					prtequvalue("C: 0x%lx\n",
X						evalr[0].value);
X				}
X				else
X				{
X					fraerror(
X					 "noncomputable expression for ORG");
X				}
X			}
X	|	LABEL KOC_CHSET
X			{
X				if($1 -> seg == SSG_UNDEF)
X				{
X					$1 -> seg = SSG_EQU;
X					if( ($1->value = chtcreate()) <= 0)
X					{
X		fraerror( "cannot create character translation table");
X					}
X					prtequvalue("C: 0x%lx\n", $1 -> value);
X				}
X				else
X				{
X			fraerror( "multiple definition of label");
X				}
X			}
X	|		KOC_CHUSE
X			{
X				chtcpoint = (int *) NULL;
X				prtequvalue("C: 0x%lx\n", 0L);
X			}
X	|		KOC_CHUSE expr
X			{
X				pevalexpr(0, $2);
X				if( evalr[0].seg == SSG_ABS)
X				{
X					if( evalr[0].value == 0)
X					{
X						chtcpoint = (int *)NULL;
X						prtequvalue("C: 0x%lx\n", 0L);
X					}
X					else if(evalr[0].value < chtnxalph)
X					{
X				chtcpoint = chtatab[evalr[0].value];
X				prtequvalue("C: 0x%lx\n", evalr[0].value);
X					}
X					else
X					{
X			fraerror("nonexistent character translation table");
X					}
X				}
X				else
X				{
X					fraerror("noncomputable expression");
X				}
X			}
X	|		KOC_CHDEF STRING ',' exprlist
X			{
X		int findrv, numret, *charaddr;
X		char *sourcestr = $2, *before;
X
X		if(chtnpoint != (int *)NULL)
X		{
X			for(satsub = 0; satsub < $4; satsub++)
X			{
X				before = sourcestr;
X
X				pevalexpr(0, exprlist[satsub]);
X				findrv = chtcfind(chtnpoint, &sourcestr,
X						&charaddr, &numret);
X				if(findrv == CF_END)
X				{
X			fraerror("more expressions than characters");
X					break;
X				}
X
X				if(evalr[0].seg == SSG_ABS)
X				{
X					switch(findrv)
X					{
X					case CF_UNDEF:
X						{
X				if(evalr[0].value < 0 ||
X					evalr[0].value > 255)
X				{
X			frawarn("character translation value truncated");
X				}
X				*charaddr = evalr[0].value & 0xff;
X				prtequvalue("C: 0x%lx\n", evalr[0].value);
X						}
X						break;
X
X					case CF_INVALID:
X					case CF_NUMBER:
X				fracherror("invalid character to define", 
X					before, sourcestr);
X						break;
X
X					case CF_CHAR:
X				fracherror("character already defined", 
X					before, sourcestr);
X						break;
X					}
X				}
X				else
X				{
X					fraerror("noncomputable expression");
X				}
X			}
X
X			if( *sourcestr != '\0')
X			{
X				fraerror("more characters than expressions");
X			}
X		}
X		else
X		{
X			fraerror("no CHARSET statement active");
X		}
X			
X			}
X	|	LABEL 
X			{
X			if($1 -> seg == SSG_UNDEF)
X			{
X				$1 -> seg = SSG_ABS;
X				$1 -> value = labelloc;
X				prtequvalue("C: 0x%lx\n", labelloc);
X
X			}
X			else
X				fraerror(
X				"multiple definition of label");
X			}
X	|	labeledline
X	;
X
Xlabeledline :	LABEL genline
X			{
X			if($1 -> seg == SSG_UNDEF)
X			{
X				$1 -> seg = SSG_ABS;
X				$1 -> value = labelloc;
X			}
X			else
X				fraerror(
X				"multiple definition of label");
X			labelloc = locctr;
X			}
X				
X	|	genline
X			{
X				labelloc = locctr;
X			}
X	;
X
Xgenline	:	KOC_BDEF	exprlist 
X			{
X				genlocrec(currseg, labelloc);
X				for( satsub = 0; satsub < $2; satsub++)
X				{
X					pevalexpr(1, exprlist[satsub]);
X					locctr += geninstr(genbdef);
X				}
X			}
X	|	KOC_SDEF stringlist 
X			{
X				genlocrec(currseg, labelloc);
X				for(satsub = 0; satsub < $2; satsub++)
X				{
X					locctr += genstring(stringlist[satsub]);
X				}
X			}
X	|	KOC_WDEF exprlist 
X			{
X				genlocrec(currseg, labelloc);
X				for( satsub = 0; satsub < $2; satsub++)
X				{
X					pevalexpr(1, exprlist[satsub]);
X					locctr += geninstr(genwdef);
X				}
X			}	
X	|	KOC_RESM expr 
X			{
X				pevalexpr(0, $2);
X				if(evalr[0].seg == SSG_ABS)
X				{
X					locctr = labelloc + evalr[0].value;
X					prtequvalue("C: 0x%lx\n", labelloc);
X				}
X				else
X				{
X					fraerror(
X				 "noncomputable result for RMB expression");
X				}
X			}
X	;
X
Xexprlist :	exprlist ',' expr
X			{
X				exprlist[nextexprs ++ ] = $3;
X				$$ = nextexprs;
X			}
X	|	expr
X			{
X				nextexprs = 0;
X				exprlist[nextexprs ++ ] = $1;
X				$$ = nextexprs;
X			}
X	;
X
Xstringlist :	stringlist ',' STRING
X			{
X				stringlist[nextstrs ++ ] = $3;
X				$$ = nextstrs;
X			}
X	|	STRING
X			{
X				nextstrs = 0;
X				stringlist[nextstrs ++ ] = $1;
X				$$ = nextstrs;
X			}
X	;
X
X
Xgenline :	KOC_ACON exprlist
X		{
X			genlocrec(currseg, labelloc);
X			for( satsub = 0; satsub < $2; satsub++)
X			{
X				pevalexpr(1, exprlist[satsub]);
X				locctr += geninstr("[1=].fIx");
X			}
X		}	
Xgenline : KOC_opcode 
X		{
X		genlocrec(currseg, labelloc);
X		prevpage = (locctr & PAGEBITS);
X		if(prevpage == locctr)
X			frawarn("Page Boundary");
X		locctr += geninstr(findgen($1, ST_INH, 0));
X		}
X	;
Xgenline : KOC_opcode  expr
X		{
X		genlocrec(currseg, labelloc);
X		prevpage = (locctr & PAGEBITS);
X		if(prevpage == locctr)
X			frawarn("Page Boundary");
X		pevalexpr(1, $2);
X		locctr += geninstr(findgen($1, ST_EXP, 0));
X		if(((locctr -1) & PAGEBITS) != prevpage)
X			fraerror("instruction crosses page boundry");
X		}
X	;
Xgenline : KOC_opcode  '*' expr 
X		{
X		genlocrec(currseg, labelloc);
X		prevpage = (locctr & PAGEBITS);
X		if(prevpage == locctr)
X			frawarn("Page Boundary");
X		pevalexpr(1, $3);
X		locctr += geninstr(findgen($1, ST_INDIR, 0));
X		if(((locctr -1) & PAGEBITS) != prevpage)
X			fraerror("instruction crosses page boundry");
X		}
X	;
Xgenline : KOC_opcode  REGISTER
X		{
X		genlocrec(currseg, labelloc);
X		prevpage = (locctr & PAGEBITS);
X		if(prevpage == locctr)
X			frawarn("Page Boundary");
X		evalr[1].value = $2;
X		locctr += geninstr(findgen($1, ST_REG, regsel[$2] ));
X		}
X	;
Xgenline : KOC_opcode  ',' REGISTER
X		{
X		genlocrec(currseg, labelloc);
X		prevpage = (locctr & PAGEBITS);
X		if(prevpage == locctr)
X			frawarn("Page Boundary");
X		evalr[1].value = $3;
X		locctr += geninstr(findgen($1, ST_REGCOMMA, regsel[$3] ));
X		}
X	;
Xgenline : KOC_opcode  ',' REGISTER expr
X		{
X		genlocrec(currseg, labelloc);
X		prevpage = (locctr & PAGEBITS);
X		if(prevpage == locctr)
X			frawarn("Page Boundary");
X		evalr[1].value = $3;
X		pevalexpr(2, $4);
X		locctr += geninstr(findgen($1, ST_REGEXP, regsel[$3] ));
X		if(((locctr -1) & PAGEBITS) != prevpage)
X			fraerror("instruction crosses page boundry");
X		}
X	;
Xgenline : KOC_opcode  ',' REGISTER '*' expr 
X		{
X		genlocrec(currseg, labelloc);
X		prevpage = (locctr & PAGEBITS);
X		if(prevpage == locctr)
X			frawarn("Page Boundary");
X		evalr[1].value = $3;
X		pevalexpr(2, $5);
X		locctr += geninstr(findgen($1, ST_REGINDIR, regsel[$3] ));
X		if(((locctr -1) & PAGEBITS) != prevpage)
X			fraerror("instruction crosses page boundry");
X		}
X	;
Xgenline : KOC_opcode  ',' CONDITION
X		{
X		genlocrec(currseg, labelloc);
X		prevpage = (locctr & PAGEBITS);
X		if(prevpage == locctr)
X			frawarn("Page Boundary");
X		evalr[1].value = $3;
X		locctr += geninstr(findgen($1, ST_COND, condsel[$3] ));
X		}
X	;
Xgenline : KOC_opcode  ',' CONDITION expr
X		{
X		genlocrec(currseg, labelloc);
X		prevpage = (locctr & PAGEBITS);
X		if(prevpage == locctr)
X			frawarn("Page Boundary");
X		evalr[1].value = $3;
X		pevalexpr(2, $4);
X		locctr += geninstr(findgen($1, ST_CONDEXP, condsel[$3] ));
X		if(((locctr -1) & PAGEBITS) != prevpage)
X			fraerror("instruction crosses page boundry");
X		}
X	;
Xgenline : KOC_opcode  ',' CONDITION '*' expr 
X		{
X		genlocrec(currseg, labelloc);
X		prevpage = (locctr & PAGEBITS);
X		if(prevpage == locctr)
X			frawarn("Page Boundary");
X		evalr[1].value = $3;
X		pevalexpr(2, $5);
X		locctr += geninstr(findgen($1, ST_CONDINDIR, condsel[$3] ));
X		if(((locctr -1) & PAGEBITS) != prevpage)
X			fraerror("instruction crosses page boundry");
X		}
X	;
Xgenline : KOC_opcode  expr ',' REGISTER
X		{
X		genlocrec(currseg, labelloc);
X		prevpage = (locctr & PAGEBITS);
X		if(prevpage == locctr)
X			frawarn("Page Boundary");
X		evalr[1].value = $4;
X		pevalexpr(2, $2);
X		locctr += geninstr(findgen($1, ST_BINDEX, regsel[$4] ));
X		if(((locctr -1) & PAGEBITS) != prevpage)
X			fraerror("instruction crosses page boundry");
X		}
X	;
Xgenline : KOC_opcode  '*' expr ',' REGISTER
X		{
X		genlocrec(currseg, labelloc);
X		prevpage = (locctr & PAGEBITS);
X		if(prevpage == locctr)
X			frawarn("Page Boundary");
X		evalr[1].value = $5;
X		pevalexpr(2, $3);
X		locctr += geninstr(findgen($1, ST_BINDIRX, regsel[$5] ));
X		if(((locctr -1) & PAGEBITS) != prevpage)
X			fraerror("instruction crosses page boundry");
X		}
X	;
Xgenline : KOC_indexabs  ',' REGISTER  expr
X		{
X		genlocrec(currseg, labelloc);
X		prevpage = (locctr & PAGEBITS);
X		if(prevpage == locctr)
X			frawarn("Page Boundary");
X		evalr[1].value = $3;
X		pevalexpr(2, $4);
X		evalr[3].value = API_ABS;
X		locctr += geninstr(findgen($1, ST_ABSOLUTE, regsel[$3] ));
X		if(((locctr -1) & PAGEBITS) != prevpage)
X			fraerror("instruction crosses page boundry");
X		}
X	;
Xgenline : KOC_indexabs  ',' REGISTER expr ',' REGISTER
X		{
X		genlocrec(currseg, labelloc);
X		prevpage = (locctr & PAGEBITS);
X		if(prevpage == locctr)
X			frawarn("Page Boundary");
X		if($3 != 0)
X			fraerror("destination register must be R0");
X		evalr[1].value = $6;
X		pevalexpr(2, $4);
X		evalr[3].value = API_IND;
X		locctr += geninstr(findgen($1, ST_ABSOLUTE, regsel[$6] ));
X		if(((locctr -1) & PAGEBITS) != prevpage)
X			fraerror("instruction crosses page boundry");
X		}
X	;
Xgenline : KOC_indexabs  ',' REGISTER expr ',' REGISTER ',' '+'
X		{
X		genlocrec(currseg, labelloc);
X		prevpage = (locctr & PAGEBITS);
X		if(prevpage == locctr)
X			frawarn("Page Boundary");
X		if($3 != 0)
X			fraerror("destination register must be R0");
X		evalr[1].value = $6;
X		pevalexpr(2, $4);
X		evalr[3].value = API_INC;
X		locctr += geninstr(findgen($1, ST_ABSOLUTE, regsel[$6] ));
X		if(((locctr -1) & PAGEBITS) != prevpage)
X			fraerror("instruction crosses page boundry");
X		}
X	;
Xgenline : KOC_indexabs  ',' REGISTER expr ',' REGISTER ',' '-' 
X		{
X		genlocrec(currseg, labelloc);
X		prevpage = (locctr & PAGEBITS);
X		if(prevpage == locctr)
X			frawarn("Page Boundary");
X		if($3 != 0)
X			fraerror("destination register must be R0");
X		evalr[1].value = $6;
X		pevalexpr(2, $4);
X		evalr[3].value = API_DEC;
X		locctr += geninstr(findgen($1, ST_ABSOLUTE, regsel[$6] ));
X		if(((locctr -1) & PAGEBITS) != prevpage)
X			fraerror("instruction crosses page boundry");
X		}
X	;
Xgenline : KOC_indexabs  ',' REGISTER '*' expr 
X		{
X		genlocrec(currseg, labelloc);
X		prevpage = (locctr & PAGEBITS);
X		if(prevpage == locctr)
X			frawarn("Page Boundary");
X		evalr[1].value = $3;
X		pevalexpr(2, $5);
X		evalr[3].value = API_IABS;
X		locctr += geninstr(findgen($1, ST_ABSOLUTE, regsel[$3] ));
X		if(((locctr -1) & PAGEBITS) != prevpage)
X			fraerror("instruction crosses page boundry");
X		}
X	;
Xgenline : KOC_indexabs  ',' REGISTER '*' expr ',' REGISTER
X		{
X		genlocrec(currseg, labelloc);
X		prevpage = (locctr & PAGEBITS);
X		if(prevpage == locctr)
X			frawarn("Page Boundary");
X		if($3 != 0)
X			fraerror("destination register must be R0");
X		evalr[1].value = $7;
X		pevalexpr(2, $5);
X		evalr[3].value = API_IIND;
X		locctr += geninstr(findgen($1, ST_ABSOLUTE, regsel[$7] ));
X		if(((locctr -1) & PAGEBITS) != prevpage)
X			fraerror("instruction crosses page boundry");
X		}
X	;
Xgenline : KOC_indexabs  ',' REGISTER '*' expr ',' REGISTER ',' '+' 
X		{
X		genlocrec(currseg, labelloc);
X		prevpage = (locctr & PAGEBITS);
X		if(prevpage == locctr)
X			frawarn("Page Boundary");
X		if($3 != 0)
X			fraerror("destination register must be R0");
X		evalr[1].value = $7;
X		pevalexpr(2, $5);
X		evalr[3].value = API_IINC;
X		locctr += geninstr(findgen($1, ST_ABSOLUTE, regsel[$7] ));
X		if(((locctr -1) & PAGEBITS) != prevpage)
X			fraerror("instruction crosses page boundry");
X		}
X	;
Xgenline : KOC_indexabs  ',' REGISTER '*' expr ',' REGISTER ',' '-' 
X		{
X		genlocrec(currseg, labelloc);
X		prevpage = (locctr & PAGEBITS);
X		if(prevpage == locctr)
X			frawarn("Page Boundary");
X		if($3 != 0)
X			fraerror("destination register must be R0");
X		evalr[1].value = $7;
X		pevalexpr(2, $5);
X		evalr[3].value = API_IDEC;
X		locctr += geninstr(findgen($1, ST_ABSOLUTE, regsel[$7] ));
X		if(((locctr -1) & PAGEBITS) != prevpage)
X			fraerror("instruction crosses page boundry");
X		}
X	;
Xexpr	:	'+' expr %prec KEOP_MUN
X			{
X				$$ = $2;
X			}
X	|	'-' expr %prec KEOP_MUN
X			{
X				$$ = exprnode(PCCASE_UN,$2,IFC_NEG,0,0L,
X					SYMNULL);
X			}
X	|	KEOP_NOT expr
X			{
X				$$ = exprnode(PCCASE_UN,$2,IFC_NOT,0,0L,
X					SYMNULL);
X			}
X	|	KEOP_HIGH expr
X			{
X				$$ = exprnode(PCCASE_UN,$2,IFC_HIGH,0,0L,
X					SYMNULL);
X			}
X	|	KEOP_LOW expr
X			{
X				$$ = exprnode(PCCASE_UN,$2,IFC_LOW,0,0L,
X					SYMNULL);
X			}
X	|	expr '*' expr
X			{
X				$$ = exprnode(PCCASE_BIN,$1,IFC_MUL,$3,0L,
X					SYMNULL);
X			}
X	|	expr '/' expr
X			{
X				$$ = exprnode(PCCASE_BIN,$1,IFC_DIV,$3,0L,
X					SYMNULL);
X			}
X	|	expr '+' expr
X			{
X				$$ = exprnode(PCCASE_BIN,$1,IFC_ADD,$3,0L,
X					SYMNULL);
X			}
X	|	expr '-' expr
X			{
X				$$ = exprnode(PCCASE_BIN,$1,IFC_SUB,$3,0L,
X					SYMNULL);
X			}
X	|	expr KEOP_MOD expr
X			{
X				$$ = exprnode(PCCASE_BIN,$1,IFC_MOD,$3,0L,
X					SYMNULL);
X			}
X	|	expr KEOP_SHL expr
X			{
X				$$ = exprnode(PCCASE_BIN,$1,IFC_SHL,$3,0L,
X					SYMNULL);
X			}
X	|	expr KEOP_SHR expr
X			{
X				$$ = exprnode(PCCASE_BIN,$1,IFC_SHR,$3,0L,
X					SYMNULL);
X			}
X	|	expr KEOP_GT expr
X			{
X				$$ = exprnode(PCCASE_BIN,$1,IFC_GT,$3,0L,
X					SYMNULL);
X			}
X	|	expr KEOP_GE expr
X			{
X				$$ = exprnode(PCCASE_BIN,$1,IFC_GE,$3,0L,
X					SYMNULL);
X			}
X	|	expr KEOP_LT expr
X			{
X				$$ = exprnode(PCCASE_BIN,$1,IFC_LT,$3,0L,
X					SYMNULL);
X			}
X	|	expr KEOP_LE expr
X			{
X				$$ = exprnode(PCCASE_BIN,$1,IFC_LE,$3,0L,
X					SYMNULL);
X			}
X	|	expr KEOP_NE expr
X			{
X				$$ = exprnode(PCCASE_BIN,$1,IFC_NE,$3,0L,
X					SYMNULL);
X			}
X	|	expr KEOP_EQ expr
X			{
X				$$ = exprnode(PCCASE_BIN,$1,IFC_EQ,$3,0L,
X					SYMNULL);
X			}
X	|	expr KEOP_AND expr
X			{
X				$$ = exprnode(PCCASE_BIN,$1,IFC_AND,$3,0L,
X					SYMNULL);
X			}
X	|	expr KEOP_OR expr
X			{
X				$$ = exprnode(PCCASE_BIN,$1,IFC_OR,$3,0L,
X					SYMNULL);
X			}
X	|	expr KEOP_XOR expr
X			{
X				$$ = exprnode(PCCASE_BIN,$1,IFC_XOR,$3,0L,
X					SYMNULL);
X			}
X	|	KEOP_DEFINED SYMBOL
X			{
X				$$ = exprnode(PCCASE_DEF,0,IGP_DEFINED,0,0L,$2);
X			}
X	|	SYMBOL
X			{
X				$$ = exprnode(PCCASE_SYMB,0,IFC_SYMB,0,0L,$1);
X			}
X	|	'$'
X			{
X				$$ = exprnode(PCCASE_PROGC,0,IFC_PROGCTR,0,
X					labelloc, SYMNULL);
X			}
X	|	CONSTANT
X			{
X				$$ = exprnode(PCCASE_CONS,0,IGP_CONSTANT,0,$1,
X					SYMNULL);
X			}
X	|	STRING
X			{
X				char *sourcestr = $1;
X				long accval = 0;
X
X				if(strlen($1) > 0)
X				{
X					accval = chtran(&sourcestr);
X					if(*sourcestr != '\0')
X					{
X						accval = (accval << 8) +
X							chtran(&sourcestr);
X					}
X
X					if( *sourcestr != '\0')
X					{
X	frawarn("string constant in expression more than 2 characters long");
X					}
X				}
X				$$ = exprnode(PCCASE_CONS, 0, IGP_CONSTANT, 0,
X					accval, SYMNULL);
X			}
X	|	'(' expr ')'
X			{
X				$$ = $2;
X			}
X	;
X
X
X
X%%
X
Xlexintercept()
X/*
X	description	intercept the call to yylex (the lexical analyzer)
X			and filter out all unnecessary tokens when skipping
X			the input between a failed IF and its matching ENDI or
X			ELSE
X	globals 	fraifskip	the enable flag
X*/
X{
X#undef yylex
X
X	int rv;
X
X	if(fraifskip)
X	{
X		for(;;)
X		{
X
X			switch(rv = yylex())
X
X			{
X			case 0:
X			case KOC_END:
X			case KOC_IF:
X			case KOC_ELSE:
X			case KOC_ENDI:
X			case EOL:
X				return rv;
X			default:
X				break;
X			}
X		}
X	}
X	else
X		return yylex();
X#define yylex lexintercept
X}
X
X
X
Xsetreserved()
X{
X
X	reservedsym("and", KEOP_AND, 0);
X	reservedsym("defined", KEOP_DEFINED,0);
X	reservedsym("ge", KEOP_GE, 0);
X	reservedsym("high", KEOP_HIGH, 0);
X	reservedsym("le", KEOP_LE, 0);
X	reservedsym("low", KEOP_LOW, 0);
X	reservedsym("mod", KEOP_MOD, 0);
X	reservedsym("ne", KEOP_NE, 0);
X	reservedsym("not", KEOP_NOT, 0);
X	reservedsym("or", KEOP_OR, 0);
X	reservedsym("shl", KEOP_SHL, 0);
X	reservedsym("shr", KEOP_SHR, 0);
X	reservedsym("xor", KEOP_XOR, 0);
X	reservedsym("AND", KEOP_AND, 0);
X	reservedsym("DEFINED", KEOP_DEFINED,0);
X	reservedsym("GE", KEOP_GE, 0);
X	reservedsym("HIGH", KEOP_HIGH, 0);
X	reservedsym("LE", KEOP_LE, 0);
X	reservedsym("LOW", KEOP_LOW, 0);
X	reservedsym("MOD", KEOP_MOD, 0);
X	reservedsym("NE", KEOP_NE, 0);
X	reservedsym("NOT", KEOP_NOT, 0);
X	reservedsym("OR", KEOP_OR, 0);
X	reservedsym("SHL", KEOP_SHL, 0);
X	reservedsym("SHR", KEOP_SHR, 0);
X	reservedsym("XOR", KEOP_XOR, 0);
X
X	/* machine specific token definitions */
X	reservedsym("r0", REGISTER, 0);
X	reservedsym("r1", REGISTER, 1);
X	reservedsym("r2", REGISTER, 2);
X	reservedsym("r3", REGISTER, 3);
X	reservedsym("R0", REGISTER, 0);
X	reservedsym("R1", REGISTER, 1);
X	reservedsym("R2", REGISTER, 2);
X	reservedsym("R3", REGISTER, 3);
X	reservedsym("PLUS", CONDITION, 1);
X	reservedsym("ZERO", CONDITION, 0); 
X	reservedsym("MINUS", CONDITION, 2);
X	reservedsym("GT", CONDITION, 1);
X	reservedsym("EQ", CONDITION, 0); 
X	reservedsym("LT", CONDITION, 2);
X	reservedsym("UN", CONDITION, 3);
X	reservedsym("ALWAYS", CONDITION, 3);
X	reservedsym("plus", CONDITION, 1);
X	reservedsym("zero", CONDITION, 0); 
X	reservedsym("minus", CONDITION, 2);
X	reservedsym("gt", CONDITION, 1);
X	reservedsym("eq", CONDITION, 0); 
X	reservedsym("lt", CONDITION, 2);
X	reservedsym("un", CONDITION, 3);
X	reservedsym("always", CONDITION, 3);
X
X}
X
Xcpumatch(str)
X	char *str;
X{
X	return TRUE;
X}
X
X
X/*
X	description	Opcode and Instruction generation tables
X	usage		Unix, framework crossassembler
X	history		September 25, 1987
X*/
X
X#define NUMOPCODE 102
X#define NUMSYNBLK 105
X#define NUMDIFFOP 128
X
Xint gnumopcode = NUMOPCODE;
X
Xint ophashlnk[NUMOPCODE];
X
Xstruct opsym optab[NUMOPCODE+1]
X	= {
X	{"invalid", KOC_opcode, 2, 0 },
X	{"ACON", KOC_ACON, 0, 0 },
X	{"ADDA", KOC_indexabs, 1, 2 },
X	{"ADDI", KOC_opcode, 1, 3 },
X	{"ADDR", KOC_opcode, 2, 4 },
X	{"ADDZ", KOC_opcode, 1, 6 },
X	{"ANDA", KOC_indexabs, 1, 7 },
X	{"ANDI", KOC_opcode, 1, 8 },
X	{"ANDR", KOC_opcode, 2, 9 },
X	{"ANDZ", KOC_opcode, 1, 11 },
X	{"BCFA", KOC_opcode, 2, 12 },
X	{"BCFR", KOC_opcode, 2, 14 },
X	{"BCTA", KOC_opcode, 2, 16 },
X	{"BCTR", KOC_opcode, 2, 18 },
X	{"BDRA", KOC_opcode, 2, 20 },
X	{"BDRR", KOC_opcode, 2, 22 },
X	{"BIRA", KOC_opcode, 2, 24 },
X	{"BIRR", KOC_opcode, 2, 26 },
X	{"BRNA", KOC_opcode, 2, 28 },
X	{"BRNR", KOC_opcode, 2, 30 },
X	{"BSFA", KOC_opcode, 2, 32 },
X	{"BSFR", KOC_opcode, 2, 34 },
X	{"BSNA", KOC_opcode, 2, 36 },
X	{"BSNR", KOC_opcode, 2, 38 },
X	{"BSTA", KOC_opcode, 2, 40 },
X	{"BSTR", KOC_opcode, 2, 42 },
X	{"BSXA", KOC_opcode, 2, 44 },
X	{"BXA", KOC_opcode, 2, 46 },
X	{"BYTE", KOC_BDEF, 0, 0 },
X	{"CHARDEF", KOC_CHDEF, 0, 0 },
X	{"CHARSET", KOC_CHSET, 0, 0 },
X	{"CHARUSE", KOC_CHUSE, 0, 0 },
X	{"CHD", KOC_CHDEF, 0, 0 },
X	{"COMA", KOC_indexabs, 1, 48 },
X	{"COMI", KOC_opcode, 1, 49 },
X	{"COMR", KOC_opcode, 2, 50 },
X	{"COMZ", KOC_opcode, 1, 52 },
X	{"CPSL", KOC_opcode, 1, 53 },
X	{"CPSU", KOC_opcode, 1, 54 },
X	{"DAR", KOC_opcode, 1, 55 },
X	{"DATA", KOC_BDEF, 0, 0 },
X	{"DB", KOC_BDEF, 0, 0 },
X	{"DW", KOC_WDEF, 0, 0 },
X	{"ELSE", KOC_ELSE, 0, 0 },
X	{"END", KOC_END, 0, 0 },
X	{"ENDI", KOC_ENDI, 0, 0 },
X	{"EORA", KOC_indexabs, 1, 56 },
X	{"EORI", KOC_opcode, 1, 57 },
X	{"EORR", KOC_opcode, 2, 58 },
X	{"EORZ", KOC_opcode, 1, 60 },
X	{"EQU", KOC_EQU, 0, 0 },
X	{"FCB", KOC_BDEF, 0, 0 },
X	{"FCC", KOC_SDEF, 0, 0 },
X	{"FDB", KOC_WDEF, 0, 0 },
X	{"HALT", KOC_opcode, 1, 61 },
X	{"IF", KOC_IF, 0, 0 },
X	{"INCL", KOC_INCLUDE, 0, 0 },
X	{"INCLUDE", KOC_INCLUDE, 0, 0 },
X	{"IORA", KOC_indexabs, 1, 62 },
X	{"IORI", KOC_opcode, 1, 63 },
X	{"IORR", KOC_opcode, 2, 64 },
X	{"IORZ", KOC_opcode, 1, 66 },
X	{"LODA", KOC_indexabs, 1, 67 },
X	{"LODI", KOC_opcode, 1, 68 },
X	{"LODR", KOC_opcode, 2, 69 },
X	{"LODZ", KOC_opcode, 1, 71 },
X	{"LPSL", KOC_opcode, 1, 72 },
X	{"LPSU", KOC_opcode, 1, 73 },
X	{"NOP", KOC_opcode, 1, 74 },
X	{"ORG", KOC_ORG, 0, 0 },
X	{"PPSL", KOC_opcode, 1, 75 },
X	{"PPSU", KOC_opcode, 1, 76 },
X	{"REDC", KOC_opcode, 1, 77 },
X	{"REDD", KOC_opcode, 1, 78 },
X	{"REDE", KOC_opcode, 1, 79 },
X	{"RES", KOC_RESM, 0, 0 },
X	{"RESERVE", KOC_RESM, 0, 0 },
X	{"RETC", KOC_opcode, 1, 80 },
X	{"RETE", KOC_opcode, 1, 81 },
X	{"RMB", KOC_RESM, 0, 0 },
X	{"RRL", KOC_opcode, 1, 82 },
X	{"RRR", KOC_opcode, 1, 83 },
X	{"SET", KOC_SET, 0, 0 },
X	{"SPSL", KOC_opcode, 1, 84 },
X	{"SPSU", KOC_opcode, 1, 85 },
X	{"STRA", KOC_indexabs, 1, 86 },
X	{"STRING", KOC_SDEF, 0, 0 },
X	{"STRR", KOC_opcode, 2, 87 },
X	{"STRZ", KOC_opcode, 1, 89 },
X	{"SUBA", KOC_indexabs, 1, 90 },
X	{"SUBI", KOC_opcode, 1, 91 },
X	{"SUBR", KOC_opcode, 2, 92 },
X	{"SUBZ", KOC_opcode, 1, 94 },
X	{"TMI", KOC_opcode, 1, 95 },
X	{"TPSL", KOC_opcode, 1, 96 },
X	{"TPSU", KOC_opcode, 1, 97 },
X	{"WORD", KOC_WDEF, 0, 0 },
X	{"WRTC", KOC_opcode, 1, 98 },
X	{"WRTD", KOC_opcode, 1, 99 },
X	{"WRTE", KOC_opcode, 1, 100 },
X	{"ZBRR", KOC_opcode, 2, 101 },
X	{"ZBSR", KOC_opcode, 2, 103 },
X	{ "", 0, 0, 0 }};
X
Xstruct opsynt ostab[NUMSYNBLK+1]
X	= {
X/* invalid 0 */ { 0, 1, 0 },
X/* invalid 1 */ { 0xffff, 1, 1 },
X/* ADDA 2 */ { ST_ABSOLUTE, 1, 2 },
X/* ADDI 3 */ { ST_REGEXP, 1, 3 },
X/* ADDR 4 */ { ST_REGEXP, 1, 4 },
X/* ADDR 5 */ { ST_REGINDIR, 1, 5 },
X/* ADDZ 6 */ { ST_REG, 1, 6 },
X/* ANDA 7 */ { ST_ABSOLUTE, 1, 7 },
X/* ANDI 8 */ { ST_REGEXP, 1, 8 },
X/* ANDR 9 */ { ST_REGEXP, 1, 9 },
X/* ANDR 10 */ { ST_REGINDIR, 1, 10 },
X/* ANDZ 11 */ { ST_REG, 3, 11 },
X/* BCFA 12 */ { ST_CONDEXP, 3, 14 },
X/* BCFA 13 */ { ST_CONDINDIR, 3, 17 },
X/* BCFR 14 */ { ST_CONDEXP, 3, 20 },
X/* BCFR 15 */ { ST_CONDINDIR, 3, 23 },
X/* BCTA 16 */ { ST_CONDEXP, 1, 26 },
X/* BCTA 17 */ { ST_CONDINDIR, 1, 27 },
X/* BCTR 18 */ { ST_CONDEXP, 1, 28 },
X/* BCTR 19 */ { ST_CONDINDIR, 1, 29 },
X/* BDRA 20 */ { ST_REGEXP, 1, 30 },
X/* BDRA 21 */ { ST_REGINDIR, 1, 31 },
X/* BDRR 22 */ { ST_REGEXP, 1, 32 },
X/* BDRR 23 */ { ST_REGINDIR, 1, 33 },
X/* BIRA 24 */ { ST_REGEXP, 1, 34 },
X/* BIRA 25 */ { ST_REGINDIR, 1, 35 },
X/* BIRR 26 */ { ST_REGEXP, 1, 36 },
X/* BIRR 27 */ { ST_REGINDIR, 1, 37 },
X/* BRNA 28 */ { ST_REGEXP, 1, 38 },
X/* BRNA 29 */ { ST_REGINDIR, 1, 39 },
X/* BRNR 30 */ { ST_REGEXP, 1, 40 },
X/* BRNR 31 */ { ST_REGINDIR, 1, 41 },
X/* BSFA 32 */ { ST_CONDEXP, 3, 42 },
X/* BSFA 33 */ { ST_CONDINDIR, 3, 45 },
X/* BSFR 34 */ { ST_CONDEXP, 3, 48 },
X/* BSFR 35 */ { ST_CONDINDIR, 3, 51 },
X/* BSNA 36 */ { ST_REGEXP, 1, 54 },
X/* BSNA 37 */ { ST_REGINDIR, 1, 55 },
X/* BSNR 38 */ { ST_REGEXP, 1, 56 },
X/* BSNR 39 */ { ST_REGINDIR, 1, 57 },
X/* BSTA 40 */ { ST_CONDEXP, 1, 58 },
X/* BSTA 41 */ { ST_CONDINDIR, 1, 59 },
X/* BSTR 42 */ { ST_CONDEXP, 1, 60 },
X/* BSTR 43 */ { ST_CONDINDIR, 1, 61 },
X/* BSXA 44 */ { ST_BINDEX, 1, 62 },
X/* BSXA 45 */ { ST_BINDIRX, 1, 63 },
X/* BXA 46 */ { ST_BINDEX, 1, 64 },
X/* BXA 47 */ { ST_BINDIRX, 1, 65 },
X/* COMA 48 */ { ST_ABSOLUTE, 1, 66 },
X/* COMI 49 */ { ST_REGEXP, 1, 67 },
X/* COMR 50 */ { ST_REGEXP, 1, 68 },
X/* COMR 51 */ { ST_REGINDIR, 1, 69 },
X/* COMZ 52 */ { ST_REG, 1, 70 },
X/* CPSL 53 */ { ST_EXP, 1, 71 },
X/* CPSU 54 */ { ST_EXP, 1, 72 },
X/* DAR 55 */ { ST_REGCOMMA, 1, 73 },
X/* EORA 56 */ { ST_ABSOLUTE, 1, 74 },
X/* EORI 57 */ { ST_REGEXP, 1, 75 },
X/* EORR 58 */ { ST_REGEXP, 1, 76 },
X/* EORR 59 */ { ST_REGINDIR, 1, 77 },
X/* EORZ 60 */ { ST_REG, 1, 78 },
X/* HALT 61 */ { ST_INH, 1, 79 },
X/* IORA 62 */ { ST_ABSOLUTE, 1, 80 },
X/* IORI 63 */ { ST_REGEXP, 1, 81 },
X/* IORR 64 */ { ST_REGEXP, 1, 82 },
X/* IORR 65 */ { ST_REGINDIR, 1, 83 },
X/* IORZ 66 */ { ST_REG, 1, 84 },
X/* LODA 67 */ { ST_ABSOLUTE, 1, 85 },
X/* LODI 68 */ { ST_REGEXP, 1, 86 },
X/* LODR 69 */ { ST_REGEXP, 1, 87 },
X/* LODR 70 */ { ST_REGINDIR, 1, 88 },
X/* LODZ 71 */ { ST_REG, 4, 89 },
X/* LPSL 72 */ { ST_INH, 1, 93 },
X/* LPSU 73 */ { ST_INH, 1, 94 },
X/* NOP 74 */ { ST_INH, 1, 95 },
X/* PPSL 75 */ { ST_EXP, 1, 96 },
X/* PPSU 76 */ { ST_EXP, 1, 97 },
X/* REDC 77 */ { ST_REGCOMMA, 1, 98 },
X/* REDD 78 */ { ST_REGCOMMA, 1, 99 },
X/* REDE 79 */ { ST_REGEXP, 1, 100 },
X/* RETC 80 */ { ST_COND, 1, 101 },
X/* RETE 81 */ { ST_COND, 1, 102 },
X/* RRL 82 */ { ST_REGCOMMA, 1, 103 },
X/* RRR 83 */ { ST_REGCOMMA, 1, 104 },
X/* SPSL 84 */ { ST_INH, 1, 105 },
X/* SPSU 85 */ { ST_INH, 1, 106 },
X/* STRA 86 */ { ST_ABSOLUTE, 1, 107 },
X/* STRR 87 */ { ST_REGEXP, 1, 108 },
X/* STRR 88 */ { ST_REGINDIR, 1, 109 },
X/* STRZ 89 */ { ST_REG, 3, 110 },
X/* SUBA 90 */ { ST_ABSOLUTE, 1, 113 },
X/* SUBI 91 */ { ST_REGEXP, 1, 114 },
X/* SUBR 92 */ { ST_REGEXP, 1, 115 },
X/* SUBR 93 */ { ST_REGINDIR, 1, 116 },
X/* SUBZ 94 */ { ST_REG, 1, 117 },
X/* TMI 95 */ { ST_REGEXP, 1, 118 },
X/* TPSL 96 */ { ST_EXP, 1, 119 },
X/* TPSU 97 */ { ST_EXP, 1, 120 },
X/* WRTC 98 */ { ST_REGCOMMA, 1, 121 },
X/* WRTD 99 */ { ST_REGCOMMA, 1, 122 },
X/* WRTE 100 */ { ST_REGEXP, 1, 123 },
X/* ZBRR 101 */ { ST_EXP, 1, 124 },
X/* ZBRR 102 */ { ST_INDIR, 1, 125 },
X/* ZBSR 103 */ { ST_EXP, 1, 126 },
X/* ZBSR 104 */ { ST_INDIR, 1, 127 },
X	{ 0, 0, 0 } };
X
Xstruct igel igtab[NUMDIFFOP+1]
X	= {
X/* invalid 0 */   { 0 , 0, 
X		"[Xnullentry" },
X/* invalid 1 */   { 0 , 0, 
X		"[Xinvalid opcode" },
X/* ADDA 2 */   { 0 , 0, 
X		"8c.[1#]|;[2=].P.6000&-.dI.[3#]000|x" },
X/* ADDI 3 */   { 0 , 0, 
X		"84.[1#]|;[2=];" },
X/* ADDR 4 */   { 0 , 0, 
X		"88.[1#]|;[2=]~.P.6000&-.dIQ.1+-.7R;" },
X/* ADDR 5 */   { 0 , 0, 
X		"88.[1#]|;[2=]~.P.6000&-.dIQ.1+-.7R.80|;" },
X/* ADDZ 6 */   { 0 , 0, 
X		"80.[1#]|;" },
X/* ANDA 7 */   { 0 , 0, 
X		"4c.[1#]|;[2=].P.6000&-.dI.[3#]000|x" },
X/* ANDI 8 */   { 0 , 0, 
X		"44.[1#]|;[2=];" },
X/* ANDR 9 */   { 0 , 0, 
X		"48.[1#]|;[2=]~.P.6000&-.dIQ.1+-.7R;" },
X/* ANDR 10 */   { 0 , 0, 
X		"48.[1#]|;[2=]~.P.6000&-.dIQ.1+-.7R.80|;" },
X/* ANDZ 11 */   { REGMASK , REG1, 
X		"41;" },
X/* ANDZ 12 */   { REGMASK , REG2, 
X		"42;" },
X/* ANDZ 13 */   { REGMASK , REG3, 
X		"43;" },
X/* BCFA 14 */   { CONDMASK , COND0, 
X		"9c.[1#]|;[2=].fIx" },
X/* BCFA 15 */   { CONDMASK , COND1, 
X		"9c.[1#]|;[2=].fIx" },
X/* BCFA 16 */   { CONDMASK , COND2, 
X		"9c.[1#]|;[2=].fIx" },
X/* BCFA 17 */   { CONDMASK , COND0, 
X		"9c.[1#]|;[2=].fI.8000|x" },
X/* BCFA 18 */   { CONDMASK , COND1, 
X		"9c.[1#]|;[2=].fI.8000|x" },
X/* BCFA 19 */   { CONDMASK , COND2, 
X		"9c.[1#]|;[2=].fI.8000|x" },
X/* BCFR 20 */   { CONDMASK , COND0, 
X		"98.[1#]|;[2=]~.P.6000&-.dIQ.1+-.7R;" },
X/* BCFR 21 */   { CONDMASK , COND1, 
X		"98.[1#]|;[2=]~.P.6000&-.dIQ.1+-.7R;" },
X/* BCFR 22 */   { CONDMASK , COND2, 
X		"98.[1#]|;[2=]~.P.6000&-.dIQ.1+-.7R;" },
X/* BCFR 23 */   { CONDMASK , COND0, 
X		"98.[1#]|;[2=]~.P.6000&-.dIQ.1+-.7R.80|;" },
X/* BCFR 24 */   { CONDMASK , COND1, 
X		"98.[1#]|;[2=]~.P.6000&-.dIQ.1+-.7R.80|;" },
X/* BCFR 25 */   { CONDMASK , COND2, 
X		"98.[1#]|;[2=]~.P.6000&-.dIQ.1+-.7R.80|;" },
X/* BCTA 26 */   { 0 , 0, 
X		"1c.[1#]|;[2=].fIx" },
X/* BCTA 27 */   { 0 , 0, 
X		"1c.[1#]|;[2=].fI.8000|x" },
X/* BCTR 28 */   { 0 , 0, 
X		"18.[1#]|;[2=]~.P.6000&-.dIQ.1+-.7R;" },
X/* BCTR 29 */   { 0 , 0, 
X		"18.[1#]|;[2=]~.P.6000&-.dIQ.1+-.7R.80|;" },
X/* BDRA 30 */   { 0 , 0, 
X		"fc.[1#]|;[2=].fIx" },
X/* BDRA 31 */   { 0 , 0, 
X		"fc.[1#]|;[2=].fI.8000|x" },
X/* BDRR 32 */   { 0 , 0, 
X		"f8.[1#]|;[2=]~.P.6000&-.dIQ.1+-.7R;" },
X/* BDRR 33 */   { 0 , 0, 
X		"f8.[1#]|;[2=]~.P.6000&-.dIQ.1+-.7R.80|;" },
X/* BIRA 34 */   { 0 , 0, 
X		"dc.[1#]|;[2=].fIx" },
X/* BIRA 35 */   { 0 , 0, 
X		"dc.[1#]|;[2=].fI.8000|x" },
X/* BIRR 36 */   { 0 , 0, 
X		"d8.[1#]|;[2=]~.P.6000&-.dIQ.1+-.7R;" },
X/* BIRR 37 */   { 0 , 0, 
X		"d8.[1#]|;[2=]~.P.6000&-.dIQ.1+-.7R.80|;" },
X/* BRNA 38 */   { 0 , 0, 
X		"5c.[1#]|;[2=].fIx" },
X/* BRNA 39 */   { 0 , 0, 
X		"5c.[1#]|;[2=].fI.8000|x" },
X/* BRNR 40 */   { 0 , 0, 
X		"58.[1#]|;[2=]~.P.6000&-.dIQ.1+-.7R;" },
X/* BRNR 41 */   { 0 , 0, 
X		"58.[1#]|;[2=]~.P.6000&-.dIQ.1+-.7R.80|;" },
X/* BSFA 42 */   { CONDMASK , COND0, 
X		"bc.[1#]|;[2=].fIx" },
X/* BSFA 43 */   { CONDMASK , COND1, 
X		"bc.[1#]|;[2=].fIx" },
X/* BSFA 44 */   { CONDMASK , COND2, 
X		"bc.[1#]|;[2=].fIx" },
X/* BSFA 45 */   { CONDMASK , COND0, 
X		"bc.[1#]|;[2=].fI.8000|x" },
X/* BSFA 46 */   { CONDMASK , COND1, 
X		"bc.[1#]|;[2=].fI.8000|x" },
X/* BSFA 47 */   { CONDMASK , COND2, 
X		"bc.[1#]|;[2=].fI.8000|x" },
X/* BSFR 48 */   { CONDMASK , COND0, 
X		"b8.[1#]|;[2=]~.P.6000&-.dIQ.1+-.7R;" },
X/* BSFR 49 */   { CONDMASK , COND1, 
X		"b8.[1#]|;[2=]~.P.6000&-.dIQ.1+-.7R;" },
X/* BSFR 50 */   { CONDMASK , COND2, 
X		"b8.[1#]|;[2=]~.P.6000&-.dIQ.1+-.7R;" },
X/* BSFR 51 */   { CONDMASK , COND0, 
X		"b8.[1#]|;[2=]~.P.6000&-.dIQ.1+-.7R.80|;" },
X/* BSFR 52 */   { CONDMASK , COND1, 
X		"b8.[1#]|;[2=]~.P.6000&-.dIQ.1+-.7R.80|;" },
X/* BSFR 53 */   { CONDMASK , COND2, 
X		"b8.[1#]|;[2=]~.P.6000&-.dIQ.1+-.7R.80|;" },
X/* BSNA 54 */   { 0 , 0, 
X		"7c.[1#]|;[2=].fIx" },
X/* BSNA 55 */   { 0 , 0, 
X		"7c.[1#]|;[2=].fI.8000|x" },
X/* BSNR 56 */   { 0 , 0, 
X		"78.[1#]|;[2=]~.P.6000&-.dIQ.1+-.7R;" },
X/* BSNR 57 */   { 0 , 0, 
X		"78.[1#]|;[2=]~.P.6000&-.dIQ.1+-.7R.80|;" },
X/* BSTA 58 */   { 0 , 0, 
X		"3c.[1#]|;[2=].fIx" },
X/* BSTA 59 */   { 0 , 0, 
X		"3c.[1#]|;[2=].fI.8000|x" },
X/* BSTR 60 */   { 0 , 0, 
X		"38.[1#]|;[2=]~.P.6000&-.dIQ.1+-.7R;" },
X/* BSTR 61 */   { 0 , 0, 
X		"38.[1#]|;[2=]~.P.6000&-.dIQ.1+-.7R.80|;" },
X/* BSXA 62 */   { REGMASK , REG3, 
X		"bf;[2=].fIx" },
X/* BSXA 63 */   { REGMASK , REG3, 
X		"bf;[2=].fI.8000|x" },
X/* BXA 64 */   { REGMASK , REG3, 
X		"9f;[2=].fIx" },
X/* BXA 65 */   { REGMASK , REG3, 
X		"9f;[2=].fI.8000|x" },
X/* COMA 66 */   { 0 , 0, 
X		"ec.[1#]|;[2=].P.6000&-.dI.[3#]000|x" },
X/* COMI 67 */   { 0 , 0, 
X		"e4.[1#]|;[2=];" },
X/* COMR 68 */   { 0 , 0, 
X		"e8.[1#]|;[2=]~.P.6000&-.dIQ.1+-.7R;" },
X/* COMR 69 */   { 0 , 0, 
X		"e8.[1#]|;[2=]~.P.6000&-.dIQ.1+-.7R.80|;" },
X/* COMZ 70 */   { 0 , 0, 
X		"e0.[1#]|;" },
X/* CPSL 71 */   { 0 , 0, 
X		"75;[1=];" },
X/* CPSU 72 */   { 0 , 0, 
X		"74;[1=];" },
X/* DAR 73 */   { 0 , 0, 
X		"94.[1#]|;" },
X/* EORA 74 */   { 0 , 0, 
X		"2c.[1#]|;[2=].P.6000&-.dI.[3#]000|x" },
X/* EORI 75 */   { 0 , 0, 
X		"24.[1#]|;[2=];" },
X/* EORR 76 */   { 0 , 0, 
X		"28.[1#]|;[2=]~.P.6000&-.dIQ.1+-.7R;" },
X/* EORR 77 */   { 0 , 0, 
X		"28.[1#]|;[2=]~.P.6000&-.dIQ.1+-.7R.80|;" },
X/* EORZ 78 */   { 0 , 0, 
X		"20.[1#]|;" },
X/* HALT 79 */   { 0 , 0, 
X		"40;" },
X/* IORA 80 */   { 0 , 0, 
X		"6c.[1#]|;[2=].P.6000&-.dI.[3#]000|x" },
X/* IORI 81 */   { 0 , 0, 
X		"64.[1#]|;[2=];" },
X/* IORR 82 */   { 0 , 0, 
X		"68.[1#]|;[2=]~.P.6000&-.dIQ.1+-.7R;" },
X/* IORR 83 */   { 0 , 0, 
X		"68.[1#]|;[2=]~.P.6000&-.dIQ.1+-.7R.80|;" },
X/* IORZ 84 */   { 0 , 0, 
X		"60.[1#]|;" },
X/* LODA 85 */   { 0 , 0, 
X		"0c.[1#]|;[2=].P.6000&-.dI.[3#]000|x" },
X/* LODI 86 */   { 0 , 0, 
X		"04.[1#]|;[2=];" },
X/* LODR 87 */   { 0 , 0, 
X		"08.[1#]|;[2=]~.P.6000&-.dIQ.1+-.7R;" },
X/* LODR 88 */   { 0 , 0, 
X		"08.[1#]|;[2=]~.P.6000&-.dIQ.1+-.7R.80|;" },
X/* LODZ 89 */   { REGMASK , REG0, 
X		"60;" },
X/* LODZ 90 */   { REGMASK , REG1, 
X		"01;" },
X/* LODZ 91 */   { REGMASK , REG2, 
X		"02;" },
X/* LODZ 92 */   { REGMASK , REG3, 
X		"03;" },
X/* LPSL 93 */   { 0 , 0, 
X		"93;" },
X/* LPSU 94 */   { 0 , 0, 
X		"92;" },
X/* NOP 95 */   { 0 , 0, 
X		"c0;" },
X/* PPSL 96 */   { 0 , 0, 
X		"77;[1=];" },
X/* PPSU 97 */   { 0 , 0, 
X		"76;[1=];" },
X/* REDC 98 */   { 0 , 0, 
X		"30.[1#]|;" },
X/* REDD 99 */   { 0 , 0, 
X		"70.[1#]|;" },
X/* REDE 100 */   { 0 , 0, 
X		"54.[1#]|;[2=];" },
X/* RETC 101 */   { 0 , 0, 
X		"14.[1#]|;" },
X/* RETE 102 */   { 0 , 0, 
X		"34.[1#]|;" },
X/* RRL 103 */   { 0 , 0, 
X		"d0.[1#]|;" },
X/* RRR 104 */   { 0 , 0, 
X		"50.[1#]|;" },
X/* SPSL 105 */   { 0 , 0, 
X		"13;" },
X/* SPSU 106 */   { 0 , 0, 
X		"12;" },
X/* STRA 107 */   { 0 , 0, 
X		"cc.[1#]|;[2=].P.6000&-.dI.[3#]000|x" },
X/* STRR 108 */   { 0 , 0, 
X		"c8.[1#]|;[2=]~.P.6000&-.dIQ.1+-.7R;" },
X/* STRR 109 */   { 0 , 0, 
X		"c8.[1#]|;[2=]~.P.6000&-.dIQ.1+-.7R.80|;" },
X/* STRZ 110 */   { REGMASK , REG1, 
X		"c1;" },
X/* STRZ 111 */   { REGMASK , REG2, 
X		"c2;" },
X/* STRZ 112 */   { REGMASK , REG3, 
X		"c3;" },
X/* SUBA 113 */   { 0 , 0, 
X		"ac.[1#]|;[2=].P.6000&-.dI.[3#]000|x" },
X/* SUBI 114 */   { 0 , 0, 
X		"a4.[1#]|;[2=];" },
X/* SUBR 115 */   { 0 , 0, 
X		"a8.[1#]|;[2=]~.P.6000&-.dIQ.1+-.7R;" },
X/* SUBR 116 */   { 0 , 0, 
X		"a8.[1#]|;[2=]~.P.6000&-.dIQ.1+-.7R.80|;" },
X/* SUBZ 117 */   { 0 , 0, 
X		"a0.[1#]|;" },
X/* TMI 118 */   { 0 , 0, 
X		"f4.[1#]|;[2=];" },
X/* TPSL 119 */   { 0 , 0, 
X		"b5;[1=];" },
X/* TPSU 120 */   { 0 , 0, 
X		"b4;[1=];" },
X/* WRTC 121 */   { 0 , 0, 
X		"b0.[1#]|;" },
X/* WRTD 122 */   { 0 , 0, 
X		"f0.[1#]|;" },
X/* WRTE 123 */   { 0 , 0, 
X		"d4.[1#]|;[2=];" },
X/* ZBRR 124 */   { 0 , 0, 
X		"9b;[1=].dI~.fff>.2000_*|.7R;" },
X/* ZBRR 125 */   { 0 , 0, 
X		"9b;[1=].dI~.fff>.2000_*|.7R.80|;" },
X/* ZBSR 126 */   { 0 , 0, 
X		"bb;[1=].dI~.fff>.2000_*|.7R;" },
X/* ZBSR 127 */   { 0 , 0, 
X		"bb;[1=].dI~.fff>.2000_*|.7R.80|;" },
X	{ 0,0,""} };
X/* end fraptabdef.c */
SHAR_EOF
true || echo 'restore of as2650.y failed'
fi
exit 0



More information about the Alt.sources mailing list