3000 6319 0000 S ... FLOPPY.A
	PN	COMM-IF 1.3
;
;  ÄNDERUNGEN FÜR FUNKAMATEUER
;  NACH 'END' ENTHALTEN !
;
;	* LOAD-CURSOR
;	* PORT #0
;	* KUCKUCK
;
;
AADR:	EQU	01BH
EADR:	EQU	01DH
SADR:	EQU	023H
PANF:	EQU	0E0H
PEND:	EQU	0E2H
PGO:	EQU	0E4H
TYP:	EQU	0ECH
APUFF:	EQU	00100H
AKP:	EQU	0FFBEH
HLOAD:	EQU	0FFF1H
HSAVE:	EQU	0FFF4H
;
PFL:	EQU	052H
PDR:	EQU	050H
;
	ORG	0E000H
BEGIN:	JMP	START
	JMP	LORUF
	JMP	SARUF
	JMP	DIR
	JMP	ORDER
	JMP	ORDHL
	JMP	FSTAT
	JMP	PRCH
	JMP	INIT
;
	JMP	OTALK
	JMP	UTALK
	JMP	OLIST
	JMP	ULIST
	JMP	OPEN
	JMP	CLOSE
	JMP	IECS
	JMP	IECL
;
DIV:	DB	8
OWRI:	DB	1
PRFL:	DB	0
;
START:	CALL	INIT
MAIN:	RST	020H
	DB	2,12,13
	DB	'    '
	DB	'Z1013 - '
	DB	'Disk Mon'
	DB	'itor 1.3'
	DB	13,'   '
	DB	'********'
	DB	'********'
	DB	'********'
	DB	'**',13,13
	DB	13
	DB	' L/l . '
	DB	'Laden von'
	DB	' Diskette'
	DB	13,13
	DB	' S/s . '
	DB	'Saven auf'
	DB	' Diskette'
	DB	13,13
	DB	' K ... '
	DB	'Kopieren '
	DB	'Kass ==>'
	DB	' Disk'
	DB	13,13
	DB	' C ... '
	DB	'Kopieren '
	DB	'Disk ==>'
	DB	' Disk'
	DB	13,13
	DB	' D ... '
	DB	'Directory'
	DB	13,13
	DB	' B ... '
	DB	'Befehl an'
	DB	' Floppy'
	DB	13,13
	DB	' P ... '
	DB	'Befehl an'
	DB	' Drucker'
	DB	13,13
	DB	' W ... '
	DB	'Floppy '
	DB	'waehlen '
	DB	0A8H
	LD	A,(DIV)
	RST	020H
	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