SUPERTAPASM 
	ORG	0BA00H
 
	DEFW	7F7FH
	DEFM	'TSAVE'
	DEFB	1
	LD	A,(0B781H)	;ARGN
	CP 	002H		;2 ARG?
	RET	C		;NEIN
	LD	A,003H		;
	JR	Z,SAVE0		;AUTOSTA
	LD	BC,08000H	;VORTON
SAVE0:	EX	AF,AF'		;VOLO/PR
	IN	A,088H
	PUSH	AF
	PUSH	HL
	OR	024H		;LED
	OUT	088H,A		;MOTOR
	LD	(0B70FH),BC
	LD	(0B70DH),HL
	XOR	A
	EX	DE,HL
	SBC	HL,DE
	INC	HL
	LD	(0B70BH),HL
	PUSH	HL
	CALL	NAME		;Namen
	LD	DE,0B701H	;IN PUFF
	LD	BC,0000AH	;LAENGE
	LDIR
	LD	DE,00011H
	EX	AF,AF'
	LD	(0B700H),A
	LD	IY,0B700H	;PUFFER
	XOR	A		;A="0"
	CALL	SAVE1
	POP	DE
	POP	IY
	POP	AF
	PUSH	AF
	SET	5,A
	OUT	088H,A
	LD	A,0FFH
	CALL	SAVE1
	POP	AF
	SET	2,A		;ALLES
	OUT	088H,A		;OFF
	RET
;---------------------------------------
NAME:	LD	B,15
NAME1:	CALL	0F003H
	DEFB	02BH	;15x Space
	DJNZ	NAME1
	CALL	0F003H
	DEFB	023H
	DEFB	019H
	DEFM	'NAME:'
	NOP
	CALL	0F003H
	DEFB	017H
	LD	HL,5
	ADD	HL,DE
	RET
;---------------------------------------
SAVE1:	EI
	LD	HL,01F80H
	BIT	7,A
	JR	Z,SAVE2
	LD	HL,00C98H
SAVE2:	EX	AF,AF'
	INC	DE
	DEC	IY
	LD	A,087H
	OUT	08DH,A
	LD	A,043H	;ZK
	LD	C,A
	OUT	08DH,A
VORTO:	CALL	DATA
	DEC	HL
	LD	A,L
	OR	H
	JR	NZ,VORTO
 
	LD	C,02DH
	CALL	DATA
	LD	C,016H
	CALL	FRQ
	EX	AF,AF'
	LD	L,A
	JR	UBCC5
SAVE4:	LD	A,D
	OR	E
	JR	Z,UBCC9
	LD	L,(IY)
SAVE5:	LD	A,H
	XOR	L
UBCC5:	LD	H,A
	SCF
	JR	UBCD6
UBCC9:	LD	L,H
	JR	SAVE5
DBITS	LD	C,013H
	JR	NC,BIT0
	LD	C,026H
BIT0:	CALL	FRQ
	XOR	A
UBCD6:	RL 	L
	JR	NZ,DBITS
	DEC	DE
	INC	IY
	LD	A,D
	INC	A
	JR	NZ,SAVE4
 
	CALL	FRQ
	LD	A,003H
	OUT	08DH,A	;RESET CTC
	INC	A
	RET
;=======================================
FRQ:	CALL	DATA
DATA:	IN	A,(88H)
	OUT	88H
DALOOP:	LD	A,(IX)
	OR	A
	JR	NZ,DALOOP
	LD	(IX),C
	RET
 
;---------------------------------------
	DEFW	7F7FH
	DEFM	'TVERIFY'
	DEFB	1
	RES	0,(IX+07H)
	JR	UBD4F
;---------------------------------------
	DEFW	7F7FH
	DEFM	'TLOAD'
	DEFB	1
UBD4B:	SET	0,(IX+07H)
UBD4F:	CALL	UBD5B
	JR	NZ,UBD4F
	CALL	UBDB9
UBD57:	JR	NC,UBDCA
UBD59:	JR	UBDD6
UBD5B:	IN	A,088H
	PUSH	AF
	SET	2,A
	OUT	088H,A
UBD62:	XOR	A
	SCF
	LD	DE,00011H
	LD	IY,0B700H
	CALL	UBDDD
	JR	Z,UBDC8
	JR	NC,UBD62
	LD	HL,0B700H
	LD	A,(HL)
	CP 	003H
	PUSH	AF
	JR	NZ,UBD87
	CALL	0F003H
	DEFB	023H
	DEFM	'BYTES: '
	DEFB	000H
UBD87:	LD	B,00AH
UBD89:	INC	HL
	LD	A,(HL)
	CALL	0F003H
	DEFB	000H
	DJNZ	UBD89
	LD	DE,(0B70BH)
	LD	HL,(0B70DH)
	LD	A,(0B781H)
	OR	A
	JR	Z,UBDA1
	LD	HL,(0B782H)
UBDA1:	PUSH	HL
	POP	IY
	CALL	0F003H
	DEFB	02BH
	CALL	0F003H
	DEFB	01AH
	ADD	HL,DE
	DEC	HL
	CALL	0F003H
	DEFB	01AH
	CALL	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