Frankenstein Cross Assemblers, RCA 1805 flavor, Part 1 of 1

Mark Zenier markz at ssc.UUCP
Fri Dec 7 11:13:52 AEST 1990


---- Cut Here and feed the following to sh ----
#!/bin/sh
# This is Frankasm/As1805, a shell archive (shar 3.43)
# made 12/04/1990 08:44 UTC by markz at ssc.uucp
# Source directory /usr/mark/frank.shar
#
# existing files will NOT be overwritten unless -c is specified
# This format requires very little intelligence at unshar time.
# "if test", "echo", "true", and "sed" may be needed.
#
# This shar contains:
# length  mode       name
# ------ ---------- ------------------------------------------
#   1478 -r--r----- as1805.1
#   4222 -r--r----- as1805.doc
#   3893 -r--r----- as1805.tst
#   8896 -r--r----- as1805.tut
#  31719 -r--r--r-- as1805.y
#
# ============= as1805.1 ==============
if test -f 'as1805.1' -a X"$1" != X"-c"; then
	echo 'x - skipping as1805.1 (File already exists)'
else
echo 'x - extracting as1805.1 (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'as1805.1' &&
X.TH AS1805 1L
X.SH NAME
Xas1805, as1802 \- cross assemblers for microcomputers
X.SH SYNOPSIS
X.nf
Xas1805 [-p cpu] [-l listfile] [-o hexfile] [-d] [-s symbolfile] input
Xas1802 [-p cpu] [-l listfile] [-o hexfile] [-d] [-s symbolfile] input
X.fi
X.SH DESCRIPTION
XThe as1805, as1802 command(s) assembles the input file into a
Xtext output file representing the program memory for a microcomputer.
X
XOptions
X.IP "-p cpu"
XOverride the instruction set selection.
X.RS 10
XValid Values for Cpu
X.RS 5
X1802, 1804, 1805, 1806
X.RE
X.RE
X.IP "-l listfile"
XOutput a file formated with the memory address, data, and source input lines.
X.IP "-o hexfile"
XOutput the memory data image in a form accepted by most prom programmers.
X.IP "-h hexfile"
XSame as \-o.
X.IP \-d
XSave the intermediate data file (see FILE) and abort the execution at the
Xend of processing.
X.IP "-s symbolfile"
XPrint the symbol table values and names, one per line in the specified file.
X.SH FILES
X/usr/tmp/frtXXXXXX
X.SH SEE ALSO
XFrankenstein Cross Assemblers Users Manual (file base.doc)
XAppendix for as1805 Frankenstein Assembler (file as1805.doc)
X.SH NOTES
XThere is only one input file.
X
XThe program can select which subset of instructions is accepted.
XThe program first uses the name with which it is invoked.
XThis is scanned for a substring which indicates which set to use.
XThe -p options overrides this selction by performing the same substring
Xsearch.
X
XThere should only be one executable file with all of its names linked to it.
SHAR_EOF
true || echo 'restore of as1805.1 failed'
fi
# ============= as1805.doc ==============
if test -f 'as1805.doc' -a X"$1" != X"-c"; then
	echo 'x - skipping as1805.doc (File already exists)'
else
echo 'x - extracting as1805.doc (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'as1805.doc' &&
X.HM A 1 1 1 1 1 1
X.H 1 "Appendix for as1805 Frankenstein Assembler"
X.H 2 "Pseudo Operations"
X.H 3 "Standard Pseudo Operation Mnemonics"
X.VL 40 5 1
X.LI "End"
XEND
X.LI "File Inclusion"
XINCL
XINCLUDE
X.LI "If"
XIF
X.LI "Else"
XELSE
X.LI "End If"
XENDI
X.LI "Equate"
XEQU
X.LI "Set"
XSET
X.LI "Org"
XORG
X.LI "Reserve Memory"
XRESERVE
XRMB
X.LI "Define Byte Data"
XBYTE
XDB
XFCB
X.LI "Define Word Data"
XDW
XFDB
XWORD
X.LI "Define String Data"
XFCC
XSTRING
X.LI "Define Character Set Translation"
XCHARSET
X.LI "Define Character Value"
XCHARDEF
XCHD
X.LI "Use Character Translation"
XCHARUSE
X.LE
X.H 2 "Instructions"
X.H 3 "Instruction List"
X.TS H
X;
Xl l l.
XOpcode	Syntax	Selection Criteria
X.sp
X.TH
X.sp
XADC	
X.sp
XADCI	 '#' expr
X.sp
XADD	
X.sp
XADI	 '#' expr
X.sp
XAND	
X.sp
XANI	 '#' expr
X.sp
XB1	 expr
X.sp
XB2	 expr
X.sp
XB3	 expr
X.sp
XB4	 expr
X.sp
XBCI	 expr	TS1805
X.sp
XBDF	 expr
X.sp
XBGE	 expr
X.sp
XBL	 expr
X.sp
XBM	 expr
X.sp
XBN1	 expr
X.sp
XBN2	 expr
X.sp
XBN3	 expr
X.sp
XBN4	 expr
X.sp
XBNF	 expr
X.sp
XBNQ	 expr
X.sp
XBNZ	 expr
X.sp
XBPZ	 expr
X.sp
XBQ	 expr
X.sp
XBR	 expr
X.sp
XBXI	 expr	TS1805
X.sp
XBZ	 expr
X.sp
XCID		TS1805
X.sp
XCIE		TS1805
X.sp
XDACI	 '#' expr	TS1805
X.sp
XDADC		TS1805
X.sp
XDADD		TS1805
X.sp
XDADI	 '#' expr	TS1805
X.sp
XDBNZ	 expr ',' expr	TS1805
X.sp
XDEC	 expr
X.sp
XDIS	
X.sp
XDSAV		TS1805
X.sp
XDSBI	 '#' expr	TS1805
X.sp
XDSM		TS1805
X.sp
XDSMB		TS1805
X.sp
XDSMI	 '#' expr	TS1805
X.sp
XDTC		TS1805
X.sp
XETQ		TS1805
X.sp
XGEC		TS1805
X.sp
XGHI	 expr
X.sp
XGLO	 expr
X.sp
XIDL	
X.sp
XINC	 expr
X.sp
XINP	 expr
X.sp
XIRX	
X.sp
XLBDF	 expr
X.sp
XLBNF	 expr
X.sp
XLBNQ	 expr
X.sp
XLBNZ	 expr
X.sp
XLBQ	 expr
X.sp
XLBR	 expr
X.sp
XLBZ	 expr
X.sp
XLDA	 expr
X.sp
XLDC		TS1805
X.sp
XLDI	 '#' expr
X.sp
XLDN	 expr
X.sp
XLDX	
X.sp
XLDXA	
X.sp
XLSDF	
X.sp
XLSIE	
X.sp
XLSKP	
X.sp
XLSNF	
X.sp
XLSNQ	
X.sp
XLSNZ	
X.sp
XLSQ	
X.sp
XLSZ	
X.sp
XMARK	
X.sp
XNBR	expr
X.sp
XNLBR	expr
X.sp
XNOP	
X.sp
XOR	
X.sp
XORI	 '#' expr
X.sp
XOUT	 expr
X.sp
XPHI	 expr
X.sp
XPLO	 expr
X.sp
XREQ	
X.sp
XRET	
X.sp
XRLDI	 expr ',' '#' expr	TS1805
X.sp
XRLXA	 expr	TS1805
X.sp
XRNX	 expr	TS1805
X.sp
XRSHL	
X.sp
XRSHR	
X.sp
XRSXD	 expr	TS1805
X.sp
XSAV	
X.sp
XSCAL	 expr ',' expr	TS1805
X.sp
XSCM1		TS1805
X.sp
XSCM2		TS1805
X.sp
XSD	
X.sp
XSDB	
X.sp
XSDBI	 '#' expr
X.sp
XSDI	 '#' expr
X.sp
XSEP	 expr
X.sp
XSEQ	
X.sp
XSEX	 expr
X.sp
XSHL	
X.sp
XSHLC	
X.sp
XSHR	
X.sp
XSHRC	
X.sp
XSKP	
X.sp
XSM	
X.sp
XSMB	
X.sp
XSMBI	 '#' expr
X.sp
XSMI	 '#' expr
X.sp
XSPM1		TS1805
X.sp
XSPM2		TS1805
X.sp
XSRET	 expr	TS1805
X.sp
XSTM		TS1805
X.sp
XSTPC		TS1805
X.sp
XSTR	 expr
X.sp
XSTXD	
X.sp
XXID		TS1805
X.sp
XXIE		TS1805
X.sp
XXOR	
X.sp
XXRI	 '#' expr
X.TE
X.H 3 "Selection Criteria Keywords"
X.VL 25 5 
X.LI TS1805
XInstruction is only valid for the 1804A/1805A/1806A instruction sets.
X.LE
X.H 3 "Apostrophes"
XThe apostrophes in the syntax field are a notation used for the
Xparser generator and are not put in the assembler source statement.
X.H 2 "Notes"
X.H 3 "Instruction Set Selection"
XThe default is the 1805 instruction set. 
XTo restrict the instruction set, use the -p 1802 optional arguement on
Xthe command line, or rename or link the program file with a name containing
Xthe string 1802 (or just "02").
X.H 3 "Register and Port expressions"
XThe register and port numbers are specified as expressions.
XFor registers, the value must be between 0 and 15 (1 and 15 for the LDN 
Xinstruction).
XFor input/output ports, the value must be between 1 and 7.
XThe value must be computable when processed in the first pass.
XThe SET and EQU statements can be used to setup symbols for registers and
Xports.
XIt is recomended that a standard include file be setup to assign 
Xa set of symbols (like R0 to R15) for registers.
X.H 3 "Branch Target Expression Validity"
XThe "expression fails validity test" error message can occur if the
Xdestination of a short branch is not on the same page as the the last
Xbyte of the instruction.
XThe "expression exceeds available field width" can also occur for this
Xcase.
XUsually the validity message occurs when the destination is at a lower
Xpage, and the width message occurs when the destination is at a higher page. 
X.H 3 "Immediate Data"
XThe immediate data expressions for the RLDI (as well as the arithmetic and
Xlogic operations) are required to be on same line as the opcode.
X.H 3 "Reserved Symbols"
X.H 4 "Standard Reserved Symbols"
XAND
XDEFINED
XEQ
XGE
XGT
XHIGH
XLE
XLOW
XLT
XMOD
XNE
XNOT
XOR
XSHL
XSHR
XXOR
Xand
Xdefined
Xeq
Xge
Xgt
Xhigh
Xle
Xlow
Xlt
Xmod
Xne
Xnot
Xor
Xshl
Xshr
Xxor
X.TC 1 1 7
SHAR_EOF
true || echo 'restore of as1805.doc failed'
fi
# ============= as1805.tst ==============
if test -f 'as1805.tst' -a X"$1" != X"-c"; then
	echo 'x - skipping as1805.tst (File already exists)'
