	TITLE	EXBUG (YUK!) SIMULATOR
	TABS	20,30,50,60,70,80,90
	IFUND	CODE
CODE	EQU	$1E00
	FIN	CODE

	ORG	CODE
*
*
*	EXBUG LOOK ALIKE JUMP TABLE
*
*
	JMP	$F000	RESTART VECTOR
	JMP	*	GET BEGIN, END ADDRESS
	JMP	*	CONVERT HEX TO BIN
	JMP	*	SEE MANUAL!
	JMP	*
	JMP	*
	JMP	GETCHAR	INPUT WITH PARITY (HA-HA)
	JMP	GETCHAR	INPUT W/O PARITY
	JMP	PUTCHAR	OUTPUT A CHAR
	JMP	*
	JMP	*
	JMP	PCRLF
	JMP	PDATA
	JMP	PDAT1
	JMP	PSPACE
	PAGE
GETCHAR	STX	SAVEX
	STAB	SAVEB
	LDX	#READINCHAR
	JSR	$FB	HELLO SDOS!
	BCS	GETCHAR	AGAIN!
	TST	$FF53	MAGIC ECHO FLAG
	BNE	DONTECHO
	LDAA	CHAR
	ANDA	#$7F
	CMPA	#$7F
	BNE	NOTRUB
	LDAA	#'/	CONVERT RUBBOUT TO PRINTING
NOTRUB	STAA	CHAR
	LDX	#WRITEOUTCHAR
	JSR	$FB
	BCS	GETCHAR

DONTECHO	LDAA	CHAR
	LDX	SAVEX
	LDAB	SAVEB
	RTS

PCRLF	LDAA	#$D
	BSR	PUTCHAR
	LDAA	#$A
	BSR	PUTCHAR
	LDAA	#0
	BRA	PUTCHAR

PDATA	BSR	PDAT1
	BSR	PCRLF

PDAT1	LDAA	0,X
	CMPA	#4
	BEQ	PDAT1RTS
	BSR	PUTCHAR
	INX
	BRA	PDAT1

PSPACE	LDAA	#' 
PUTCHAR	STAA	CHAR
	STAB	SAVEB
	STX	SAVEX
	LDX	#WRITEOUTCHAR
	JSR	$FB
	BCS	PUTCHAR
	LDX	SAVEX
	LDAB	SAVEB
PDAT1RTS	RTS
	PAGE
SAVEX	RMB	2
SAVEB	RMB	1
WRITEOUTCHAR	FCB	$D	WRITEB
	FCB	8
	FCB	0,0
	FDB	CHAR
	FDB	1

READINCHAR	FCB	$B	READB
	FCB	$E
	FCB	0,0
	FDB	0,0,0
	FDB	CHAR
	FDB	1

CHAR	RMB	1
	END
