Frankenstein Cross Assemblers, Motorola 6805 "Flavor", Part 1 of 1

Mark Zenier markz at ssc.UUCP
Tue Dec 4 18:53:09 AEST 1990


---- Cut Here and feed the following to sh ----
#!/bin/sh
# This is Frankasm/As6805, a shell archive (shar 3.43)
# made 12/04/1990 06:55 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
# ------ ---------- ------------------------------------------
#   1488 -r--r----- as6805.1
#   6429 -r--r----- as6805.doc
#   2569 -r--r----- as6805.tst
#   5653 -r--r--r-- as6805.tut
#  35559 -r--r--r-- as6805.y
#
# ============= as6805.1 ==============
if test -f 'as6805.1' -a X"$1" != X"-c"; then
	echo 'x - skipping as6805.1 (File already exists)'
else
echo 'x - extracting as6805.1 (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'as6805.1' &&
X.TH AS6805 1L
X.SH NAME
Xas6805 \- cross assemblers for microcomputers
X.SH SYNOPSIS
X.nf
Xas6805 [-p cpu] [-l listfile] [-o hexfile] [-d] [-s symbolfile] input
X.fi
X.SH DESCRIPTION
XThe namelist command 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
X146805, 68hc05, 68HC05, 63L05, 6305, 6805
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 as6805 Frankenstein Assembler (file as6805.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.
XFinally the input file can select which subset to use with the CPU statement.
X
XThere should only be one executable file with all of its names linked to it.
SHAR_EOF
true || echo 'restore of as6805.1 failed'
fi
# ============= as6805.doc ==============
if test -f 'as6805.doc' -a X"$1" != X"-c"; then
	echo 'x - skipping as6805.doc (File already exists)'
else
echo 'x - extracting as6805.doc (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'as6805.doc' &&
X.HM A 1 1 1 1 1 1
X.H 1 "Appendix for as6805 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 3 "Machine Dependent Pseudo Operations"
X.H 4 "Instruction Set Selection"
X.DS I N
XCPU string
X.DE
XThe instruction set can be specified in the source file with the CPU 
Xpseudooperation.
XThe string, delimited by quotes or apostrophes, is scanned for a
Xsubstring which selects which instruction set is used.
XWhen the program is invoked, this operation is performed on the name of
Xthe program, then the -p optional arguement, if any, and then any CPU
Xstatements.
XThe last one selects which subset of the instructions the assembler will
Xaccept.
XThe instruction set can be changed at any place in the source file. 
X.VL 30 5 1
X.LI "Instruction Set"
XSubstrings
X.LI "68hc05"
Xhc
XHC
X.LI "146805"
X4
X.LI "6305"
X3
X.LI "6805"
X05
Xl05
XL05
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	 '#' expr
XADC	 expr	DIRECT
XADC	 expr	EXTENDED
XADC	 indexed	INDEX0
XADC	 indexed	INDEX1
XADC	 indexed	INDEX2
X.sp
XADD	 '#' expr
XADD	 expr	DIRECT
XADD	 expr	EXTENDED
XADD	 indexed	INDEX0
XADD	 indexed	INDEX1
XADD	 indexed	INDEX2
X.sp
XAND	 '#' expr
XAND	 expr	DIRECT
XAND	 expr	EXTENDED
XAND	 indexed	INDEX0
XAND	 indexed	INDEX1
XAND	 indexed	INDEX2
X.sp
XASL	 expr	DIRECT
XASL	 indexed	INDEX0
XASL	 indexed	INDEX1
X.sp
XASLA	
X.sp
XASLX	
X.sp
XASR	 expr	DIRECT
XASR	 indexed	INDEX0
XASR	 indexed	INDEX1
X.sp
XASRA	
X.sp
XASRX	
X.sp
XBCC	 expr
X.sp
XBCLR	 expr ',' expr
X.sp
XBCS	 expr
X.sp
XBEQ	 expr
X.sp
XBHCC	 expr
X.sp
XBHCS	 expr
X.sp
XBHI	 expr
X.sp
XBHS	 expr
X.sp
XBIH	 expr
X.sp
XBIL	 expr
X.sp
XBIT	 '#' expr
XBIT	 expr	DIRECT
XBIT	 expr	EXTENDED
XBIT	 indexed	INDEX0
XBIT	 indexed	INDEX1
XBIT	 indexed	INDEX2
X.sp
XBLO	 expr
X.sp
XBLS	 expr
X.sp
XBMC	 expr
X.sp
XBMI	 expr
X.sp
XBMS	 expr
X.sp
XBNE	 expr
X.sp
XBPL	 expr
X.sp
XBRA	 expr
X.sp
XBRCLR	 expr ',' expr ',' expr
X.sp
XBRN	 expr
X.sp
XBRSET	 expr ',' expr ',' expr
X.sp
XBSET	 expr ',' expr
X.sp
XBSR	 expr
X.sp
XCLC	
X.sp
XCLI	
X.sp
XCLR	 expr	DIRECT
XCLR	 indexed	INDEX0
XCLR	 indexed	INDEX1
X.sp
XCLRA	
X.sp
XCLRX	
X.sp
XCMP	 '#' expr
XCMP	 expr	DIRECT
XCMP	 expr	EXTENDED
XCMP	 indexed	INDEX0
XCMP	 indexed	INDEX1
XCMP	 indexed	INDEX2
X.sp
XCOM	 expr	DIRECT
XCOM	 indexed	INDEX0
XCOM	 indexed	INDEX1
X.sp
XCOMA	
X.sp
XCOMX	
X.sp
XCPX	 '#' expr
XCPX	 expr	DIRECT
XCPX	 expr	EXTENDED
XCPX	 indexed	INDEX0
XCPX	 indexed	INDEX1
XCPX	 indexed	INDEX2
X.sp
XDAA		INSTDAA
X.sp
XDEC	 expr	DIRECT
XDEC	 indexed	INDEX0
XDEC	 indexed	INDEX1
X.sp
XDECA	
X.sp
XDECX	
X.sp
XEOR	 '#' expr
XEOR	 expr	DIRECT
XEOR	 expr	EXTENDED
XEOR	 indexed	INDEX0
XEOR	 indexed	INDEX1
XEOR	 indexed	INDEX2
X.sp
XINC	 expr	DIRECT
XINC	 indexed	INDEX0
XINC	 indexed	INDEX1
X.sp
XINCA	
X.sp
XINCX	
X.sp
XJMP	 expr	DIRECT
XJMP	 expr	EXTENDED
XJMP	 indexed	INDEX0
XJMP	 indexed	INDEX1
XJMP	 indexed	INDEX2
X.sp
XJSR	 expr	DIRECT
XJSR	 expr	EXTENDED
XJSR	 indexed	INDEX0
XJSR	 indexed	INDEX1
XJSR	 indexed	INDEX2
X.sp
XLDA	 '#' expr
XLDA	 expr	DIRECT
XLDA	 expr	EXTENDED
XLDA	 indexed	INDEX0
XLDA	 indexed	INDEX1
XLDA	 indexed	INDEX2
X.sp
XLDX	 '#' expr
XLDX	 expr	DIRECT
XLDX	 expr	EXTENDED
XLDX	 indexed	INDEX0
XLDX	 indexed	INDEX1
XLDX	 indexed	INDEX2
X.sp
XLSL	 expr	DIRECT
XLSL	 indexed	INDEX0
XLSL	 indexed	INDEX1
X.sp
XLSLA	
X.sp
XLSLX	
X.sp
XLSR	 expr	DIRECT
XLSR	 indexed	INDEX0
XLSR	 indexed	INDEX1
X.sp
XLSRA	
X.sp
XLSRX	
X.sp
XMUL		INSTMUL
X.sp
XNEG	 expr	DIRECT
XNEG	 indexed	INDEX0
XNEG	 indexed	INDEX1
X.sp
XNEGA	
X.sp
XNEGX	
X.sp
XNOP	
X.sp
XORA	 '#' expr
XORA	 expr	DIRECT
XORA	 expr	EXTENDED
XORA	 indexed	INDEX0
XORA	 indexed	INDEX1
XORA	 indexed	INDEX2
X.sp
XROL	 expr	DIRECT
XROL	 indexed	INDEX0
XROL	 indexed	INDEX1
X.sp
XROLA	
X.sp
XROLX	
X.sp
XROR	 expr	DIRECT
XROR	 indexed	INDEX0
XROR	 indexed	INDEX1
X.sp
XRORA	
X.sp
XRORX	
X.sp
XRSP	
X.sp
XRTI	
X.sp
XRTS	
X.sp
XSBC	 '#' expr
XSBC	 expr	DIRECT
XSBC	 expr	EXTENDED
XSBC	 indexed	INDEX0
XSBC	 indexed	INDEX1
XSBC	 indexed	INDEX2
X.sp
XSEC	
X.sp
XSEI	
X.sp
XSTA	 expr	DIRECT
XSTA	 expr	EXTENDED
XSTA	 indexed	INDEX0
XSTA	 indexed	INDEX1
XSTA	 indexed	INDEX2
X.sp
XSTOP		INSTSTWA
X.sp
XSTX	 expr	DIRECT
XSTX	 expr	EXTENDED
XSTX	 indexed	INDEX0
XSTX	 indexed	INDEX1
XSTX	 indexed	INDEX2
X.sp
XSUB	 '#' expr
XSUB	 expr	DIRECT
XSUB	 expr	EXTENDED
XSUB	 indexed	INDEX0
XSUB	 indexed	INDEX1
XSUB	 indexed	INDEX2
X.sp
XSWI	
X.sp
XTAX	
X.sp
XTST	 expr	DIRECT
XTST	 indexed	INDEX0
XTST	 indexed	INDEX1
X.sp
XTSTA	
X.sp
XTSTX	
X.sp
XTXA	
X.sp
XWAIT		INSTSTWA
X.TE
X.H 3 "Selection Criteria Keywords"
X.VL 25 5 
X.LI DIRECT
XThe direct addressing mode can be used if the expression has a value 
Xbetween 0 and 255. 
XThe expression will be treated as a two byte long value if it is not
Xdefined when the statement is processed in the first pass.
X.LI EXTENDED
XThe expression can be a 2 byte long value.
X.LI INDEX0
XThe Indexed addressing mode with no offset can be used.
X.LI INDEX1
XThe Indexed addressing mode with a one byte offset can be used.
X.LI INDEX2
XThe Indexed addressing mode with two byte offset can be used.
X.LI INSTSTWA
XThe instruction is only available in the 146805, 6305, and 68hc05 instruction
Xsets.
X.LI INSTMUL
XThe instruction is only available in the 68hc05 instruction set.
X.LI INSTDAA
XThe instruction is only available in the 6305 instruction set.
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 "Bit Numbers"
XThe bit number expression in the BSET, BCLR, BRCLR, BRSET operations has
Xto have value defined when the instruction is read in the first pass.
XThe value must be between 0 and 7.
X.H 3 "Indexed Addressing"
XThe indexed addressing mode is represented in two ways.
X.P
XFirst, with no offset, the form ",X" is used.
X.P
XSecond, the form "expression, X" is used for both the one and two byte
Xoffsets modes.  
XThe expression will be treated as a two byte long value if it is not
Xdefined when the statement is processed in the first pass.
X.H 3 "Reserved Symbols"
X.H 4 "Machine Dependent Reserved Symbols"
XX
Xx
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 as6805.doc failed'
fi
# ============= as6805.tst ==============
if test -f 'as6805.tst' -a X"$1" != X"-c"; then
	echo 'x - skipping as6805.tst (File already exists)'
else
echo 'x - extracting as6805.tst (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'as6805.tst' &&
X	org	$1234
Ximmed	equ	$55
Xdirect	equ	$22
Xextend	equ	$7654
Xindex1	equ	$77
Xindex2	equ	$3333
X
X	adc	#immed
X	adc	direct
X	adc	extend
X	adc	,x
X	adc	index1,x
X	adc	index2,x
X	add	#immed
X	add	direct
X	add	extend
X	add	,x
X	add	index1,x
X	add	index2,x
X	and	#immed
X	and	direct
X	and	extend
X	and	,x
X	and	index1,x
X	and	index2,x
X	asl	direct
X	asl	,x
X	asl	index1,x
X	asla
X	aslx
X	asr	direct
X	asr	,x
X	asr	index1,x
X	asra
X	asrx
X	bcc	*-23
X	bclr	0,direct
X	bclr	1,direct
X	bclr	2,direct
X	bclr	3,direct
X	bclr	4,direct
X	bclr	5,direct
X	bclr	6,direct
X	bclr	7,direct
X	bcs	*-23
X	beq	*-23
X	bhcc	*-23
X	bhcs	*-23
X	bhi	*-23
X	bhs	*-23
X	bih	*-23
X	bil	*-23
X	bit	#immed
X	bit	direct
X	bit	extend
X	bit	,x
X	bit	index1,x
X	bit	index2,x
X	blo	*-23
X	bls	*-23
X	bmc	*-23
X	bmi	*-23
X	bms	*-23
X	bne	*-23
X	bpl	*-23
X	bra	*-23
X	brclr	0,direct,*-23
X	brclr	1,direct,*-23
X	brclr	2,direct,*-23
X	brclr	3,direct,*-23
X	brclr	4,direct,*-23
X	brclr	5,direct,*-23
X	brclr	6,direct,*-23
X	brclr	7,direct,*-23
X	brn	*-23
X	brset	0,direct,*-23
X	brset	1,direct,*-23
X	brset	2,direct,*-23
X	brset	3,direct,*-23
X	brset	4,direct,*-23
X	brset	5,direct,*-23
X	brset	6,direct,*-23
X	brset	7,direct,*-23
X	bset	0,direct
X	bset	1,direct
X	bset	2,direct
X	bset	3,direct
X	bset	4,direct
X	bset	5,direct
X	bset	6,direct
X	bset	7,direct
X	bsr	*-23
X	clc
X	cli
X	clr	direct
X	clr	,x
X	clr	index1,x
X	clra
X	clrx
X	cmp	#immed
X	cmp	direct
X	cmp	extend
X	cmp	,x
X	cmp	index1,x
X	cmp	index2,x
X	com	direct
X	com	,x
X	com	index1,x
X	coma
X	comx
X	cpx	#immed
X	cpx	direct
X	cpx	extend
X	cpx	,x
X	cpx	index1,x
X	cpx	index2,x
X	dec	direct
X	dec	,x
X	dec	index1,x
X	deca
X	decx
X	eor	#immed
X	eor	direct
X	eor	extend
X	eor	,x
X	eor	index1,x
X	eor	index2,x
X	inc	direct
X	inc	,x
X	inc	index1,x
X	inca
X	incx
X	jmp	direct
X	jmp	extend
X	jmp	,x
X	jmp	index1,x
X	jmp	index2,x
X	jsr	direct
X	jsr	extend
X	jsr	,x
X	jsr	index1,x
X	jsr	index2,x
X	lda	#immed
X	lda	direct
X	lda	extend
X	lda	,x
X	lda	index1,x
X	lda	index2,x
X	ldx	#immed
X	ldx	direct
X	ldx	extend
X	ldx	,x
X	ldx	index1,x
X	ldx	index2,x
X	lsl	direct
X	lsl	,x
X	lsl	index1,x
X	lsla
X	lslx
X	lsr	direct
X	lsr	,x
X	lsr	index1,x
X	lsra
X	lsrx
X	neg	direct
X	neg	,x
X	neg	index1,x
X	nega
X	negx
X	nop
X	ora	#immed
X	ora	direct
X	ora	extend
X	ora	,x
X	ora	index1,x
X	ora	index2,x
X	rol	direct
X	rol	,x
X	rol	index1,x
X	rola
X	rolx
X	ror	direct
X	ror	,x
X	ror	index1,x
X	rora
X	rorx
X	rsp
X	rti
X	rts
X	sbc	#immed
X	sbc	direct
X	sbc	extend
X	sbc	,x
X	sbc	index1,x
X	sbc	index2,x
X	sec
X	sei
X	sta	direct
X	sta	extend
X	sta	,x
X	sta	index1,x
X	sta	index2,x
X	stx	direct
X	stx	extend
X	stx	,x
X	stx	index1,x
X	stx	index2,x
X	sub	#immed
X	sub	direct
X	sub	extend
X	sub	,x
X	sub	index1,x
X	sub	index2,x
X	swi
X	tax
X	tst	direct
X	tst	,x
X	tst	index1,x
X	tsta
X	tstx
X	txa
SHAR_EOF
true || echo 'restore of as6805.tst failed'
fi
# ============= as6805.tut ==============
if test -f 'as6805.tut' -a X"$1" != X"-c"; then
	echo 'x - skipping as6805.tut (File already exists)'
else
echo 'x - extracting as6805.tut (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'as6805.tut' &&
X00000055 immed            00000022 direct           00007654 extend           
X00000077 index1           00003333 index2           
X 0x1234                 	org	$1234
X 0x55                   immed	equ	$55
X 0x22                   direct	equ	$22
X 0x7654                 extend	equ	$7654
X 0x77                   index1	equ	$77
X 0x3333                 index2	equ	$3333
X
X1234 a9 55 			adc	#immed
X1236 b9 22 			adc	direct
X1238 c9 76 54 			adc	extend
X123b f9 			adc	,x
X123c e9 77 			adc	index1,x
X123e d9 33 33 			adc	index2,x
X1241 ab 55 			add	#immed
X1243 bb 22 			add	direct
X1245 cb 76 54 			add	extend
X1248 fb 			add	,x
X1249 eb 77 			add	index1,x
X124b db 33 33 			add	index2,x
X124e a4 55 			and	#immed
X1250 b4 22 			and	direct
X1252 c4 76 54 			and	extend
X1255 f4 			and	,x
X1256 e4 77 			and	index1,x
X1258 d4 33 33 			and	index2,x
X125b 38 22 			asl	direct
X125d 78 			asl	,x
X125e 68 77 			asl	index1,x
X1260 48 			asla
X1261 58 			aslx
X1262 37 22 			asr	direct
X1264 77 			asr	,x
X1265 67 77 			asr	index1,x
X1267 47 			asra
X1268 57 			asrx
X1269 24 e7 			bcc	*-23
X126b 11 22 			bclr	0,direct
X126d 13 22 			bclr	1,direct
X126f 15 22 			bclr	2,direct
X1271 17 22 			bclr	3,direct
X1273 19 22 			bclr	4,direct
X1275 1b 22 			bclr	5,direct
X1277 1d 22 			bclr	6,direct
X1279 1f 22 			bclr	7,direct
X127b 25 e7 			bcs	*-23
X127d 27 e7 			beq	*-23
X127f 28 e7 			bhcc	*-23
X1281 29 e7 			bhcs	*-23
X1283 22 e7 			bhi	*-23
X1285 24 e7 			bhs	*-23
X1287 2f e7 			bih	*-23
X1289 2e e7 			bil	*-23
X128b a5 55 			bit	#immed
X128d b5 22 			bit	direct
X128f c5 76 54 			bit	extend
X1292 f5 			bit	,x
X1293 e5 77 			bit	index1,x
X1295 d5 33 33 			bit	index2,x
X1298 25 e7 			blo	*-23
X129a 23 e7 			bls	*-23
X129c 2c e7 			bmc	*-23
X129e 2b e7 			bmi	*-23
X12a0 2d e7 			bms	*-23
X12a2 26 e7 			bne	*-23
X12a4 2a e7 			bpl	*-23
X12a6 20 e7 			bra	*-23
X12a8 01 22 e6 			brclr	0,direct,*-23
X12ab 03 22 e6 			brclr	1,direct,*-23
X12ae 05 22 e6 			brclr	2,direct,*-23
X12b1 07 22 e6 			brclr	3,direct,*-23
X12b4 09 22 e6 			brclr	4,direct,*-23
X12b7 0b 22 e6 			brclr	5,direct,*-23
X12ba 0d 22 e6 			brclr	6,direct,*-23
X12bd 0f 22 e6 			brclr	7,direct,*-23
X12c0 21 e7 			brn	*-23
X12c2 00 22 e6 			brset	0,direct,*-23
X12c5 02 22 e6 			brset	1,direct,*-23
X12c8 04 22 e6 			brset	2,direct,*-23
X12cb 06 22 e6 			brset	3,direct,*-23
X12ce 08 22 e6 			brset	4,direct,*-23
X12d1 0a 22 e6 			brset	5,direct,*-23
X12d4 0c 22 e6 			brset	6,direct,*-23
X12d7 0e 22 e6 			brset	7,direct,*-23
X12da 10 22 			bset	0,direct
X12dc 12 22 			bset	1,direct
X12de 14 22 			bset	2,direct
X12e0 16 22 			bset	3,direct
X12e2 18 22 			bset	4,direct
X12e4 1a 22 			bset	5,direct
X12e6 1c 22 			bset	6,direct
X12e8 1e 22 			bset	7,direct
X12ea ad e7 			bsr	*-23
X12ec 98 			clc
X12ed 9a 			cli
X12ee 3f 22 			clr	direct
X12f0 7f 			clr	,x
X12f1 6f 77 			clr	index1,x
X12f3 4f 			clra
X12f4 5f 			clrx
X12f5 a1 55 			cmp	#immed
X12f7 b1 22 			cmp	direct
X12f9 c1 76 54 			cmp	extend
X12fc f1 			cmp	,x
X12fd e1 77 			cmp	index1,x
X12ff d1 33 33 			cmp	index2,x
X1302 33 22 			com	direct
X1304 73 			com	,x
X1305 63 77 			com	index1,x
X1307 43 			coma
X1308 53 			comx
X1309 a3 55 			cpx	#immed
X130b b3 22 			cpx	direct
X130d c3 76 54 			cpx	extend
X1310 f3 			cpx	,x
X1311 e3 77 			cpx	index1,x
X1313 d3 33 33 			cpx	index2,x
X1316 3a 22 			dec	direct
X1318 7a 			dec	,x
X1319 6a 77 			dec	index1,x
X131b 4a 			deca
X131c 5a 			decx
X131d a8 55 			eor	#immed
X131f b8 22 			eor	direct
X1321 c8 76 54 			eor	extend
X1324 f8 			eor	,x
X1325 e8 77 			eor	index1,x
X1327 d8 33 33 			eor	index2,x
X132a 3c 22 			inc	direct
X132c 7c 			inc	,x
X132d 6c 77 			inc	index1,x
X132f 4c 			inca
X1330 5c 			incx
X1331 bc 22 			jmp	direct
X1333 cc 76 54 			jmp	extend
X1336 fc 			jmp	,x
X1337 ec 77 			jmp	index1,x
X1339 dc 33 33 			jmp	index2,x
X133c bd 22 			jsr	direct
X133e cd 76 54 			jsr	extend
X1341 fd 			jsr	,x
X1342 ed 77 			jsr	index1,x
X1344 dd 33 33 			jsr	index2,x
X1347 a6 55 			lda	#immed
X1349 b6 22 			lda	direct
X134b c6 76 54 			lda	extend
X134e f6 			lda	,x
X134f e6 77 			lda	index1,x
X1351 d6 33 33 			lda	index2,x
X1354 ae 55 			ldx	#immed
X1356 be 22 			ldx	direct
X1358 ce 76 54 			ldx	extend
X135b fe 			ldx	,x
X135c ee 77 			ldx	index1,x
X135e de 33 33 			ldx	index2,x
X1361 38 22 			lsl	direct
X1363 78 			lsl	,x
X1364 68 77 			lsl	index1,x
X1366 48 			lsla
X1367 58 			lslx
X1368 34 22 			lsr	direct
X136a 74 			lsr	,x
X136b 64 77 			lsr	index1,x
X136d 44 			lsra
X136e 54 			lsrx
X136f 30 22 			neg	direct
X1371 70 			neg	,x
X1372 60 77 			neg	index1,x
X1374 40 			nega
X1375 50 			negx
X1376 9d 			nop
X1377 aa 55 			ora	#immed
X1379 ba 22 			ora	direct
X137b ca 76 54 			ora	extend
X137e fa 			ora	,x
X137f ea 77 			ora	index1,x
X1381 da 33 33 			ora	index2,x
X1384 39 22 			rol	direct
X1386 79 			rol	,x
X1387 69 77 			rol	index1,x
X1389 49 			rola
X138a 59 			rolx
X138b 36 22 			ror	direct
X138d 76 			ror	,x
X138e 66 77 			ror	index1,x
X1390 46 			rora
X1391 56 			rorx
X1392 9c 			rsp
X1393 80 			rti
X1394 81 			rts
X1395 a2 55 			sbc	#immed
X1397 b2 22 			sbc	direct
X1399 c2 76 54 			sbc	extend
X139c f2 			sbc	,x
X139d e2 77 			sbc	index1,x
X139f d2 33 33 			sbc	index2,x
X13a2 99 			sec
X13a3 9b 			sei
X13a4 b7 22 			sta	direct
X13a6 c7 76 54 			sta	extend
X13a9 f7 			sta	,x
X13aa e7 77 			sta	index1,x
X13ac d7 33 33 			sta	index2,x
X13af bf 22 			stx	direct
X13b1 cf 76 54 			stx	extend
X13b4 ff 			stx	,x
X13b5 ef 77 			stx	index1,x
X13b7 df 33 33 			stx	index2,x
X13ba a0 55 			sub	#immed
X13bc b0 22 			sub	direct
X13be c0 76 54 			sub	extend
X13c1 f0 			sub	,x
X13c2 e0 77 			sub	index1,x
X13c4 d0 33 33 			sub	index2,x
X13c7 83 			swi
X13c8 97 			tax
X13c9 3d 22 			tst	direct
X13cb 7d 			tst	,x
X13cc 6d 77 			tst	index1,x
X13ce 4d 			tsta
X13cf 5d 			tstx
X13d0 9f 			txa
X ERROR SUMMARY - ERRORS DETECTED 0
X               -  WARNINGS       0
SHAR_EOF
true || echo 'restore of as6805.tut failed'
fi
# ============= as6805.y ==============
if test -f 'as6805.y' -a X"$1" != X"-c"; then
	echo 'x - skipping as6805.y (File already exists)'
else
echo 'x - extracting as6805.y (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'as6805.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: 	as6805.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: 	as6805.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/* 6805 instruction generation file */
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/*
X	file		fraselcrit.h
X	author		Mark Zenier
X	description	Selection criteria and token values for 6805
X			framework assembler
X	usage		framework cross assembler
X	history		September 19, 1987
X			October 2, 1987
X			June 7, 1989  fix relative addressing (BRset/clr)
X*/
X	/* selectors for the ST_EXP address */
X	/* 0000 0000 0000 00xx */
X#define ADDR		0x3
X#define DIRECT		0x1
X#define EXTENDED	0x2
X
X	/* selectors for the ST_IND offset */
X	/* 0000 0000 000x xx00 */
X#define INDEXLEN	0x1C
X#define INDEX0		0x4
X#define INDEX1		0x8
X#define INDEX2		0x10
X
X	/* selectors for instruction set extensions */
X	/* 0000 0000 xxx0 0000 */
X#define INSTSTWA	0x20
X#define INSTMUL	0x40
X#define INSTDAA	0x80
X
X	/* cpu instruction extensions */
X#define CPU6805	0
X#define CPU146805	INSTSTWA
X#define CPU68HC05	(INSTSTWA | INSTMUL)
X#define CPU6305	(INSTSTWA | INSTDAA)
X#define ST_BRSET 0x1
X#define ST_BSET 0x2
X#define ST_EXP 0x4
X#define ST_IMM 0x8
X#define ST_IND 0x10
X#define ST_INH 0x20
X	
X	int	cpuselect = CPU6805;
X	static char	genbdef[] = "[1=];";
X	static char	genwdef[] = "[1=]x";
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	struct {int indexv, ex; } inetre;
X}
X
X%token <intv> INDEX
X%type <inetre> indexed
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_CPU
X%token <intv> KOC_opcode
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
Xline	:	KOC_CPU STRING
X			{
X		if( ! cpumatch($2))
X		{
X			fraerror("unknown cpu type, 6805 assumed");
X			cpuselect = CPU6805;
X		}
X			}
X	;
Xgenline : KOC_opcode  expr ',' expr ',' expr
X			{
X		pevalexpr(1,$2);
X		if(evalr[1].seg != SSG_ABS || 
X			evalr[1].value < 0 ||
X			evalr[1].value > 7)
X		{
X			evalr[1].value = 0;
X			fraerror("impossible bit number");
X		}
X		else
X		{
X			evalr[1].value *= 2;
X		}
X		pevalexpr(2,$4);
X		pevalexpr(3,$6);
X		genlocrec(currseg, labelloc);
X		locctr += geninstr( findgen($1, ST_BRSET, 0));
X			}
X	;
Xgenline : KOC_opcode  expr ',' expr
X			{
X		pevalexpr(1,$2);
X		if(evalr[1].seg != SSG_ABS || 
X			evalr[1].value < 0 ||
X			evalr[1].value > 7)
X		{
X			evalr[1].value = 0;
X			fraerror("impossible bit number");
X		}
X		else
X		{
X			evalr[1].value *= 2;
X		}
X		pevalexpr(2,$4);
X		genlocrec(currseg, labelloc);
X		locctr += geninstr( findgen( $1, ST_BSET, 0));
X			}
X	;
Xgenline : KOC_opcode  expr
X			{
X		pevalexpr(1, $2);
X		genlocrec(currseg, labelloc);
X		locctr += geninstr( findgen( $1, ST_EXP, 
X				  ( (evalr[1].seg == SSG_ABS 
X				&& evalr[1].value >= 0
X				&& evalr[1].value <= 255 )
X				? DIRECT : EXTENDED ) )
X				);
X			}
X	;
Xgenline : KOC_opcode  '#' expr
X			{
X		pevalexpr(1, $3);
X		genlocrec(currseg, labelloc);
X		locctr += geninstr( findgen($1, ST_IMM, 0));
X			}
X	;
Xgenline : KOC_opcode  indexed
X			{
X		int selcrit = INDEX2;
X
X		pevalexpr(1, $2.ex);
X
X		if(evalr[1].seg == SSG_ABS)
X		{
X			if(evalr[1].value == 0)
X			{
X				selcrit = INDEX0;
X			}
X			else if(evalr[1].value > 0 && evalr[1].value <= 255)
X			{
X				selcrit = INDEX1;
X			}
X		}
X
X		genlocrec(currseg, labelloc);
X		locctr += geninstr( findgen($1, ST_IND, selcrit));
X			}
X	;
Xgenline : KOC_opcode 
X			{
X		genlocrec(currseg, labelloc);
X		locctr += geninstr(findgen($1, ST_INH, cpuselect));
X			}
X	;
X
Xindexed	:	',' INDEX	
X			{
X				$$.indexv = $2;
X				$$.ex = exprnode(PCCASE_CONS,0,
X					IGP_CONSTANT,0,
X					(long)0, SYMNULL);
X			}
X	|	expr ',' INDEX
X			{
X				$$.ex = $1;
X				$$.indexv = $3;
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/* machine dependent */
X	reservedsym("x", INDEX, 0);
X	reservedsym("X", INDEX, 0);
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		{"4", CPU146805 },
X		{"hc", CPU68HC05 },
X		{"HC", CPU68HC05 },
X		{"l05", CPU6805 },
X		{"L05", CPU6805 },
X		{"3", CPU6305 },
X		{"05", CPU6805 },
X		{"", 0} 
X	};
X
X	for(msub = 0; matchtab[msub].mtch[0] != '\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 115
X#define NUMSYNBLK 132
X#define NUMDIFFOP 192
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, 3, 2 },
X	{"ADD", KOC_opcode, 3, 5 },
X	{"AND", KOC_opcode, 3, 8 },
X	{"ASL", KOC_opcode, 2, 11 },
X	{"ASLA", KOC_opcode, 1, 13 },
X	{"ASLX", KOC_opcode, 1, 14 },
X	{"ASR", KOC_opcode, 2, 15 },
X	{"ASRA", KOC_opcode, 1, 17 },
X	{"ASRX", KOC_opcode, 1, 18 },
X	{"BCC", KOC_opcode, 1, 19 },
X	{"BCLR", KOC_opcode, 1, 20 },
X	{"BCS", KOC_opcode, 1, 21 },
X	{"BEQ", KOC_opcode, 1, 22 },
X	{"BHCC", KOC_opcode, 1, 23 },
X	{"BHCS", KOC_opcode, 1, 24 },
X	{"BHI", KOC_opcode, 1, 25 },
X	{"BHS", KOC_opcode, 1, 26 },
X	{"BIH", KOC_opcode, 1, 27 },
X	{"BIL", KOC_opcode, 1, 28 },
X	{"BIT", KOC_opcode, 3, 29 },
X	{"BLO", KOC_opcode, 1, 32 },
X	{"BLS", KOC_opcode, 1, 33 },
X	{"BMC", KOC_opcode, 1, 34 },
X	{"BMI", KOC_opcode, 1, 35 },
X	{"BMS", KOC_opcode, 1, 36 },
X	{"BNE", KOC_opcode, 1, 37 },
X	{"BPL", KOC_opcode, 1, 38 },
X	{"BRA", KOC_opcode, 1, 39 },
X	{"BRCLR", KOC_opcode, 1, 40 },
X	{"BRN", KOC_opcode, 1, 41 },
X	{"BRSET", KOC_opcode, 1, 42 },
X	{"BSET", KOC_opcode, 1, 43 },
X	{"BSR", KOC_opcode, 1, 44 },
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	{"CLC", KOC_opcode, 1, 45 },
X	{"CLI", KOC_opcode, 1, 46 },
X	{"CLR", KOC_opcode, 2, 47 },
X	{"CLRA", KOC_opcode, 1, 49 },
X	{"CLRX", KOC_opcode, 1, 50 },
X	{"CMP", KOC_opcode, 3, 51 },
X	{"COM", KOC_opcode, 2, 54 },
X	{"COMA", KOC_opcode, 1, 56 },
X	{"COMX", KOC_opcode, 1, 57 },
X	{"CPU", KOC_CPU, 0, 0 },
X	{"CPX", KOC_opcode, 3, 58 },
X	{"DAA", KOC_opcode, 1, 61 },
X	{"DB", KOC_BDEF, 0, 0 },
X	{"DEC", KOC_opcode, 2, 62 },
X	{"DECA", KOC_opcode, 1, 64 },
X	{"DECX", KOC_opcode, 1, 65 },
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	{"EOR", KOC_opcode, 3, 66 },
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	{"IF", KOC_IF, 0, 0 },
X	{"INC", KOC_opcode, 2, 69 },
X	{"INCA", KOC_opcode, 1, 71 },
X	{"INCL", KOC_INCLUDE, 0, 0 },
X	{"INCLUDE", KOC_INCLUDE, 0, 0 },
X	{"INCX", KOC_opcode, 1, 72 },
X	{"JMP", KOC_opcode, 2, 73 },
X	{"JSR", KOC_opcode, 2, 75 },
X	{"LDA", KOC_opcode, 3, 77 },
X	{"LDX", KOC_opcode, 3, 80 },
X	{"LSL", KOC_opcode, 2, 83 },
X	{"LSLA", KOC_opcode, 1, 85 },
X	{"LSLX", KOC_opcode, 1, 86 },
X	{"LSR", KOC_opcode, 2, 87 },
X	{"LSRA", KOC_opcode, 1, 89 },
X	{"LSRX", KOC_opcode, 1, 90 },
X	{"MUL", KOC_opcode, 1, 91 },
X	{"NEG", KOC_opcode, 2, 92 },
X	{"NEGA", KOC_opcode, 1, 94 },
X	{"NEGX", KOC_opcode, 1, 95 },
X	{"NOP", KOC_opcode, 1, 96 },
X	{"ORA", KOC_opcode, 3, 97 },
X	{"ORG", KOC_ORG, 0, 0 },
X	{"RESERVE", KOC_RESM, 0, 0 },
X	{"RMB", KOC_RESM, 0, 0 },
X	{"ROL", KOC_opcode, 2, 100 },
X	{"ROLA", KOC_opcode, 1, 102 },
X	{"ROLX", KOC_opcode, 1, 103 },
X	{"ROR", KOC_opcode, 2, 104 },
X	{"RORA", KOC_opcode, 1, 106 },
X	{"RORX", KOC_opcode, 1, 107 },
X	{"RSP", KOC_opcode, 1, 108 },
X	{"RTI", KOC_opcode, 1, 109 },
X	{"RTS", KOC_opcode, 1, 110 },
X	{"SBC", KOC_opcode, 3, 111 },
X	{"SEC", KOC_opcode, 1, 114 },
X	{"SEI", KOC_opcode, 1, 115 },
X	{"SET", KOC_SET, 0, 0 },
X	{"STA", KOC_opcode, 2, 116 },
X	{"STOP", KOC_opcode, 1, 118 },
X	{"STRING", KOC_SDEF, 0, 0 },
X	{"STX", KOC_opcode, 2, 119 },
X	{"SUB", KOC_opcode, 3, 121 },
X	{"SWI", KOC_opcode, 1, 124 },
X	{"TAX", KOC_opcode, 1, 125 },
X	{"TST", KOC_opcode, 2, 126 },
X	{"TSTA", KOC_opcode, 1, 128 },
X	{"TSTX", KOC_opcode, 1, 129 },
X	{"TXA", KOC_opcode, 1, 130 },
X	{"WAIT", KOC_opcode, 1, 131 },
X	{"WORD", KOC_WDEF, 0, 0 },
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_EXP, 2, 2 },
X/* ADC 3 */ { ST_IMM, 1, 4 },
X/* ADC 4 */ { ST_IND, 3, 5 },
X/* ADD 5 */ { ST_EXP, 2, 8 },
X/* ADD 6 */ { ST_IMM, 1, 10 },
X/* ADD 7 */ { ST_IND, 3, 11 },
X/* AND 8 */ { ST_EXP, 2, 14 },
X/* AND 9 */ { ST_IMM, 1, 16 },
X/* AND 10 */ { ST_IND, 3, 17 },
X/* ASL 11 */ { ST_EXP, 1, 20 },
X/* ASL 12 */ { ST_IND, 2, 21 },
X/* ASLA 13 */ { ST_INH, 1, 23 },
X/* ASLX 14 */ { ST_INH, 1, 24 },
X/* ASR 15 */ { ST_EXP, 1, 25 },
X/* ASR 16 */ { ST_IND, 2, 26 },
X/* ASRA 17 */ { ST_INH, 1, 28 },
X/* ASRX 18 */ { ST_INH, 1, 29 },
X/* BCC 19 */ { ST_EXP, 1, 30 },
X/* BCLR 20 */ { ST_BSET, 1, 31 },
X/* BCS 21 */ { ST_EXP, 1, 32 },
X/* BEQ 22 */ { ST_EXP, 1, 33 },
X/* BHCC 23 */ { ST_EXP, 1, 34 },
X/* BHCS 24 */ { ST_EXP, 1, 35 },
X/* BHI 25 */ { ST_EXP, 1, 36 },
X/* BHS 26 */ { ST_EXP, 1, 37 },
X/* BIH 27 */ { ST_EXP, 1, 38 },
X/* BIL 28 */ { ST_EXP, 1, 39 },
X/* BIT 29 */ { ST_EXP, 2, 40 },
X/* BIT 30 */ { ST_IMM, 1, 42 },
X/* BIT 31 */ { ST_IND, 3, 43 },
X/* BLO 32 */ { ST_EXP, 1, 46 },
X/* BLS 33 */ { ST_EXP, 1, 47 },
X/* BMC 34 */ { ST_EXP, 1, 48 },
X/* BMI 35 */ { ST_EXP, 1, 49 },
X/* BMS 36 */ { ST_EXP, 1, 50 },
X/* BNE 37 */ { ST_EXP, 1, 51 },
X/* BPL 38 */ { ST_EXP, 1, 52 },
X/* BRA 39 */ { ST_EXP, 1, 53 },
X/* BRCLR 40 */ { ST_BRSET, 1, 54 },
X/* BRN 41 */ { ST_EXP, 1, 55 },
X/* BRSET 42 */ { ST_BRSET, 1, 56 },
X/* BSET 43 */ { ST_BSET, 1, 57 },
X/* BSR 44 */ { ST_EXP, 1, 58 },
X/* CLC 45 */ { ST_INH, 1, 59 },
X/* CLI 46 */ { ST_INH, 1, 60 },
X/* CLR 47 */ { ST_EXP, 1, 61 },
X/* CLR 48 */ { ST_IND, 2, 62 },
X/* CLRA 49 */ { ST_INH, 1, 64 },
X/* CLRX 50 */ { ST_INH, 1, 65 },
X/* CMP 51 */ { ST_EXP, 2, 66 },
X/* CMP 52 */ { ST_IMM, 1, 68 },
X/* CMP 53 */ { ST_IND, 3, 69 },
X/* COM 54 */ { ST_EXP, 1, 72 },
X/* COM 55 */ { ST_IND, 2, 73 },
X/* COMA 56 */ { ST_INH, 1, 75 },
X/* COMX 57 */ { ST_INH, 1, 76 },
X/* CPX 58 */ { ST_EXP, 2, 77 },
X/* CPX 59 */ { ST_IMM, 1, 79 },
X/* CPX 60 */ { ST_IND, 3, 80 },
X/* DAA 61 */ { ST_INH, 1, 83 },
X/* DEC 62 */ { ST_EXP, 1, 84 },
X/* DEC 63 */ { ST_IND, 2, 85 },
X/* DECA 64 */ { ST_INH, 1, 87 },
X/* DECX 65 */ { ST_INH, 1, 88 },
X/* EOR 66 */ { ST_EXP, 2, 89 },
X/* EOR 67 */ { ST_IMM, 1, 91 },
X/* EOR 68 */ { ST_IND, 3, 92 },
X/* INC 69 */ { ST_EXP, 1, 95 },
X/* INC 70 */ { ST_IND, 2, 96 },
X/* INCA 71 */ { ST_INH, 1, 98 },
X/* INCX 72 */ { ST_INH, 1, 99 },
X/* JMP 73 */ { ST_EXP, 2, 100 },
X/* JMP 74 */ { ST_IND, 3, 102 },
X/* JSR 75 */ { ST_EXP, 2, 105 },
X/* JSR 76 */ { ST_IND, 3, 107 },
X/* LDA 77 */ { ST_EXP, 2, 110 },
X/* LDA 78 */ { ST_IMM, 1, 112 },
X/* LDA 79 */ { ST_IND, 3, 113 },
X/* LDX 80 */ { ST_EXP, 2, 116 },
X/* LDX 81 */ { ST_IMM, 1, 118 },
X/* LDX 82 */ { ST_IND, 3, 119 },
X/* LSL 83 */ { ST_EXP, 1, 122 },
X/* LSL 84 */ { ST_IND, 2, 123 },
X/* LSLA 85 */ { ST_INH, 1, 125 },
X/* LSLX 86 */ { ST_INH, 1, 126 },
X/* LSR 87 */ { ST_EXP, 1, 127 },
X/* LSR 88 */ { ST_IND, 2, 128 },
X/* LSRA 89 */ { ST_INH, 1, 130 },
X/* LSRX 90 */ { ST_INH, 1, 131 },
X/* MUL 91 */ { ST_INH, 1, 132 },
X/* NEG 92 */ { ST_EXP, 1, 133 },
X/* NEG 93 */ { ST_IND, 2, 134 },
X/* NEGA 94 */ { ST_INH, 1, 136 },
X/* NEGX 95 */ { ST_INH, 1, 137 },
X/* NOP 96 */ { ST_INH, 1, 138 },
X/* ORA 97 */ { ST_EXP, 2, 139 },
X/* ORA 98 */ { ST_IMM, 1, 141 },
X/* ORA 99 */ { ST_IND, 3, 142 },
X/* ROL 100 */ { ST_EXP, 1, 145 },
X/* ROL 101 */ { ST_IND, 2, 146 },
X/* ROLA 102 */ { ST_INH, 1, 148 },
X/* ROLX 103 */ { ST_INH, 1, 149 },
X/* ROR 104 */ { ST_EXP, 1, 150 },
X/* ROR 105 */ { ST_IND, 2, 151 },
X/* RORA 106 */ { ST_INH, 1, 153 },
X/* RORX 107 */ { ST_INH, 1, 154 },
X/* RSP 108 */ { ST_INH, 1, 155 },
X/* RTI 109 */ { ST_INH, 1, 156 },
X/* RTS 110 */ { ST_INH, 1, 157 },
X/* SBC 111 */ { ST_EXP, 2, 158 },
X/* SBC 112 */ { ST_IMM, 1, 160 },
X/* SBC 113 */ { ST_IND, 3, 161 },
X/* SEC 114 */ { ST_INH, 1, 164 },
X/* SEI 115 */ { ST_INH, 1, 165 },
X/* STA 116 */ { ST_EXP, 2, 166 },
X/* STA 117 */ { ST_IND, 3, 168 },
X/* STOP 118 */ { ST_INH, 1, 171 },
X/* STX 119 */ { ST_EXP, 2, 172 },
X/* STX 120 */ { ST_IND, 3, 174 },
X/* SUB 121 */ { ST_EXP, 2, 177 },
X/* SUB 122 */ { ST_IMM, 1, 179 },
X/* SUB 123 */ { ST_IND, 3, 180 },
X/* SWI 124 */ { ST_INH, 1, 183 },
X/* TAX 125 */ { ST_INH, 1, 184 },
X/* TST 126 */ { ST_EXP, 1, 185 },
X/* TST 127 */ { ST_IND, 2, 186 },
X/* TSTA 128 */ { ST_INH, 1, 188 },
X/* TSTX 129 */ { ST_INH, 1, 189 },
X/* TXA 130 */ { ST_INH, 1, 190 },
X/* WAIT 131 */ { ST_INH, 1, 191 },
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 */   { ADDR , DIRECT, 
X		"B9;[1=];" },
X/* ADC 3 */   { ADDR , EXTENDED, 
X		"C9;[1=]x" },
X/* ADC 4 */   { 0 , 0, 
X		"A9;[1=];" },
X/* ADC 5 */   { INDEXLEN , INDEX2, 
X		"D9;[1=]x" },
X/* ADC 6 */   { INDEXLEN , INDEX1, 
X		"E9;[1=];" },
X/* ADC 7 */   { INDEXLEN , INDEX0, 
X		"F9;" },
X/* ADD 8 */   { ADDR , DIRECT, 
X		"BB;[1=];" },
X/* ADD 9 */   { ADDR , EXTENDED, 
X		"CB;[1=]x" },
X/* ADD 10 */   { 0 , 0, 
X		"AB;[1=];" },
X/* ADD 11 */   { INDEXLEN , INDEX2, 
X		"DB;[1=]x" },
X/* ADD 12 */   { INDEXLEN , INDEX1, 
X		"EB;[1=];" },
X/* ADD 13 */   { INDEXLEN , INDEX0, 
X		"FB;" },
X/* AND 14 */   { ADDR , DIRECT, 
X		"B4;[1=];" },
X/* AND 15 */   { ADDR , EXTENDED, 
X		"C4;[1=]x" },
X/* AND 16 */   { 0 , 0, 
X		"A4;[1=];" },
X/* AND 17 */   { INDEXLEN , INDEX2, 
X		"D4;[1=]x" },
X/* AND 18 */   { INDEXLEN , INDEX1, 
X		"E4;[1=];" },
X/* AND 19 */   { INDEXLEN , INDEX0, 
X		"F4;" },
X/* ASL 20 */   { ADDR , DIRECT, 
X		"38;[1=];" },
X/* ASL 21 */   { INDEXLEN , INDEX1, 
X		"68;[1=];" },
X/* ASL 22 */   { INDEXLEN , INDEX0, 
X		"78;" },
X/* ASLA 23 */   { 0 , 0, 
X		"48;" },
X/* ASLX 24 */   { 0 , 0, 
X		"58;" },
X/* ASR 25 */   { ADDR , DIRECT, 
X		"37;[1=];" },
X/* ASR 26 */   { INDEXLEN , INDEX1, 
X		"67;[1=];" },
X/* ASR 27 */   { INDEXLEN , INDEX0, 
X		"77;" },
X/* ASRA 28 */   { 0 , 0, 
X		"47;" },
X/* ASRX 29 */   { 0 , 0, 
X		"57;" },
X/* BCC 30 */   { 0 , 0, 
X		"24;[1=].Q.1+-r" },
X/* BCLR 31 */   { 0 , 0, 
X		"11.[1#]|;[2=];" },
X/* BCS 32 */   { 0 , 0, 
X		"25;[1=].Q.1+-r" },
X/* BEQ 33 */   { 0 , 0, 
X		"27;[1=].Q.1+-r" },
X/* BHCC 34 */   { 0 , 0, 
X		"28;[1=].Q.1+-r" },
X/* BHCS 35 */   { 0 , 0, 
X		"29;[1=].Q.1+-r" },
X/* BHI 36 */   { 0 , 0, 
X		"22;[1=].Q.1+-r" },
X/* BHS 37 */   { 0 , 0, 
X		"24;[1=].Q.1+-r" },
X/* BIH 38 */   { 0 , 0, 
X		"2f;[1=].Q.1+-r" },
X/* BIL 39 */   { 0 , 0, 
X		"2e;[1=].Q.1+-r" },
X/* BIT 40 */   { ADDR , DIRECT, 
X		"B5;[1=];" },
X/* BIT 41 */   { ADDR , EXTENDED, 
X		"C5;[1=]x" },
X/* BIT 42 */   { 0 , 0, 
X		"A5;[1=];" },
X/* BIT 43 */   { INDEXLEN , INDEX2, 
X		"D5;[1=]x" },
X/* BIT 44 */   { INDEXLEN , INDEX1, 
X		"E5;[1=];" },
X/* BIT 45 */   { INDEXLEN , INDEX0, 
X		"F5;" },
X/* BLO 46 */   { 0 , 0, 
X		"25;[1=].Q.1+-r" },
X/* BLS 47 */   { 0 , 0, 
X		"23;[1=].Q.1+-r" },
X/* BMC 48 */   { 0 , 0, 
X		"2c;[1=].Q.1+-r" },
X/* BMI 49 */   { 0 , 0, 
X		"2b;[1=].Q.1+-r" },
X/* BMS 50 */   { 0 , 0, 
X		"2d;[1=].Q.1+-r" },
X/* BNE 51 */   { 0 , 0, 
X		"26;[1=].Q.1+-r" },
X/* BPL 52 */   { 0 , 0, 
X		"2a;[1=].Q.1+-r" },
X/* BRA 53 */   { 0 , 0, 
X		"20;[1=].Q.1+-r" },
X/* BRCLR 54 */   { 0 , 0, 
X		"01.[1#]|;[2=];[3=].Q.1+-r" },
X/* BRN 55 */   { 0 , 0, 
X		"21;[1=].Q.1+-r" },
X/* BRSET 56 */   { 0 , 0, 
X		"00.[1#]|;[2=];[3=].Q.1+-r" },
X/* BSET 57 */   { 0 , 0, 
X		"10.[1#]|;[2=];" },
X/* BSR 58 */   { 0 , 0, 
X		"ad;[1=].Q.1+-r" },
X/* CLC 59 */   { 0 , 0, 
X		"98;" },
X/* CLI 60 */   { 0 , 0, 
X		"9a;" },
X/* CLR 61 */   { ADDR , DIRECT, 
X		"3F;[1=];" },
X/* CLR 62 */   { INDEXLEN , INDEX1, 
X		"6F;[1=];" },
X/* CLR 63 */   { INDEXLEN , INDEX0, 
X		"7F;" },
X/* CLRA 64 */   { 0 , 0, 
X		"4F;" },
X/* CLRX 65 */   { 0 , 0, 
X		"5F;" },
X/* CMP 66 */   { ADDR , DIRECT, 
X		"B1;[1=];" },
X/* CMP 67 */   { ADDR , EXTENDED, 
X		"C1;[1=]x" },
X/* CMP 68 */   { 0 , 0, 
X		"A1;[1=];" },
X/* CMP 69 */   { INDEXLEN , INDEX2, 
X		"D1;[1=]x" },
X/* CMP 70 */   { INDEXLEN , INDEX1, 
X		"E1;[1=];" },
X/* CMP 71 */   { INDEXLEN , INDEX0, 
X		"F1;" },
X/* COM 72 */   { ADDR , DIRECT, 
X		"33;[1=];" },
X/* COM 73 */   { INDEXLEN , INDEX1, 
X		"63;[1=];" },
X/* COM 74 */   { INDEXLEN , INDEX0, 
X		"73;" },
X/* COMA 75 */   { 0 , 0, 
X		"43;" },
X/* COMX 76 */   { 0 , 0, 
X		"53;" },
X/* CPX 77 */   { ADDR , DIRECT, 
X		"B3;[1=];" },
X/* CPX 78 */   { ADDR , EXTENDED, 
X		"C3;[1=]x" },
X/* CPX 79 */   { 0 , 0, 
X		"A3;[1=];" },
X/* CPX 80 */   { INDEXLEN , INDEX2, 
X		"D3;[1=]x" },
X/* CPX 81 */   { INDEXLEN , INDEX1, 
X		"E3;[1=];" },
X/* CPX 82 */   { INDEXLEN , INDEX0, 
X		"F3;" },
X/* DAA 83 */   { INSTDAA , INSTDAA, 
X		"8d;" },
X/* DEC 84 */   { ADDR , DIRECT, 
X		"3A;[1=];" },
X/* DEC 85 */   { INDEXLEN , INDEX1, 
X		"6A;[1=];" },
X/* DEC 86 */   { INDEXLEN , INDEX0, 
X		"7A;" },
X/* DECA 87 */   { 0 , 0, 
X		"4A;" },
X/* DECX 88 */   { 0 , 0, 
X		"5A;" },
X/* EOR 89 */   { ADDR , DIRECT, 
X		"B8;[1=];" },
X/* EOR 90 */   { ADDR , EXTENDED, 
X		"C8;[1=]x" },
X/* EOR 91 */   { 0 , 0, 
X		"A8;[1=];" },
X/* EOR 92 */   { INDEXLEN , INDEX2, 
X		"D8;[1=]x" },
X/* EOR 93 */   { INDEXLEN , INDEX1, 
X		"E8;[1=];" },
X/* EOR 94 */   { INDEXLEN , INDEX0, 
X		"F8;" },
X/* INC 95 */   { ADDR , DIRECT, 
X		"3C;[1=];" },
X/* INC 96 */   { INDEXLEN , INDEX1, 
X		"6C;[1=];" },
X/* INC 97 */   { INDEXLEN , INDEX0, 
X		"7C;" },
X/* INCA 98 */   { 0 , 0, 
X		"4C;" },
X/* INCX 99 */   { 0 , 0, 
X		"5C;" },
X/* JMP 100 */   { ADDR , DIRECT, 
X		"BC;[1=];" },
X/* JMP 101 */   { ADDR , EXTENDED, 
X		"CC;[1=]x" },
X/* JMP 102 */   { INDEXLEN , INDEX2, 
X		"DC;[1=]x" },
X/* JMP 103 */   { INDEXLEN , INDEX1, 
X		"EC;[1=];" },
X/* JMP 104 */   { INDEXLEN , INDEX0, 
X		"FC;" },
X/* JSR 105 */   { ADDR , DIRECT, 
X		"BD;[1=];" },
X/* JSR 106 */   { ADDR , EXTENDED, 
X		"CD;[1=]x" },
X/* JSR 107 */   { INDEXLEN , INDEX2, 
X		"DD;[1=]x" },
X/* JSR 108 */   { INDEXLEN , INDEX1, 
X		"ED;[1=];" },
X/* JSR 109 */   { INDEXLEN , INDEX0, 
X		"FD;" },
X/* LDA 110 */   { ADDR , DIRECT, 
X		"B6;[1=];" },
X/* LDA 111 */   { ADDR , EXTENDED, 
X		"C6;[1=]x" },
X/* LDA 112 */   { 0 , 0, 
X		"A6;[1=];" },
X/* LDA 113 */   { INDEXLEN , INDEX2, 
X		"D6;[1=]x" },
X/* LDA 114 */   { INDEXLEN , INDEX1, 
X		"E6;[1=];" },
X/* LDA 115 */   { INDEXLEN , INDEX0, 
X		"F6;" },
X/* LDX 116 */   { ADDR , DIRECT, 
X		"BE;[1=];" },
X/* LDX 117 */   { ADDR , EXTENDED, 
X		"CE;[1=]x" },
X/* LDX 118 */   { 0 , 0, 
X		"AE;[1=];" },
X/* LDX 119 */   { INDEXLEN , INDEX2, 
X		"DE;[1=]x" },
X/* LDX 120 */   { INDEXLEN , INDEX1, 
X		"EE;[1=];" },
X/* LDX 121 */   { INDEXLEN , INDEX0, 
X		"FE;" },
X/* LSL 122 */   { ADDR , DIRECT, 
X		"38;[1=];" },
X/* LSL 123 */   { INDEXLEN , INDEX1, 
X		"68;[1=];" },
X/* LSL 124 */   { INDEXLEN , INDEX0, 
X		"78;" },
X/* LSLA 125 */   { 0 , 0, 
X		"48;" },
X/* LSLX 126 */   { 0 , 0, 
X		"58;" },
X/* LSR 127 */   { ADDR , DIRECT, 
X		"34;[1=];" },
X/* LSR 128 */   { INDEXLEN , INDEX1, 
X		"64;[1=];" },
X/* LSR 129 */   { INDEXLEN , INDEX0, 
X		"74;" },
X/* LSRA 130 */   { 0 , 0, 
X		"44;" },
X/* LSRX 131 */   { 0 , 0, 
X		"54;" },
X/* MUL 132 */   { INSTMUL , INSTMUL, 
X		"42;" },
X/* NEG 133 */   { ADDR , DIRECT, 
X		"30;[1=];" },
X/* NEG 134 */   { INDEXLEN , INDEX1, 
X		"60;[1=];" },
X/* NEG 135 */   { INDEXLEN , INDEX0, 
X		"70;" },
X/* NEGA 136 */   { 0 , 0, 
X		"40;" },
X/* NEGX 137 */   { 0 , 0, 
X		"50;" },
X/* NOP 138 */   { 0 , 0, 
X		"9d;" },
X/* ORA 139 */   { ADDR , DIRECT, 
X		"BA;[1=];" },
X/* ORA 140 */   { ADDR , EXTENDED, 
X		"CA;[1=]x" },
X/* ORA 141 */   { 0 , 0, 
X		"AA;[1=];" },
X/* ORA 142 */   { INDEXLEN , INDEX2, 
X		"DA;[1=]x" },
X/* ORA 143 */   { INDEXLEN , INDEX1, 
X		"EA;[1=];" },
X/* ORA 144 */   { INDEXLEN , INDEX0, 
X		"FA;" },
X/* ROL 145 */   { ADDR , DIRECT, 
X		"39;[1=];" },
X/* ROL 146 */   { INDEXLEN , INDEX1, 
X		"69;[1=];" },
X/* ROL 147 */   { INDEXLEN , INDEX0, 
X		"79;" },
X/* ROLA 148 */   { 0 , 0, 
X		"49;" },
X/* ROLX 149 */   { 0 , 0, 
X		"59;" },
X/* ROR 150 */   { ADDR , DIRECT, 
X		"36;[1=];" },
X/* ROR 151 */   { INDEXLEN , INDEX1, 
X		"66;[1=];" },
X/* ROR 152 */   { INDEXLEN , INDEX0, 
X		"76;" },
X/* RORA 153 */   { 0 , 0, 
X		"46;" },
X/* RORX 154 */   { 0 , 0, 
X		"56;" },
X/* RSP 155 */   { 0 , 0, 
X		"9c;" },
X/* RTI 156 */   { 0 , 0, 
X		"80;" },
X/* RTS 157 */   { 0 , 0, 
X		"81;" },
X/* SBC 158 */   { ADDR , DIRECT, 
X		"B2;[1=];" },
X/* SBC 159 */   { ADDR , EXTENDED, 
X		"C2;[1=]x" },
X/* SBC 160 */   { 0 , 0, 
X		"A2;[1=];" },
X/* SBC 161 */   { INDEXLEN , INDEX2, 
X		"D2;[1=]x" },
X/* SBC 162 */   { INDEXLEN , INDEX1, 
X		"E2;[1=];" },
X/* SBC 163 */   { INDEXLEN , INDEX0, 
X		"F2;" },
X/* SEC 164 */   { 0 , 0, 
X		"99;" },
X/* SEI 165 */   { 0 , 0, 
X		"9b;" },
X/* STA 166 */   { ADDR , DIRECT, 
X		"B7;[1=];" },
X/* STA 167 */   { ADDR , EXTENDED, 
X		"C7;[1=]x" },
X/* STA 168 */   { INDEXLEN , INDEX2, 
X		"D7;[1=]x" },
X/* STA 169 */   { INDEXLEN , INDEX1, 
X		"E7;[1=];" },
X/* STA 170 */   { INDEXLEN , INDEX0, 
X		"F7;" },
X/* STOP 171 */   { INSTSTWA , INSTSTWA, 
X		"8e;" },
X/* STX 172 */   { ADDR , DIRECT, 
X		"BF;[1=];" },
X/* STX 173 */   { ADDR , EXTENDED, 
X		"CF;[1=]x" },
X/* STX 174 */   { INDEXLEN , INDEX2, 
X		"DF;[1=]x" },
X/* STX 175 */   { INDEXLEN , INDEX1, 
X		"EF;[1=];" },
X/* STX 176 */   { INDEXLEN , INDEX0, 
X		"FF;" },
X/* SUB 177 */   { ADDR , DIRECT, 
X		"B0;[1=];" },
X/* SUB 178 */   { ADDR , EXTENDED, 
X		"C0;[1=]x" },
X/* SUB 179 */   { 0 , 0, 
X		"A0;[1=];" },
X/* SUB 180 */   { INDEXLEN , INDEX2, 
X		"D0;[1=]x" },
X/* SUB 181 */   { INDEXLEN , INDEX1, 
X		"E0;[1=];" },
X/* SUB 182 */   { INDEXLEN , INDEX0, 
X		"F0;" },
X/* SWI 183 */   { 0 , 0, 
X		"83;" },
X/* TAX 184 */   { 0 , 0, 
X		"97;" },
X/* TST 185 */   { ADDR , DIRECT, 
X		"3D;[1=];" },
X/* TST 186 */   { INDEXLEN , INDEX1, 
X		"6D;[1=];" },
X/* TST 187 */   { INDEXLEN , INDEX0, 
X		"7D;" },
X/* TSTA 188 */   { 0 , 0, 
X		"4D;" },
X/* TSTX 189 */   { 0 , 0, 
X		"5D;" },
X/* TXA 190 */   { 0 , 0, 
X		"9f;" },
X/* WAIT 191 */   { INSTSTWA , INSTSTWA, 
X		"8f;" },
X	{ 0,0,""} };
X/* end fraptabdef.c */
SHAR_EOF
true || echo 'restore of as6805.y failed'
fi
exit 0



More information about the Alt.sources mailing list