else
echo 'x - extracting as1805.tst (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'as1805.tst' &&
X	org 2300h
Xexpr	equ *
Ximmed	equ $55
X	 adc
X	 adci # immed
X	 add
X	 adi # immed
X	 and
X	 ani # immed
X	 b1 expr
X	 b2 expr
X	 b3 expr
X	 b4 expr
X	 bci expr
X	 bdf expr
X	 bge expr
X	 bl expr
X	 bm expr
X	 bn1 expr
X	 bn2 expr
X	 bn3 expr
X	 bn4 expr
X	 bnf expr
X	 bnq expr
X	 bnz expr
X	 bpz expr
X	 bq expr
X	 br expr
X	 bxi expr
X	 bz expr
X	 cid
X	 cie
X	 daci # immed
X	 dadc
X	 dadd
X	 dadi # immed
X	 dbnz 0 , expr
X	 dbnz 1 , expr
X	 dbnz 10 , expr
X	 dbnz 11 , expr
X	 dbnz 12 , expr
X	 dbnz 13 , expr
X	 dbnz 14 , expr
X	 dbnz 15 , expr
X	 dbnz 2 , expr
X	 dbnz 3 , expr
X	 dbnz 4 , expr
X	 dbnz 5 , expr
X	 dbnz 6 , expr
X	 dbnz 7 , expr
X	 dbnz 8 , expr
X	 dbnz 9 , expr
X	 dec 0
X	 dec 1
X	 dec 10
X	 dec 11
X	 dec 12
X	 dec 13
X	 dec 14
X	 dec 15
X	 dec 2
X	 dec 3
X	 dec 4
X	 dec 5
X	 dec 6
X	 dec 7
X	 dec 8
X	 dec 9
X	 dis
X	 dsav
X	 dsbi # immed
X	 dsm
X	 dsmb
X	 dsmi # immed
X	 dtc
X	 etq
X	 gec
X	 ghi 0
X	 ghi 1
X	 ghi 10
X	 ghi 11
X	 ghi 12
X	 ghi 13
X	 ghi 14
X	 ghi 15
X	 ghi 2
X	 ghi 3
X	 ghi 4
X	 ghi 5
X	 ghi 6
X	 ghi 7
X	 ghi 8
X	 ghi 9
X	 glo 0
X	 glo 1
X	 glo 10
X	 glo 11
X	 glo 12
X	 glo 13
X	 glo 14
X	 glo 15
X	 glo 2
X	 glo 3
X	 glo 4
X	 glo 5
X	 glo 6
X	 glo 7
X	 glo 8
X	 glo 9
X	 idl
X	 inc 0
X	 inc 1
X	 inc 10
X	 inc 11
X	 inc 12
X	 inc 13
X	 inc 14
X	 inc 15
X	 inc 2
X	 inc 3
X	 inc 4
X	 inc 5
X	 inc 6
X	 inc 7
X	 inc 8
X	 inc 9
X	 inp 1
X	 inp 2
X	 inp 3
X	 inp 4
X	 inp 5
X	 inp 6
X	 inp 7
X	 irx
X	 lbdf expr
X	 lbnf expr
X	 lbnq expr
X	 lbnz expr
X	 lbq expr
X	 lbr expr
X	 lbz expr
X	 lda 0
X	 lda 1
X	 lda 10
X	 lda 11
X	 lda 12
X	 lda 13
X	 lda 14
X	 lda 15
X	 lda 2
X	 lda 3
X	 lda 4
X	 lda 5
X	 lda 6
X	 lda 7
X	 lda 8
X	 lda 9
X	 ldc
X	 ldi # immed
X	 ldn 1
X	 ldn 10
X	 ldn 11
X	 ldn 12
X	 ldn 13
X	 ldn 14
X	 ldn 15
X	 ldn 2
X	 ldn 3
X	 ldn 4
X	 ldn 5
X	 ldn 6
X	 ldn 7
X	 ldn 8
X	 ldn 9
X	 ldx
X	 ldxa
X	 lsdf
X	 lsie
X	 lskp
X	 lsnf
X	 lsnq
X	 lsnz
X	 lsq
X	 lsz
X	 mark
X	 nbr *+3
X	 nlbr expr
X	 nop
X	 or
X	 ori # immed
X	 out 1
X	 out 2
X	 out 3
X	 out 4
X	 out 5
X	 out 6
X	 out 7
X	 phi 0
X	 phi 1
X	 phi 10
X	 phi 11
X	 phi 12
X	 phi 13
X	 phi 14
X	 phi 15
X	 phi 2
X	 phi 3
X	 phi 4
X	 phi 5
X	 phi 6
X	 phi 7
X	 phi 8
X	 phi 9
X	 plo 0
X	 plo 1
X	 plo 10
X	 plo 11
X	 plo 12
X	 plo 13
X	 plo 14
X	 plo 15
X	 plo 2
X	 plo 3
X	 plo 4
X	 plo 5
X	 plo 6
X	 plo 7
X	 plo 8
X	 plo 9
X	 req
X	 ret
X	 rldi 0 , # expr
X	 rldi 1 , # expr
X	 rldi 10 , # expr
X	 rldi 11 , # expr
X	 rldi 12 , # expr
X	 rldi 13 , # expr
X	 rldi 14 , # expr
X	 rldi 15 , # expr
X	 rldi 2 , # expr
X	 rldi 3 , # expr
X	 rldi 4 , # expr
X	 rldi 5 , # expr
X	 rldi 6 , # expr
X	 rldi 7 , # expr
X	 rldi 8 , # expr
X	 rldi 9 , # expr
X	 rlxa 0
X	 rlxa 1
X	 rlxa 10
X	 rlxa 11
X	 rlxa 12
X	 rlxa 13
X	 rlxa 14
X	 rlxa 15
X	 rlxa 2
X	 rlxa 3
X	 rlxa 4
X	 rlxa 5
X	 rlxa 6
X	 rlxa 7
X	 rlxa 8
X	 rlxa 9
X	 rnx 0
X	 rnx 1
X	 rnx 10
X	 rnx 11
X	 rnx 12
X	 rnx 13
X	 rnx 14
X	 rnx 15
X	 rnx 2
X	 rnx 3
X	 rnx 4
X	 rnx 5
X	 rnx 6
X	 rnx 7
X	 rnx 8
X	 rnx 9
X	 rshl
X	 rshr
X	 rsxd 0
X	 rsxd 1
X	 rsxd 10
X	 rsxd 11
X	 rsxd 12
X	 rsxd 13
X	 rsxd 14
X	 rsxd 15
X	 rsxd 2
X	 rsxd 3
X	 rsxd 4
X	 rsxd 5
X	 rsxd 6
X	 rsxd 7
X	 rsxd 8
X	 rsxd 9
X	 sav
X	 scal 0 , expr
X	 scal 1 , expr
X	 scal 10 , expr
X	 scal 11 , expr
X	 scal 12 , expr
X	 scal 13 , expr
X	 scal 14 , expr
X	 scal 15 , expr
X	 scal 2 , expr
X	 scal 3 , expr
X	 scal 4 , expr
X	 scal 5 , expr
X	 scal 6 , expr
X	 scal 7 , expr
X	 scal 8 , expr
X	 scal 9 , expr
X	 scm1
X	 scm2
X	 sd
X	 sdb
X	 sdbi # immed
X	 sdi # immed
X	 sep 0
X	 sep 1
X	 sep 10
X	 sep 11
X	 sep 12
X	 sep 13
X	 sep 14
X	 sep 15
X	 sep 2
X	 sep 3
X	 sep 4
X	 sep 5
X	 sep 6
X	 sep 7
X	 sep 8
X	 sep 9
X	 seq
X	 sex 0
X	 sex 1
X	 sex 10
X	 sex 11
X	 sex 12
X	 sex 13
X	 sex 14
X	 sex 15
X	 sex 2
X	 sex 3
X	 sex 4
X	 sex 5
X	 sex 6
X	 sex 7
X	 sex 8
X	 sex 9
X	 shl
X	 shlc
X	 shr
X	 shrc
X	 skp
X	 sm
X	 smb
X	 smbi # immed
X	 smi # immed
X	 spm1
X	 spm2
X	 sret 0
X	 sret 1
X	 sret 10
X	 sret 11
X	 sret 12
X	 sret 13
X	 sret 14
X	 sret 15
X	 sret 2
X	 sret 3
X	 sret 4
X	 sret 5
X	 sret 6
X	 sret 7
X	 sret 8
X	 sret 9
X	 stm
X	 stpc
X	 str 0
X	 str 1
X	 str 10
X	 str 11
X	 str 12
X	 str 13
X	 str 14
X	 str 15
X	 str 2
X	 str 3
X	 str 4
X	 str 5
X	 str 6
X	 str 7
X	 str 8
X	 str 9
X	 stxd
X	 xid
X	 xie
X	 xor
X	 xri # immed
SHAR_EOF
true || echo 'restore of as1805.tst failed'
fi
# ============= as1805.tut ==============
if test -f 'as1805.tut' -a X"$1" != X"-c"; then
	echo 'x - skipping as1805.tut (File already exists)'
