3000 3edf 0000 S ... ANLAY.A
	PN	ANLAY
;
LAYO:	EQU	00100H
;
	ORG	00C00H
START:	XOR	A
	OUT	018H
	RST	020H
	DB	2
	DB	12
	DB	13
	DB	'        '
	DB	'Nachbearbei'
	DB	'tung'
	DB	13
	DB	'       '
	DB	'***********'
	DB	'******'
	DB	13
	DB	13
	DB	13
	DB	'          '
	DB	'Achtung !'
	DB	13
	DB	13
	DB	'Rasterstru'
	DB	'ktur wird '
	DB	'zerstört -'
	DB	13
	DB	13
	DB	'evtl. Prob'
	DB	'leme bei Änd'
	DB	'erungen !'
	DB	13
	DB	13
	DB	13
	DB	13
	DB	'  D - Bild '
	DB	'drehen'
	DB	13
	DB	13
	DB	'  S - Bild '
	DB	'spiegeln'
	DB	13
	DB	13
	DB	'  Cursor - '
	DB	'Feinscrolling'
	DB	13
	DB	13
	DB	'  R - Return'
	DB	08DH
	LD	HL,0EBFFH
	LD	(02BH),HL
OKR:	RST	020H
	DB	1
	AND	07FH
	CMP	060H
	JRC	IGR-#
	AND	05FH
IGR:	CMP	'R'
	JPZ	LAYO
	LD	HL,OKR
	PUSH	HL
	CMP	'D'
	JPZ	DREH
	CMP	'S'
	JRZ	MIRR-#
	CMP	8
	JPZ	FSL
	CMP	9
	JPZ	FSR
	CMP	10
	JPZ	FSD
	CMP	11
	JPZ	FSU
	POP	HL
	XOR	A
	OUT	018H
	JR	OKR-#
;
MIRR:	LD	HL,0EC00H
	LD	DE,0EFE0H
CZEI:	LD	B,8
MZEI:	LD	A,7
	ADD	B
	PUSH	AF
	OUT	018H
	LD	A,(DE)
	LD	C,A
	LD	A,16
	SUB	B
	OUT	018H
	LD	A,M
	LD	M,C
	LD	C,A
	POP	AF
	OUT	018H
	LD	A,C
	LD	(DE),A
	INC	HL
	INC	DE
	LD	A,L
	AND	01FH
	JRNZ	MZEI-#
	PUSH	BC
	LD	BC,32
	SBC	HL,BC
	EX	DE,HL
	SBC	HL,BC
	EX	DE,HL
	POP	BC
	DJNZ	MZEI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