MOUSE0ASM	;
;***	haftmann#software	***
;***	MOUSE0 ohne Anspr}che	***
;***	nur 1.V24, nur Kanal 2	***
;***	voll verschieblich	***
;***	10.04.92		***
OS	EQU	0F003H
RC	EQU	0F00FH
	ORG	200H
ISRD
	DEFB	0	;EMPFANGSBYTENR
	DEFB	7	;TASTENSTATI
	DEFB	0F6H	;USERTASTE
	DEFB	0	;FREIGABE
	DEFB	8	;MICKEY X
	DEFB	10H	;STEP X
	DEFB	8	;MICKEY Y
	DEFB	10H	;STEP Y
ISR
	PUSH	HL
	PUSH	AF
	PUSH	DE
	PUSH	BC
	;
	CALL	RC
	DEFW	0
NEXT	POP	HL
	LD	DE,ISRD-NEXT
	ADD	HL,DE	;Datenzeiger
CHAR	IN	A,9
	LD	D,A	;Byte holen
	;
	XOR	A
	OR	M	;Null?
	JR	NZ,DIRECT
	LD	A,D
	AND	0F8H
	CP	80H
	JR	NZ,EXIT
	INC	M
	INC	HL	;^Tastenstati
	LD	A,D	;gelesenes Byte
	CPL
	AND	M
	LD	M,D
	INC	HL	;^Usertaste
	RRA
	JR	NC,NRIGHT
	LD	C,M
	LD	A,M
	JR	EINTR
NRIGHT	RRA
	JR	NC,NMIDDL
	INC	HL
	LD	A,M
	CPL
	JR	NOVER
NMIDDL	RRA
	JR	NC,EXIT
	LD	C,13
	LD	A,M
	JR	EINTR
DIRECT
	INC	A
	CP	5
	JR	C,DIR1
	XOR	A
DIR1	RR	M
	LD	M,A	;neue Nummer
	INC	HL
	INC	HL
	INC	HL
	LD	B,M	;Freigabe
	INC	HL
	LD	C,8	;CUL
	JR	C,DIR2
	INC	HL
	INC	HL
	LD	C,10	;CUD
DIR2	LD	A,M	;Mickey
	INC	HL
	LD	E,M	;Step
	DEC	HL
	ADD	D
	BIT	7,A
	JR	Z,POSI
	ADD	E
	BIT	7,A
	JR	Z,EINTR1
	XOR	A
	JR	EINTR1
	;
POSI	CP	E
	JR	C,NOVER
	INC	C
	SUB	E
	CP	E
	JR	C,EINTR1
	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