else
echo 'x - extracting as1805.tut (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'as1805.tut' &&
X00002300 expr             00000055 immed            
X 0x2300                 	org 2300h
X 0x2300                 expr	equ *
X 0x55                   immed	equ $55
X2300 74 			 adc
X2301 7c 55 			 adci # immed
X2303 f4 			 add
X2304 fc 55 			 adi # immed
X2306 f2 			 and
X2307 fa 55 			 ani # immed
X2309 34 00 			 b1 expr
X230b 35 00 			 b2 expr
X230d 36 00 			 b3 expr
X230f 37 00 			 b4 expr
X2311 68 3e 00 			 bci expr
X2314 33 00 			 bdf expr
X2316 33 00 			 bge expr
X2318 3b 00 			 bl expr
X231a 3b 00 			 bm expr
X231c 3c 00 			 bn1 expr
X231e 3d 00 			 bn2 expr
X2320 3e 00 			 bn3 expr
X2322 3f 00 			 bn4 expr
X2324 3b 00 			 bnf expr
X2326 39 00 			 bnq expr
X2328 3a 00 			 bnz expr
X232a 33 00 			 bpz expr
X232c 31 00 			 bq expr
X232e 30 00 			 br expr
X2330 68 3f 00 			 bxi expr
X2333 32 00 			 bz expr
X2335 68 0d 			 cid
X2337 68 0c 			 cie
X2339 68 7c 55 			 daci # immed
X233c 68 74 			 dadc
X233e 68 f4 			 dadd
X2340 68 fc 55 			 dadi # immed
X2343 68 20 23 00 		 dbnz 0 , expr
X2347 68 21 23 00 		 dbnz 1 , expr
X234b 68 2a 23 00 		 dbnz 10 , expr
X234f 68 2b 23 00 		 dbnz 11 , expr
X2353 68 2c 23 00 		 dbnz 12 , expr
X2357 68 2d 23 00 		 dbnz 13 , expr
X235b 68 2e 23 00 		 dbnz 14 , expr
X235f 68 2f 23 00 		 dbnz 15 , expr
X2363 68 22 23 00 		 dbnz 2 , expr
X2367 68 23 23 00 		 dbnz 3 , expr
X236b 68 24 23 00 		 dbnz 4 , expr
X236f 68 25 23 00 		 dbnz 5 , expr
X2373 68 26 23 00 		 dbnz 6 , expr
X2377 68 27 23 00 		 dbnz 7 , expr
X237b 68 28 23 00 		 dbnz 8 , expr
X237f 68 29 23 00 		 dbnz 9 , expr
X2383 20 			 dec 0
X2384 21 			 dec 1
X2385 2a 			 dec 10
X2386 2b 			 dec 11
X2387 2c 			 dec 12
X2388 2d 			 dec 13
X2389 2e 			 dec 14
X238a 2f 			 dec 15
X238b 22 			 dec 2
X238c 23 			 dec 3
X238d 24 			 dec 4
X238e 25 			 dec 5
X238f 26 			 dec 6
X2390 27 			 dec 7
X2391 28 			 dec 8
X2392 29 			 dec 9
X2393 71 			 dis
X2394 68 76 			 dsav
X2396 68 7f 55 			 dsbi # immed
X2399 68 f7 			 dsm
X239b 68 77 			 dsmb
X239d 68 ff 55 			 dsmi # immed
X23a0 68 01 			 dtc
X23a2 68 09 			 etq
X23a4 68 08 			 gec
X23a6 90 			 ghi 0
X23a7 91 			 ghi 1
X23a8 9a 			 ghi 10
X23a9 9b 			 ghi 11
X23aa 9c 			 ghi 12
X23ab 9d 			 ghi 13
X23ac 9e 			 ghi 14
X23ad 9f 			 ghi 15
X23ae 92 			 ghi 2
X23af 93 			 ghi 3
X23b0 94 			 ghi 4
X23b1 95 			 ghi 5
X23b2 96 			 ghi 6
X23b3 97 			 ghi 7
X23b4 98 			 ghi 8
X23b5 99 			 ghi 9
X23b6 80 			 glo 0
X23b7 81 			 glo 1
X23b8 8a 			 glo 10
X23b9 8b 			 glo 11
X23ba 8c 			 glo 12
X23bb 8d 			 glo 13
X23bc 8e 			 glo 14
X23bd 8f 			 glo 15
X23be 82 			 glo 2
X23bf 83 			 glo 3
X23c0 84 			 glo 4
X23c1 85 			 glo 5
X23c2 86 			 glo 6
X23c3 87 			 glo 7
X23c4 88 			 glo 8
X23c5 89 			 glo 9
X23c6 00 			 idl
X23c7 10 			 inc 0
X23c8 11 			 inc 1
X23c9 1a 			 inc 10
X23ca 1b 			 inc 11
X23cb 1c 			 inc 12
X23cc 1d 			 inc 13
X23cd 1e 			 inc 14
X23ce 1f 			 inc 15
X23cf 12 			 inc 2
X23d0 13 			 inc 3
X23d1 14 			 inc 4
X23d2 15 			 inc 5
X23d3 16 			 inc 6
X23d4 17 			 inc 7
X23d5 18 			 inc 8
X23d6 19 			 inc 9
X23d7 69 			 inp 1
X23d8 6a 			 inp 2
X23d9 6b 			 inp 3
X23da 6c 			 inp 4
X23db 6d 			 inp 5
X23dc 6e 			 inp 6
X23dd 6f 			 inp 7
X23de 60 			 irx
X23df c3 23 00 			 lbdf expr
X23e2 cb 23 00 			 lbnf expr
X23e5 c9 23 00 			 lbnq expr
X23e8 ca 23 00 			 lbnz expr
X23eb c1 23 00 			 lbq expr
X23ee c0 23 00 			 lbr expr
X23f1 c2 23 00 			 lbz expr
X23f4 40 			 lda 0
X23f5 41 			 lda 1
X23f6 4a 			 lda 10
X23f7 4b 			 lda 11
X23f8 4c 			 lda 12
X23f9 4d 			 lda 13
X23fa 4e 			 lda 14
X23fb 4f 			 lda 15
X23fc 42 			 lda 2
X23fd 43 			 lda 3
X23fe 44 			 lda 4
X23ff 45 			 lda 5
X2400 46 			 lda 6
X2401 47 			 lda 7
X2402 48 			 lda 8
X2403 49 			 lda 9
X2404 68 06 			 ldc
X2406 f8 55 			 ldi # immed
X2408 01 			 ldn 1
X2409 0a 			 ldn 10
X240a 0b 			 ldn 11
X240b 0c 			 ldn 12
X240c 0d 			 ldn 13
X240d 0e 			 ldn 14
X240e 0f 			 ldn 15
X240f 02 			 ldn 2
X2410 03 			 ldn 3
X2411 04 			 ldn 4
X2412 05 			 ldn 5
X2413 06 			 ldn 6
X2414 07 			 ldn 7
X2415 08 			 ldn 8
X2416 09 			 ldn 9
X2417 f0 			 ldx
X2418 72 			 ldxa
X2419 cf 			 lsdf
X241a cc 			 lsie
X241b c8 			 lskp
X241c c7 			 lsnf
X241d c5 			 lsnq
X241e c6 			 lsnz
X241f cd 			 lsq
X2420 ce 			 lsz
X2421 79 			 mark
X2422 38 25 			 nbr *+3
X2424 c8 23 00 			 nlbr expr
X2427 c4 			 nop
X2428 f1 			 or
X2429 f9 55 			 ori # immed
X242b 61 			 out 1
X242c 62 			 out 2
X242d 63 			 out 3
X242e 64 			 out 4
X242f 65 			 out 5
X2430 66 			 out 6
X2431 67 			 out 7
X2432 b0 			 phi 0
X2433 b1 			 phi 1
X2434 ba 			 phi 10
X2435 bb 			 phi 11
X2436 bc 			 phi 12
X2437 bd 			 phi 13
X2438 be 			 phi 14
X2439 bf 			 phi 15
X243a b2 			 phi 2
X243b b3 			 phi 3
X243c b4 			 phi 4
X243d b5 			 phi 5
X243e b6 			 phi 6
X243f b7 			 phi 7
X2440 b8 			 phi 8
X2441 b9 			 phi 9
X2442 a0 			 plo 0
X2443 a1 			 plo 1
X2444 aa 			 plo 10
X2445 ab 			 plo 11
X2446 ac 			 plo 12
X2447 ad 			 plo 13
X2448 ae 			 plo 14
X2449 af 			 plo 15
X244a a2 			 plo 2
X244b a3 			 plo 3
X244c a4 			 plo 4
X244d a5 			 plo 5
X244e a6 			 plo 6
X244f a7 			 plo 7
X2450 a8 			 plo 8
X2451 a9 			 plo 9
X2452 7a 			 req
X2453 70 			 ret
X2454 68 c0 23 00 		 rldi 0 , # expr
X2458 68 c1 23 00 		 rldi 1 , # expr
X245c 68 ca 23 00 		 rldi 10 , # expr
X2460 68 cb 23 00 		 rldi 11 , # expr
X2464 68 cc 23 00 		 rldi 12 , # expr
X2468 68 cd 23 00 		 rldi 13 , # expr
X246c 68 ce 23 00 		 rldi 14 , # expr
X2470 68 cf 23 00 		 rldi 15 , # expr
X2474 68 c2 23 00 		 rldi 2 , # expr
X2478 68 c3 23 00 		 rldi 3 , # expr
X247c 68 c4 23 00 		 rldi 4 , # expr
X2480 68 c5 23 00 		 rldi 5 , # expr
X2484 68 c6 23 00 		 rldi 6 , # expr
X2488 68 c7 23 00 		 rldi 7 , # expr
X248c 68 c8 23 00 		 rldi 8 , # expr
X2490 68 c9 23 00 		 rldi 9 , # expr
X2494 68 60 			 rlxa 0
X2496 68 61 			 rlxa 1
X2498 68 6a 			 rlxa 10
X249a 68 6b 			 rlxa 11
X249c 68 6c 			 rlxa 12
X249e 68 6d 			 rlxa 13
X24a0 68 6e 			 rlxa 14
X24a2 68 6f 			 rlxa 15
X24a4 68 62 			 rlxa 2
X24a6 68 63 			 rlxa 3
X24a8 68 64 			 rlxa 4
X24aa 68 65 			 rlxa 5
X24ac 68 66 			 rlxa 6
X24ae 68 67 			 rlxa 7
X24b0 68 68 			 rlxa 8
X24b2 68 69 			 rlxa 9
X24b4 68 b0 			 rnx 0
X24b6 68 b1 			 rnx 1
X24b8 68 ba 			 rnx 10
X24ba 68 bb 			 rnx 11
X24bc 68 bc 			 rnx 12
X24be 68 bd 			 rnx 13
X24c0 68 be 			 rnx 14
X24c2 68 bf 			 rnx 15
X24c4 68 b2 			 rnx 2
X24c6 68 b3 			 rnx 3
X24c8 68 b4 			 rnx 4
X24ca 68 b5 			 rnx 5
X24cc 68 b6 			 rnx 6
X24ce 68 b7 			 rnx 7
X24d0 68 b8 			 rnx 8
X24d2 68 b9 			 rnx 9
X24d4 7e 			 rshl
X24d5 76 			 rshr
X24d6 68 a0 			 rsxd 0
X24d8 68 a1 			 rsxd 1
X24da 68 aa 			 rsxd 10
X24dc 68 ab 			 rsxd 11
X24de 68 ac 			 rsxd 12
X24e0 68 ad 			 rsxd 13
X24e2 68 ae 			 rsxd 14
X24e4 68 af 			 rsxd 15
X24e6 68 a2 			 rsxd 2
X24e8 68 a3 			 rsxd 3
X24ea 68 a4 			 rsxd 4
X24ec 68 a5 			 rsxd 5
X24ee 68 a6 			 rsxd 6
X24f0 68 a7 			 rsxd 7
X24f2 68 a8 			 rsxd 8
X24f4 68 a9 			 rsxd 9
X24f6 78 			 sav
X24f7 68 80 23 00 		 scal 0 , expr
X24fb 68 81 23 00 		 scal 1 , expr
X24ff 68 8a 23 00 		 scal 10 , expr
X2503 68 8b 23 00 		 scal 11 , expr
X2507 68 8c 23 00 		 scal 12 , expr
X250b 68 8d 23 00 		 scal 13 , expr
X250f 68 8e 23 00 		 scal 14 , expr
X2513 68 8f 23 00 		 scal 15 , expr
X2517 68 82 23 00 		 scal 2 , expr
X251b 68 83 23 00 		 scal 3 , expr
X251f 68 84 23 00 		 scal 4 , expr
X2523 68 85 23 00 		 scal 5 , expr
X2527 68 86 23 00 		 scal 6 , expr
X252b 68 87 23 00 		 scal 7 , expr
X252f 68 88 23 00 		 scal 8 , expr
X2533 68 89 23 00 		 scal 9 , expr
X2537 68 05 			 scm1
X2539 68 03 			 scm2
X253b f5 			 sd
X253c 75 			 sdb
X253d 7d 55 			 sdbi # immed
X253f fd 55 			 sdi # immed
X2541 d0 			 sep 0
X2542 d1 			 sep 1
X2543 da 			 sep 10
X2544 db 			 sep 11
X2545 dc 			 sep 12
X2546 dd 			 sep 13
X2547 de 			 sep 14
X2548 df 			 sep 15
X2549 d2 			 sep 2
X254a d3 			 sep 3
X254b d4 			 sep 4
X254c d5 			 sep 5
X254d d6 			 sep 6
X254e d7 			 sep 7
X254f d8 			 sep 8
X2550 d9 			 sep 9
X2551 7b 			 seq
X2552 e0 			 sex 0
X2553 e1 			 sex 1
X2554 ea 			 sex 10
X2555 eb 			 sex 11
X2556 ec 			 sex 12
X2557 ed 			 sex 13
X2558 ee 			 sex 14
X2559 ef 			 sex 15
X255a e2 			 sex 2
X255b e3 			 sex 3
X255c e4 			 sex 4
X255d e5 			 sex 5
X255e e6 			 sex 6
X255f e7 			 sex 7
X2560 e8 			 sex 8
X2561 e9 			 sex 9
X2562 fe 			 shl
X2563 7e 			 shlc
X2564 f6 			 shr
X2565 76 			 shrc
X2566 38 			 skp
X2567 f7 			 sm
X2568 77 			 smb
X2569 7f 55 			 smbi # immed
X256b ff 55 			 smi # immed
X256d 68 04 			 spm1
X256f 68 02 			 spm2
X2571 68 90 			 sret 0
X2573 68 91 			 sret 1
X2575 68 9a 			 sret 10
X2577 68 9b 			 sret 11
X2579 68 9c 			 sret 12
X257b 68 9d 			 sret 13
X257d 68 9e 			 sret 14
X257f 68 9f 			 sret 15
X2581 68 92 			 sret 2
X2583 68 93 			 sret 3
X2585 68 94 			 sret 4
X2587 68 95 			 sret 5
X2589 68 96 			 sret 6
X258b 68 97 			 sret 7
X258d 68 98 			 sret 8
X258f 68 99 			 sret 9
X2591 68 07 			 stm
X2593 68 00 			 stpc
X2595 50 			 str 0
X2596 51 			 str 1
X2597 5a 			 str 10
X2598 5b 			 str 11
X2599 5c 			 str 12
X259a 5d 			 str 13
X259b 5e 			 str 14
X259c 5f 			 str 15
X259d 52 			 str 2
X259e 53 			 str 3
X259f 54 			 str 4
X25a0 55 			 str 5
X25a1 56 			 str 6
X25a2 57 			 str 7
X25a3 58 			 str 8
X25a4 59 			 str 9
X25a5 73 			 stxd
X25a6 68 0b 			 xid
X25a8 68 0a 			 xie
X25aa f3 			 xor
X25ab fb 55 			 xri # immed
X ERROR SUMMARY - ERRORS DETECTED 0
X               -  WARNINGS       0
SHAR_EOF
true || echo 'restore of as1805.tut failed'
fi
# ============= as1805.y ==============
if test -f 'as1805.y' -a X"$1" != X"-c"; then
	echo 'x - skipping as1805.y (File already exists)'
