;UPRAVA HER MSX-SORD
;(C) ROS 28-JUN-89
;ADJMSX;1  09:51
;
	.RADIX 16T
	ORG	0DF00
ADRESA	EQU	0000
;--------------------------------
START	DI
	LD	A,(0006)
	CP	10
	JP	NZ,ADRESA
	CALL	00CC
	CALL	006F
	LD	HL,TEXT
TISK	LD	A,(HL)
	PUSH	AF
	CALL	00A2
	POP	AF
	OR	A
	JR	Z,PAUSE
	INC	HL
	JR	TISK
PAUSE	LD	BC,0B00
PAUS1	XOR	A
PAUS2	DEC	A
	JR	NZ,PAUS2
	DEC	BC
	OR	B
	JR	NZ,PAUS1
	LD	HL,TEST
	LD	(ADRESA),HL
	CALL	EXCLOP
	LD	HL,(4002)
	EI
	IN	A,(11)
	JP	(HL)
;--------------------------------
EXCLOP	DI
	LD	HL,9000
	LD	DE,4000
	LD	BC,4000
EX1	LD	A,(DE)
	LDI
	DEC	HL
	LD	(HL),A
	INC	HL
	JP	PE,EX1
	RET
;--------------------------------
TEST	DI
	PUSH	AF
	IN	A,(30)
	CPL
	AND	0C
	JR	Z,SHIFTY
	IN	A,(50)
	RLCA
	JR	C,RESET
VEN	POP	AF
	EI
	JP	ADRESA
;---------------
SHIFTY	CALL	EXCLOP
	RST	0
;---------------
RESET	IN	A,(50)
	RLCA
	JR	C,RESET
	LD	A,(ADRESA)
	OR	A
	JR	Z,SMRTEL
	XOR	A
ULOZIT	LD	(ADRESA),A
	JR	VEN
SMRTEL	LD	A,35
	JR	ULOZIT
;--------------------------------
TEXT	DB 0C,0A,0A,0A,0A,0A,0A,0D,09,'Pro SORD m.5',0D,0A,0D,0A,'      upravil LZR Soft',0D,0
KONEC:
DELKA	EQU	KONEC-START
	END	START
