FSAVE2  ASM;-------------------------------
;
;Saveroutine f}r DEP Version 2.1
;	(mit Fehlertexten)
;
;Adresse:	0000 00B3H
;
;FSAVE2.ASM	` ml 06.08.93
;-------------------------------
ARGN	EQU	0B781H
ARG1	EQU	ARGN+1
ARG2	EQU	ARGN+3
PV1	EQU	0F003H
WAIT	EQU	14H
INLIN	EQU	17H
ERRM	EQU	19H
AHEX	EQU	1CH
OSTR	EQU	23H
OCHR	EQU	24H
;--------------------------
	ORG	0
	DW	7F7FH
	DB	'FSAVE'
	DB	1
	LD	A,(ARGN)
	CP	2
	JR	C,ERROR	; < 2 Arg.
	CALL	PV1
	DB	OSTR
	DB	'Name :',0
	CALL	PV1
	DB	INLIN
	LD	HL,17
	ADD	HL,DE	;Ende Name
	LD	E,12	;L{nge
	LD	BC,8EF3H
NAMOUT:	OUTD
	DEC	E
	JR	NZ,NAMOUT
	LD	BC,80F2H;Datenpuffer
CLEAR:	OUT	(C),E	;l|schen
	INC	B
	JR	NZ,CLEAR
	LD	HL,ARGN
	LD	DE,0B0BH;open/Anzahl
	LD	BC,91F2H;Daten
SCHR:	OUTI
	INC	B
	INC	B
	DEC	E
	JR	NZ,SCHR
	LD	BC,80F3H;n{chsten Block
	OUT	(C),D
NRDY:	PUSH	BC
	LD	A,1
	CALL	PV1
	DB	WAIT
	POP	BC
	IN	A,(C)	;fertig?
	BIT	0,A
	JR	NZ,NRDY
	BIT	7,A
	JR	Z,WROK	;kein Fehler
ERR:	LD	BC,83F1H
	IN	A,(C)
	CP	20H	;DEP ab 2.0?
	JR	NZ,ERRTX;ja
	LD	BC,81F3H
	IN	A,(C)	;Fehlernummer
	CALL	PV1
	DB	AHEX
ERROR:	CALL	PV1
	DB	ERRM
	RET
ERRTX:	LD	B,0	;Fehlertext
ERRT1:	IN	A,(C)
	RET	Z	;00-Ende
	INC	B
	CALL	PV1
	DB	OCHR
	JR	ERRT1
WROK:	LD	BC,81F2H
	BIT	3,D
	JR	Z,N3
	LD	HL,(ARG1);AAdr.
N3:	PUSH	HL
	LD	DE,(ARG2);Endadresse
	AND	A
	SBC	HL,DE
	POP	HL
	LD	BC,81F2H
	LD	DE,0380H
	JR	C,SCHR	;weiter
	LD	BC,80F3H
	LD	A,43H	;close
	OUT	(C),A
NEND:	PUSH	BC
	LD	A,1
	CALL	PV1
	DB	WAIT
	POP	BC
	IN	A,(C)
	BIT	0,A	;fertig?
	JR	NZ,NEND
	BIT	7,A
	RET	Z
	JR	ERR	;Fehler
А@Аt(Аp6АnTop of Text: End of Text: Start of MC: ASM-Offset : хЫ€ц$У€сЙхЫ€жЫУ€с,NEND
	BIT	7,A
	RET	Z
	JR	ERR	;Fehler
А@Аt(Аp6АnTop of Text: End of Text: Start of MC: ASM-Offset : хЫ€ц$У€сЙхЫ€жЫУ€с