;UPRAVA HRY STOP THE ITA EXPRESS
;(C) ROS 12-JUL-89
;ADJEXP;0  20:37
;
	.RADIX 16T
	ORG	0CFD2
;--------------------------------
ADR1	EQU	86BA
ADR2	EQU	8889
ADR3	EQU	89C8
ADR4	EQU	9D99
;--------------------------------
TEST	PUSH	AF
	IN	A,(30)
	CPL
	AND	0C
	JP	Z,0000
	IN	A,(50)
	RLCA
	JR	C,RESET
VEN	POP	AF
	RET
;---------------
RESET	IN	A,(50)
	RLCA
	JR	C,RESET
	LD	A,(ADR1)
	OR	A
	JR	Z,SMRTEL
	XOR	A
ULOZIT	LD	(ADR1),A
	LD	(ADR2),A
	LD	(ADR3),A
	LD	(ADR4),A
	JR	VEN
SMRTEL	LD	A,3D
	JR	ULOZIT
;--------------------------------
START	DI
	LD	SP,0F000
	LD	HL,0F3E9
	LD	(HL),01
	INC	HL
	LD	(HL),0A
	INC	HL
	LD	(HL),0A
	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,1000
PAUS1	XOR	A
PAUS2	DEC	A
	JR	NZ,PAUS2
	DEC	BC
	OR	B
	JR	NZ,PAUS1
	LD	HL,9000
	LD	DE,8000
	LD	BC,4000
	LDIR
	LD	A,(0006)
	CP	10
	JR	NZ,CONTIN
	LD	HL,TEST-1000
	LD	(0FDA0),HL
	LD	A,0C3
	LD	(0AA24),A
CONTIN	LD	HL,0B0ED
	LD	(8004),HL
	LD	HL,0C000
	LD	DE,0C001
	LD	BC,2000
	LD	(HL),0
	JP	8004
;--------------------------------
TEXT	DB 0C,0D,0A,0A,0A,0A,0A
	DM "    STOP THE ITA EXPRESS"
	DB 0D,0A,0A
	DM "    UPRAVIL (C) LZR SOFT"
	DB 0D,0A,0A
	DM "           12-JUL-89"
	DB 0D,0A,0
KONEC:
DELKA	EQU	KONEC-START
	END	START
