* 77-68 BUG 1 VERSION 01. MODIFIED FOR ACIA-B.
* ( SAMPLE OF 6800 SOURCE CODE )
*
***************************************************
*
* 77-68 IS A KIT-COMPUTER SYSTEM BASED ON THE MOTOROLA
* 6800 MICROCOMPUTER CHIP.
*
* COPYRIGHT OF 77-68 BELONGS TO:
*	NEWBEAR COMPUTING STORE
*	40, BARTHOLEMEW ST.
*	NEWBURY,  BERKS.
*	ENGLAND.
*
* THIS SOFTWARE APPEARS IN THE 77-68 DESIGN MANUAL
* AND WAS PUBLISHED IN THE JOURNAL OF THE AMATEUR COMPUTER
* CLUB IN ENGLAND.
*
********************************************************
*
	ORG	$FF00
CTRL.A	EQU $F401
CTRL.B	EQU $F403
DATA.A	EQU $F400
DATA.B	EQU $F402
TOPSTK	EQU $F0F3
USRSTK	EQU $F0D0	*STOPS FUNNIES
JMPNMI	EQU $F0F5
JMPIRQ	EQU $F0F8
TMPXHI	EQU $F0FB
TMPXLO	EQU TMPXHI+1
TMPSTK	EQU $F0FD

RESET	LDS	#USRSTK
	LDAA	#$3
	STAA	CTRL.A
	STAA	CTRL.B
SWINT	STS	TMPSTK
RSTART	LDS	#TOPSTK
	LDAA	#$11
	STAA	CTRL.A
	STAA	CTRL.B
	BSR	PCRLF
	BSR	GAPCH
	CMPA	#'A
	BEQ	ALTER
	CMPA	#'C
	BEQ	CONT
	CMPA	#'G
	BEQ	GOGOGO
	CMPA	#'R
	BEQ	REGPNT
	CMPA	#'E
	BNE	RSTART
	BSR	GETADR
EXAMLP	BSR	P2HAS
	BSR	GETCH
	CMPA	#$20
	BNE	RSTART
	INX
	BRA	EXAMLP
GOGOGO	BSR	GETADR
	LDX	TMPSTK
	INX
	INX
	INX
	INX
	INX
	INX
	LDAA	TMPXHI
	STAA	,X
	LDAA	TMPXLO
	STAA	1,X
CONT	LDS	TMPSTK
	RTI
ALTER	BSR	GETADR
ALTLP	BSR	HEX2IN
	STAA	,X
	INX
	BRA	ALTLP
REGPNT	BSR	PNTSP
	LDX	TM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