else
echo 'x - extracting as1805.y (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'as1805.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: 	as1805.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: 	as1805.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/* RCA 1802 instruction generation file */
X/* November 17, 1990 - character set support */
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#define CPUMASK		0xc000
X#define CPU1802		0x4000	
X#define CPU1805		0xc000
X#define TS1802PLUS	0x4000	/* mask and match values in table */
X#define TS1805	0x8000	/* if select value & mask == mask */
X#define ST_INH 0x1
X#define ST_IMM 0x2
X#define ST_EXP 0x4
X#define ST_IO 0x1
X#define ST_REG 0x1
X#define ST_LDN 0x1
X#define ST_RLDI 0x1
X#define ST_DBNZ 0x1
X	
X	int	cpuselect = CPU1805;
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/illegal instruction for cpu";
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%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_opcode
X%token <intv> KOC_ioop
X%token <intv> KOC_regop
X%token <intv> KOC_ldn
X%token <intv> KOC_rldi
X%token <intv> KOC_dbnz
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_opcode 
X			{
X		genlocrec(currseg, labelloc);
X		locctr += geninstr( findgen( $1, ST_INH, cpuselect
X				));
X			}
X	;
Xgenline : KOC_opcode  '#' expr
X			{
X		genlocrec(currseg, labelloc);
X		pevalexpr(1, $3);
X		locctr += geninstr( findgen( $1, ST_IMM, cpuselect
X				));
X			}
X	;
Xgenline : KOC_opcode  expr
X			{
X		genlocrec(currseg, labelloc);
X		pevalexpr(1, $2);
X		locctr += geninstr( findgen( $1, ST_EXP, cpuselect
X				));
X			}
X	;
Xgenline : KOC_ioop  expr
X			{
X		genlocrec(currseg, labelloc);
X		pevalexpr(1, $2);
X		if(evalr[1].seg != SSG_ABS
X			|| evalr[1].value < 1
X			|| evalr[1].value > 7 )
X		{
X			fraerror("invalid IO port");
X			evalr[1].value = 0;
X		}
X		locctr += geninstr( findgen( $1, ST_IO, cpuselect
X				));
X			}
X	;
Xgenline : KOC_regop  expr
X			{
X		genlocrec(currseg, labelloc);
X		pevalexpr(1, $2);
X		if(evalr[1].seg != SSG_ABS
X			|| evalr[1].value < 0
X			|| evalr[1].value > 15  )
X		{
X			fraerror("invalid register expression");
X			evalr[1].value = 0;
X		}
X		locctr += geninstr( findgen( $1, ST_REG, cpuselect
X				));
X			}
X	;
Xgenline : KOC_ldn  expr
X			{
X		genlocrec(currseg, labelloc);
X		pevalexpr(1, $2);
X		if(evalr[1].seg != SSG_ABS
X			|| evalr[1].value < 1
X			|| evalr[1].value > 15  )
X		{
X			fraerror("invalid register expression");
X			evalr[1].value = 0;
X		}
X		locctr += geninstr( findgen( $1, ST_LDN, cpuselect
X				));
X			}
X	;
Xgenline : KOC_rldi  expr ',' '#' expr
X			{
X		genlocrec(currseg, labelloc);
X		pevalexpr(1, $2);
X		pevalexpr(2, $5);
X		if(evalr[1].seg != SSG_ABS
X			|| evalr[1].value < 0
X			|| evalr[1].value > 15  )
X		{
X			fraerror("invalid register expression");
X			evalr[1].value = 0;
X		}
X		locctr += geninstr( findgen( $1, ST_RLDI, cpuselect
X				));
X			}
X	;
Xgenline : KOC_dbnz  expr ',' expr
X			{
X		genlocrec(currseg, labelloc);
X		pevalexpr(1, $2);
X		pevalexpr(2, $4);
X		if(evalr[1].seg != SSG_ABS
X			|| evalr[1].value < 0
X			|| evalr[1].value > 15  )
X		{
X			fraerror("invalid register expression");
X			evalr[1].value = 0;
X		}
X		locctr += geninstr( findgen( $1, ST_DBNZ, cpuselect
X				));
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
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
Xsetreserved()
X{
X
X	reservedsym("and", KEOP_AND, 0);
X	reservedsym("defined", KEOP_DEFINED,0);
X	reservedsym("eq", KEOP_EQ, 0);
X	reservedsym("ge", KEOP_GE, 0);
X	reservedsym("gt", KEOP_GT, 0);
X	reservedsym("high", KEOP_HIGH, 0);
X	reservedsym("le", KEOP_LE, 0);
X	reservedsym("low", KEOP_LOW, 0);
X	reservedsym("lt", KEOP_LT, 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("EQ", KEOP_EQ, 0);
X	reservedsym("GE", KEOP_GE, 0);
X	reservedsym("GT", KEOP_GT, 0);
X	reservedsym("HIGH", KEOP_HIGH, 0);
X	reservedsym("LE", KEOP_LE, 0);
X	reservedsym("LOW", KEOP_LOW, 0);
X	reservedsym("LT", KEOP_LT, 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}
X
Xcpumatch(str)
X	char * str;
X{
X	int msub;
X
X	static struct
X	{
X		char * mtch;
X		int   cpuv;
X	} matchtab[] =
X	{
X		{"02", CPU1802 },
X		{"05", CPU1805 },
X		{"04", CPU1805 },
X		{"06", CPU1805 },
X		{"", 0} 
X	};
X
X	for(msub = 0; matchtab[msub].cpuv != 0; msub++)
X	{
X		if(strcontains(str, matchtab[msub].mtch))
X		{
X			cpuselect = matchtab[msub].cpuv;
X			return TRUE;
X		}
X	}
X
X	return FALSE;
X}
X
X
Xstrcontains(s1, sm)
X	char * s1, *sm;
X{
X	int l1 = strlen(s1), lm = strlen(sm);
X
X	for(; l1 >= lm; l1--, s1++)
X	{
X		if(strncmp(s1, sm, lm) == 0)
X		{
X			return TRUE;
X		}
X	}
X	return FALSE;
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 143
X#define NUMSYNBLK 121
X#define NUMDIFFOP 121
X
Xint gnumopcode = NUMOPCODE;
X
Xint ophashlnk[NUMOPCODE];
X
Xstruct opsym optab[NUMOPCODE+1]
X	= {
X	{"invalid", KOC_opcode, 2, 0 },
X	{"ADC", KOC_opcode, 1, 2 },
X	{"ADCI", KOC_opcode, 1, 3 },
X	{"ADD", KOC_opcode, 1, 4 },
X	{"ADI", KOC_opcode, 1, 5 },
X	{"AND", KOC_opcode, 1, 6 },
X	{"ANI", KOC_opcode, 1, 7 },
X	{"B1", KOC_opcode, 1, 8 },
X	{"B2", KOC_opcode, 1, 9 },
X	{"B3", KOC_opcode, 1, 10 },
X	{"B4", KOC_opcode, 1, 11 },
X	{"BCI", KOC_opcode, 1, 12 },
X	{"BDF", KOC_opcode, 1, 13 },
X	{"BGE", KOC_opcode, 1, 14 },
X	{"BL", KOC_opcode, 1, 15 },
X	{"BM", KOC_opcode, 1, 16 },
X	{"BN1", KOC_opcode, 1, 17 },
X	{"BN2", KOC_opcode, 1, 18 },
X	{"BN3", KOC_opcode, 1, 19 },
X	{"BN4", KOC_opcode, 1, 20 },
X	{"BNF", KOC_opcode, 1, 21 },
X	{"BNQ", KOC_opcode, 1, 22 },
X	{"BNZ", KOC_opcode, 1, 23 },
X	{"BPZ", KOC_opcode, 1, 24 },
X	{"BQ", KOC_opcode, 1, 25 },
X	{"BR", KOC_opcode, 1, 26 },
X	{"BXI", KOC_opcode, 1, 27 },
X	{"BYTE", KOC_BDEF, 0, 0 },
X	{"BZ", KOC_opcode, 1, 28 },
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	{"CID", KOC_opcode, 1, 29 },
X	{"CIE", KOC_opcode, 1, 30 },
X	{"DACI", KOC_opcode, 1, 31 },
X	{"DADC", KOC_opcode, 1, 32 },
X	{"DADD", KOC_opcode, 1, 33 },
X	{"DADI", KOC_opcode, 1, 34 },
X	{"DB", KOC_BDEF, 0, 0 },
X	{"DBNZ", KOC_dbnz, 1, 35 },
X	{"DEC", KOC_regop, 1, 36 },
X	{"DIS", KOC_opcode, 1, 37 },
X	{"DSAV", KOC_opcode, 1, 38 },
X	{"DSBI", KOC_opcode, 1, 39 },
X	{"DSM", KOC_opcode, 1, 40 },
X	{"DSMB", KOC_opcode, 1, 41 },
X	{"DSMI", KOC_opcode, 1, 42 },
X	{"DTC", KOC_opcode, 1, 43 },
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	{"EQU", KOC_EQU, 0, 0 },
X	{"ETQ", KOC_opcode, 1, 44 },
X	{"FCB", KOC_BDEF, 0, 0 },
X	{"FCC", KOC_SDEF, 0, 0 },
X	{"FDB", KOC_WDEF, 0, 0 },
X	{"GEC", KOC_opcode, 1, 45 },
X	{"GHI", KOC_regop, 1, 46 },
X	{"GLO", KOC_regop, 1, 47 },
X	{"IDL", KOC_opcode, 1, 48 },
X	{"IF", KOC_IF, 0, 0 },
X	{"INC", KOC_regop, 1, 49 },
X	{"INCL", KOC_INCLUDE, 0, 0 },
X	{"INCLUDE", KOC_INCLUDE, 0, 0 },
X	{"INP", KOC_ioop, 1, 50 },
X	{"IRX", KOC_opcode, 1, 51 },
X	{"LBDF", KOC_opcode, 1, 52 },
X	{"LBNF", KOC_opcode, 1, 53 },
X	{"LBNQ", KOC_opcode, 1, 54 },
X	{"LBNZ", KOC_opcode, 1, 55 },
X	{"LBQ", KOC_opcode, 1, 56 },
X	{"LBR", KOC_opcode, 1, 57 },
X	{"LBZ", KOC_opcode, 1, 58 },
X	{"LDA", KOC_regop, 1, 59 },
X	{"LDC", KOC_opcode, 1, 60 },
X	{"LDI", KOC_opcode, 1, 61 },
X	{"LDN", KOC_ldn, 1, 62 },
X	{"LDX", KOC_opcode, 1, 63 },
X	{"LDXA", KOC_opcode, 1, 64 },
X	{"LSDF", KOC_opcode, 1, 65 },
X	{"LSIE", KOC_opcode, 1, 66 },
X	{"LSKP", KOC_opcode, 1, 67 },
X	{"LSNF", KOC_opcode, 1, 68 },
X	{"LSNQ", KOC_opcode, 1, 69 },
X	{"LSNZ", KOC_opcode, 1, 70 },
X	{"LSQ", KOC_opcode, 1, 71 },
X	{"LSZ", KOC_opcode, 1, 72 },
X	{"MARK", KOC_opcode, 1, 73 },
X	{"NBR", KOC_opcode, 1, 74 },
X	{"NLBR", KOC_opcode, 1, 75 },
X	{"NOP", KOC_opcode, 1, 76 },
X	{"OR", KOC_opcode, 1, 77 },
X	{"ORG", KOC_ORG, 0, 0 },
X	{"ORI", KOC_opcode, 1, 78 },
X	{"OUT", KOC_ioop, 1, 79 },
X	{"PHI", KOC_regop, 1, 80 },
X	{"PLO", KOC_regop, 1, 81 },
X	{"REQ", KOC_opcode, 1, 82 },
X	{"RESERVE", KOC_RESM, 0, 0 },
X	{"RET", KOC_opcode, 1, 83 },
X	{"RLDI", KOC_rldi, 1, 84 },
X	{"RLXA", KOC_regop, 1, 85 },
X	{"RMB", KOC_RESM, 0, 0 },
X	{"RNX", KOC_regop, 1, 86 },
X	{"RSHL", KOC_opcode, 1, 87 },
X	{"RSHR", KOC_opcode, 1, 88 },
X	{"RSXD", KOC_regop, 1, 89 },
X	{"SAV", KOC_opcode, 1, 90 },
X	{"SCAL", KOC_dbnz, 1, 91 },
X	{"SCM1", KOC_opcode, 1, 92 },
X	{"SCM2", KOC_opcode, 1, 93 },
X	{"SD", KOC_opcode, 1, 94 },
X	{"SDB", KOC_opcode, 1, 95 },
X	{"SDBI", KOC_opcode, 1, 96 },
X	{"SDI", KOC_opcode, 1, 97 },
X	{"SEP", KOC_regop, 1, 98 },
X	{"SEQ", KOC_opcode, 1, 99 },
X	{"SET", KOC_SET, 0, 0 },
X	{"SEX", KOC_regop, 1, 100 },
X	{"SHL", KOC_opcode, 1, 101 },
X	{"SHLC", KOC_opcode, 1, 102 },
X	{"SHR", KOC_opcode, 1, 103 },
X	{"SHRC", KOC_opcode, 1, 104 },
X	{"SKP", KOC_opcode, 1, 105 },
X	{"SM", KOC_opcode, 1, 106 },
X	{"SMB", KOC_opcode, 1, 107 },
X	{"SMBI", KOC_opcode, 1, 108 },
X	{"SMI", KOC_opcode, 1, 109 },
X	{"SPM1", KOC_opcode, 1, 110 },
X	{"SPM2", KOC_opcode, 1, 111 },
X	{"SRET", KOC_regop, 1, 112 },
X	{"STM", KOC_opcode, 1, 113 },
X	{"STPC", KOC_opcode, 1, 114 },
X	{"STR", KOC_regop, 1, 115 },
X	{"STRING", KOC_SDEF, 0, 0 },
X	{"STXD", KOC_opcode, 1, 116 },
X	{"WORD", KOC_WDEF, 0, 0 },
X	{"XID", KOC_opcode, 1, 117 },
X	{"XIE", KOC_opcode, 1, 118 },
X	{"XOR", KOC_opcode, 1, 119 },
X	{"XRI", KOC_opcode, 1, 120 },
X	{ "", 0, 0, 0 }};
X
Xstruct opsynt ostab[NUMSYNBLK+1]
X	= {
X/* invalid 0 */ { 0, 1, 0 },
X/* invalid 1 */ { 0xffff, 1, 1 },
X/* ADC 2 */ { ST_INH, 1, 2 },
X/* ADCI 3 */ { ST_IMM, 1, 3 },
X/* ADD 4 */ { ST_INH, 1, 4 },
X/* ADI 5 */ { ST_IMM, 1, 5 },
X/* AND 6 */ { ST_INH, 1, 6 },
X/* ANI 7 */ { ST_IMM, 1, 7 },
X/* B1 8 */ { ST_EXP, 1, 8 },
X/* B2 9 */ { ST_EXP, 1, 9 },
X/* B3 10 */ { ST_EXP, 1, 10 },
X/* B4 11 */ { ST_EXP, 1, 11 },
X/* BCI 12 */ { ST_EXP, 1, 12 },
X/* BDF 13 */ { ST_EXP, 1, 13 },
X/* BGE 14 */ { ST_EXP, 1, 14 },
X/* BL 15 */ { ST_EXP, 1, 15 },
X/* BM 16 */ { ST_EXP, 1, 16 },
X/* BN1 17 */ { ST_EXP, 1, 17 },
X/* BN2 18 */ { ST_EXP, 1, 18 },
X/* BN3 19 */ { ST_EXP, 1, 19 },
X/* BN4 20 */ { ST_EXP, 1, 20 },
X/* BNF 21 */ { ST_EXP, 1, 21 },
X/* BNQ 22 */ { ST_EXP, 1, 22 },
X/* BNZ 23 */ { ST_EXP, 1, 23 },
X/* BPZ 24 */ { ST_EXP, 1, 24 },
X/* BQ 25 */ { ST_EXP, 1, 25 },
X/* BR 26 */ { ST_EXP, 1, 26 },
X/* BXI 27 */ { ST_EXP, 1, 27 },
X/* BZ 28 */ { ST_EXP, 1, 28 },
X/* CID 29 */ { ST_INH, 1, 29 },
X/* CIE 30 */ { ST_INH, 1, 30 },
X/* DACI 31 */ { ST_IMM, 1, 31 },
X/* DADC 32 */ { ST_INH, 1, 32 },
X/* DADD 33 */ { ST_INH, 1, 33 },
X/* DADI 34 */ { ST_IMM, 1, 34 },
X/* DBNZ 35 */ { ST_DBNZ, 1, 35 },
X/* DEC 36 */ { ST_REG, 1, 36 },
X/* DIS 37 */ { ST_INH, 1, 37 },
X/* DSAV 38 */ { ST_INH, 1, 38 },
X/* DSBI 39 */ { ST_IMM, 1, 39 },
X/* DSM 40 */ { ST_INH, 1, 40 },
X/* DSMB 41 */ { ST_INH, 1, 41 },
X/* DSMI 42 */ { ST_IMM, 1, 42 },
X/* DTC 43 */ { ST_INH, 1, 43 },
X/* ETQ 44 */ { ST_INH, 1, 44 },
X/* GEC 45 */ { ST_INH, 1, 45 },
X/* GHI 46 */ { ST_REG, 1, 46 },
X/* GLO 47 */ { ST_REG, 1, 47 },
X/* IDL 48 */ { ST_INH, 1, 48 },
X/* INC 49 */ { ST_REG, 1, 49 },
X/* INP 50 */ { ST_IO, 1, 50 },
X/* IRX 51 */ { ST_INH, 1, 51 },
X/* LBDF 52 */ { ST_EXP, 1, 52 },
X/* LBNF 53 */ { ST_EXP, 1, 53 },
X/* LBNQ 54 */ { ST_EXP, 1, 54 },
X/* LBNZ 55 */ { ST_EXP, 1, 55 },
X/* LBQ 56 */ { ST_EXP, 1, 56 },
X/* LBR 57 */ { ST_EXP, 1, 57 },
X/* LBZ 58 */ { ST_EXP, 1, 58 },
X/* LDA 59 */ { ST_REG, 1, 59 },
X/* LDC 60 */ { ST_INH, 1, 60 },
X/* LDI 61 */ { ST_IMM, 1, 61 },
X/* LDN 62 */ { ST_LDN, 1, 62 },
X/* LDX 63 */ { ST_INH, 1, 63 },
X/* LDXA 64 */ { ST_INH, 1, 64 },
X/* LSDF 65 */ { ST_INH, 1, 65 },
X/* LSIE 66 */ { ST_INH, 1, 66 },
X/* LSKP 67 */ { ST_INH, 1, 67 },
X/* LSNF 68 */ { ST_INH, 1, 68 },
X/* LSNQ 69 */ { ST_INH, 1, 69 },
X/* LSNZ 70 */ { ST_INH, 1, 70 },
X/* LSQ 71 */ { ST_INH, 1, 71 },
X/* LSZ 72 */ { ST_INH, 1, 72 },
X/* MARK 73 */ { ST_INH, 1, 73 },
X/* NBR 74 */ { ST_EXP, 1, 74 },
X/* NLBR 75 */ { ST_EXP, 1, 75 },
X/* NOP 76 */ { ST_INH, 1, 76 },
X/* OR 77 */ { ST_INH, 1, 77 },
X/* ORI 78 */ { ST_IMM, 1, 78 },
X/* OUT 79 */ { ST_IO, 1, 79 },
X/* PHI 80 */ { ST_REG, 1, 80 },
X/* PLO 81 */ { ST_REG, 1, 81 },
X/* REQ 82 */ { ST_INH, 1, 82 },
X/* RET 83 */ { ST_INH, 1, 83 },
X/* RLDI 84 */ { ST_RLDI, 1, 84 },
X/* RLXA 85 */ { ST_REG, 1, 85 },
X/* RNX 86 */ { ST_REG, 1, 86 },
X/* RSHL 87 */ { ST_INH, 1, 87 },
X/* RSHR 88 */ { ST_INH, 1, 88 },
X/* RSXD 89 */ { ST_REG, 1, 89 },
X/* SAV 90 */ { ST_INH, 1, 90 },
X/* SCAL 91 */ { ST_DBNZ, 1, 91 },
X/* SCM1 92 */ { ST_INH, 1, 92 },
X/* SCM2 93 */ { ST_INH, 1, 93 },
X/* SD 94 */ { ST_INH, 1, 94 },
X/* SDB 95 */ { ST_INH, 1, 95 },
X/* SDBI 96 */ { ST_IMM, 1, 96 },
X/* SDI 97 */ { ST_IMM, 1, 97 },
X/* SEP 98 */ { ST_REG, 1, 98 },
X/* SEQ 99 */ { ST_INH, 1, 99 },
X/* SEX 100 */ { ST_REG, 1, 100 },
X/* SHL 101 */ { ST_INH, 1, 101 },
X/* SHLC 102 */ { ST_INH, 1, 102 },
X/* SHR 103 */ { ST_INH, 1, 103 },
X/* SHRC 104 */ { ST_INH, 1, 104 },
X/* SKP 105 */ { ST_INH, 1, 105 },
X/* SM 106 */ { ST_INH, 1, 106 },
X/* SMB 107 */ { ST_INH, 1, 107 },
X/* SMBI 108 */ { ST_IMM, 1, 108 },
X/* SMI 109 */ { ST_IMM, 1, 109 },
X/* SPM1 110 */ { ST_INH, 1, 110 },
X/* SPM2 111 */ { ST_INH, 1, 111 },
X/* SRET 112 */ { ST_REG, 1, 112 },
X/* STM 113 */ { ST_INH, 1, 113 },
X/* STPC 114 */ { ST_INH, 1, 114 },
X/* STR 115 */ { ST_REG, 1, 115 },
X/* STXD 116 */ { ST_INH, 1, 116 },
X/* XID 117 */ { ST_INH, 1, 117 },
X/* XIE 118 */ { ST_INH, 1, 118 },
X/* XOR 119 */ { ST_INH, 1, 119 },
X/* XRI 120 */ { ST_IMM, 1, 120 },
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/* ADC 2 */   { 0 , 0, 
X		"74;" },
X/* ADCI 3 */   { 0 , 0, 
X		"7c;[1=];" },
X/* ADD 4 */   { 0 , 0, 
X		"f4;" },
X/* ADI 5 */   { 0 , 0, 
X		"fc;[1=];" },
X/* AND 6 */   { 0 , 0, 
X		"f2;" },
X/* ANI 7 */   { 0 , 0, 
X		"fa;[1=];" },
X/* B1 8 */   { 0 , 0, 
X		"34;[1=].Q.ff00&-~.0<T!;" },
X/* B2 9 */   { 0 , 0, 
X		"35;[1=].Q.ff00&-~.0<T!;" },
X/* B3 10 */   { 0 , 0, 
X		"36;[1=].Q.ff00&-~.0<T!;" },
X/* B4 11 */   { 0 , 0, 
X		"37;[1=].Q.ff00&-~.0<T!;" },
X/* BCI 12 */   { TS1805 , TS1805, 
X		"68;3e;[1=].Q.ff00&-~.0<T!;" },
X/* BDF 13 */   { 0 , 0, 
X		"33;[1=].Q.ff00&-~.0<T!;" },
X/* BGE 14 */   { 0 , 0, 
X		"33;[1=].Q.ff00&-~.0<T!;" },
X/* BL 15 */   { 0 , 0, 
X		"3b;[1=].Q.ff00&-~.0<T!;" },
X/* BM 16 */   { 0 , 0, 
X		"3b;[1=].Q.ff00&-~.0<T!;" },
X/* BN1 17 */   { 0 , 0, 
X		"3c;[1=].Q.ff00&-~.0<T!;" },
X/* BN2 18 */   { 0 , 0, 
X		"3d;[1=].Q.ff00&-~.0<T!;" },
X/* BN3 19 */   { 0 , 0, 
X		"3e;[1=].Q.ff00&-~.0<T!;" },
X/* BN4 20 */   { 0 , 0, 
X		"3f;[1=].Q.ff00&-~.0<T!;" },
X/* BNF 21 */   { 0 , 0, 
X		"3b;[1=].Q.ff00&-~.0<T!;" },
X/* BNQ 22 */   { 0 , 0, 
X		"39;[1=].Q.ff00&-~.0<T!;" },
X/* BNZ 23 */   { 0 , 0, 
X		"3a;[1=].Q.ff00&-~.0<T!;" },
X/* BPZ 24 */   { 0 , 0, 
X		"33;[1=].Q.ff00&-~.0<T!;" },
X/* BQ 25 */   { 0 , 0, 
X		"31;[1=].Q.ff00&-~.0<T!;" },
X/* BR 26 */   { 0 , 0, 
X		"30;[1=].Q.ff00&-~.0<T!;" },
X/* BXI 27 */   { TS1805 , TS1805, 
X		"68;3f;[1=].Q.ff00&-~.0<T!;" },
X/* BZ 28 */   { 0 , 0, 
X		"32;[1=].Q.ff00&-~.0<T!;" },
X/* CID 29 */   { TS1805 , TS1805, 
X		"68;0d;" },
X/* CIE 30 */   { TS1805 , TS1805, 
X		"68;0c;" },
X/* DACI 31 */   { TS1805 , TS1805, 
X		"68;7c;[1=];" },
X/* DADC 32 */   { TS1805 , TS1805, 
X		"68;74;" },
X/* DADD 33 */   { TS1805 , TS1805, 
X		"68;f4;" },
X/* DADI 34 */   { TS1805 , TS1805, 
X		"68;fc;[1=];" },
X/* DBNZ 35 */   { TS1805 , TS1805, 
X		"68;20.[1#]|;[2=]x" },
X/* DEC 36 */   { 0 , 0, 
X		"20.[1#]|;" },
X/* DIS 37 */   { 0 , 0, 
X		"71;" },
X/* DSAV 38 */   { TS1805 , TS1805, 
X		"68;76;" },
X/* DSBI 39 */   { TS1805 , TS1805, 
X		"68;7f;[1=];" },
X/* DSM 40 */   { TS1805 , TS1805, 
X		"68;f7;" },
X/* DSMB 41 */   { TS1805 , TS1805, 
X		"68;77;" },
X/* DSMI 42 */   { TS1805 , TS1805, 
X		"68;ff;[1=];" },
X/* DTC 43 */   { TS1805 , TS1805, 
X		"68;01;" },
X/* ETQ 44 */   { TS1805 , TS1805, 
X		"68;09;" },
X/* GEC 45 */   { TS1805 , TS1805, 
X		"68;08;" },
X/* GHI 46 */   { 0 , 0, 
X		"90.[1#]|;" },
X/* GLO 47 */   { 0 , 0, 
X		"80.[1#]|;" },
X/* IDL 48 */   { 0 , 0, 
X		"00;" },
X/* INC 49 */   { 0 , 0, 
X		"10.[1#]|;" },
X/* INP 50 */   { 0 , 0, 
X		"68.[1#]|;" },
X/* IRX 51 */   { 0 , 0, 
X		"60;" },
X/* LBDF 52 */   { 0 , 0, 
X		"c3;[1=]x" },
X/* LBNF 53 */   { 0 , 0, 
X		"cb;[1=]x" },
X/* LBNQ 54 */   { 0 , 0, 
X		"c9;[1=]x" },
X/* LBNZ 55 */   { 0 , 0, 
X		"ca;[1=]x" },
X/* LBQ 56 */   { 0 , 0, 
X		"c1;[1=]x" },
X/* LBR 57 */   { 0 , 0, 
X		"c0;[1=]x" },
X/* LBZ 58 */   { 0 , 0, 
X		"c2;[1=]x" },
X/* LDA 59 */   { 0 , 0, 
X		"40.[1#]|;" },
X/* LDC 60 */   { TS1805 , TS1805, 
X		"68;06;" },
X/* LDI 61 */   { 0 , 0, 
X		"f8;[1=];" },
X/* LDN 62 */   { 0 , 0, 
X		"00.[1#]|;" },
X/* LDX 63 */   { 0 , 0, 
X		"f0;" },
X/* LDXA 64 */   { 0 , 0, 
X		"72;" },
X/* LSDF 65 */   { 0 , 0, 
X		"cf;" },
X/* LSIE 66 */   { 0 , 0, 
X		"cc;" },
X/* LSKP 67 */   { 0 , 0, 
X		"c8;" },
X/* LSNF 68 */   { 0 , 0, 
X		"c7;" },
X/* LSNQ 69 */   { 0 , 0, 
X		"c5;" },
X/* LSNZ 70 */   { 0 , 0, 
X		"c6;" },
X/* LSQ 71 */   { 0 , 0, 
X		"cd;" },
X/* LSZ 72 */   { 0 , 0, 
X		"ce;" },
X/* MARK 73 */   { 0 , 0, 
X		"79;" },
X/* NBR 74 */   { 0 , 0, 
X		"38;[1=].Q.ff00&-~.0<T!;" },
X/* NLBR 75 */   { 0 , 0, 
X		"c8;[1=]x" },
X/* NOP 76 */   { 0 , 0, 
X		"c4;" },
X/* OR 77 */   { 0 , 0, 
X		"f1;" },
X/* ORI 78 */   { 0 , 0, 
X		"f9;[1=];" },
X/* OUT 79 */   { 0 , 0, 
X		"60.[1#]|;" },
X/* PHI 80 */   { 0 , 0, 
X		"b0.[1#]|;" },
X/* PLO 81 */   { 0 , 0, 
X		"a0.[1#]|;" },
X/* REQ 82 */   { 0 , 0, 
X		"7a;" },
X/* RET 83 */   { 0 , 0, 
X		"70;" },
X/* RLDI 84 */   { TS1805 , TS1805, 
X		"68;c0.[1#]|;[2=]x" },
X/* RLXA 85 */   { TS1805 , TS1805, 
X		"68;60.[1#]|;" },
X/* RNX 86 */   { TS1805 , TS1805, 
X		"68;b0.[1#]|;" },
X/* RSHL 87 */   { 0 , 0, 
X		"7e;" },
X/* RSHR 88 */   { 0 , 0, 
X		"76;" },
X/* RSXD 89 */   { TS1805 , TS1805, 
X		"68;a0.[1#]|;" },
X/* SAV 90 */   { 0 , 0, 
X		"78;" },
X/* SCAL 91 */   { TS1805 , TS1805, 
X		"68;80.[1#]|;[2=]x" },
X/* SCM1 92 */   { TS1805 , TS1805, 
X		"68;05;" },
X/* SCM2 93 */   { TS1805 , TS1805, 
X		"68;03;" },
X/* SD 94 */   { 0 , 0, 
X		"f5;" },
X/* SDB 95 */   { 0 , 0, 
X		"75;" },
X/* SDBI 96 */   { 0 , 0, 
X		"7d;[1=];" },
X/* SDI 97 */   { 0 , 0, 
X		"fd;[1=];" },
X/* SEP 98 */   { 0 , 0, 
X		"d0.[1#]|;" },
X/* SEQ 99 */   { 0 , 0, 
X		"7b;" },
X/* SEX 100 */   { 0 , 0, 
X		"e0.[1#]|;" },
X/* SHL 101 */   { 0 , 0, 
X		"fe;" },
X/* SHLC 102 */   { 0 , 0, 
X		"7e;" },
X/* SHR 103 */   { 0 , 0, 
X		"f6;" },
X/* SHRC 104 */   { 0 , 0, 
X		"76;" },
X/* SKP 105 */   { 0 , 0, 
X		"38;" },
X/* SM 106 */   { 0 , 0, 
X		"f7;" },
X/* SMB 107 */   { 0 , 0, 
X		"77;" },
X/* SMBI 108 */   { 0 , 0, 
X		"7f;[1=];" },
X/* SMI 109 */   { 0 , 0, 
X		"ff;[1=];" },
X/* SPM1 110 */   { TS1805 , TS1805, 
X		"68;04;" },
X/* SPM2 111 */   { TS1805 , TS1805, 
X		"68;02;" },
X/* SRET 112 */   { TS1805 , TS1805, 
X		"68;90.[1#]|;" },
X/* STM 113 */   { TS1805 , TS1805, 
X		"68;07;" },
X/* STPC 114 */   { TS1805 , TS1805, 
X		"68;00;" },
X/* STR 115 */   { 0 , 0, 
X		"50.[1#]|;" },
X/* STXD 116 */   { 0 , 0, 
X		"73;" },
X/* XID 117 */   { TS1805 , TS1805, 
X		"68;0b;" },
X/* XIE 118 */   { TS1805 , TS1805, 
X		"68;0a;" },
X/* XOR 119 */   { 0 , 0, 
X		"f3;" },
X/* XRI 120 */   { 0 , 0, 
X		"fb;[1=];" },
X	{ 0,0,""} };
X/* end fraptabdef.c */
SHAR_EOF
true || echo 'restore of as1805.y failed'
fi
exit 0



More information about the Alt.sources mailing list