PTBLOADASM;PTBLOAD 0200 0330
;-----------------
;
;Zeichenbildtabelle XXXXXXXX.PTB
;von Kassette laden
;
;			` ml 17.02.91
;------------------------------------
ARGN	EQU 0B781H
ARG2	EQU 0B782H
ARG9	EQU 0B792H
ARG10	EQU 0B794H
CCTL0	EQU 0B7A6H
PV1	EQU 0F003H
MBI	EQU 05H
ISRI	EQU 0AH
CSRI	EQU 0BH
ERRM	EQU 19H
AHEX	EQU 1CH
OSTR	EQU 23H
OCHR	EQU 24H
CRLF	EQU 2CH
;-------
CHR	ORG 0200H
	CALL PV1
	DEFB OCHR
	RET
;0205H
	DEFW 7F7FH
	DEFM 'PTBLOAD'
	DEFB 1
	LD A,(ARGN)
	CP 2
	JR C,ERROR	;< 2 Arg.
	CP 4
	JR NC,ERROR	;> 3 Arg.
	LD A,3
	AND L
	LD HL,CCTL0
	SLA A
	ADD L
	LD L,A
	LD (ARG9),HL	;Adr. CCTL
	LD A,0FH
	CP E
	JR NZ,L01	;nicht 'F'
	LD H,B
	LD L,C		;HL=Adr.
	LD A,(ARGN)
	CP 3
	JR Z,L02
;0235H
ERROR	CALL PV1
	DEFB ERRM
	RET
;023AH
L01	LD HL,0BC00H	;'A'
	LD A,0AH
	CP E
	JR Z,L02
	LD HL,0BE00H	;'B'
	LD A,0BH
	CP E
	JR NZ,ERROR	;Platz falsch
;024AH
L02	LD (ARG10),HL	;Adresse
	LD (ARG2),HL
	LD HL,0B700H	;Cass.-Puffer
	LD (IX+5),L
	LD (IX+6),H
	CALL PV1
	DEFB ISRI
;025DH
L08	LD A,(IX+2)
	JR C,L03
	CP 1
	JR NZ,L03
	LD HL,0B700H	;Cass.-Puffer
	LD B,0BH
;026BH
L04	LD A,M
	INC HL
	CALL CHR
	DJNZ L04	;Name anzeigen
	DEC HL
	LD A,'B'
	CP M
	JR NZ,L05
	DEC HL
	LD A,'T'
	CP M
	JR NZ,L05
	DEC HL
	LD A,'P'	;Test .PTB
	CP M
	JR Z,L06
;0284H
L05	CALL PV1
	DEFB OSTR
	DEFM '? ? ?'	;Anzeige bei
	DEFB 0		;falschem Typ
;028EH
L07	CALL PV1
	DEFB CSRI
	CALL PV1
	DEFB CRLF
	RET
;0297H
L03	CALL PV1
	DEFB AHEX
	CALL PV1
	DEFB OSTR
	DEFM '**'
	DEFB 8
	DEFB 8
	DEFB 8
	DEFB 8
	DEFB 0
	LD A,3
	CP (IX+0DH)
	JR Z,L07	;BRK-Taste
	CALL PV1
	DEFB MBI
	JR L08
;02B3H
L06	CALL PV1
	DEFB CRLF
	LD B,4
	LD C,2
;02BBH
L10
	PUSH BC
	CALL PV1
	DEFB MBI
	POP BC
	PUSH AF
	LD A,(IX+2)
	LD E,A
	CALL PV1
	DEFB AHEX
	LD A,E
	CP C
	JR Z,L09
	CP 0FFH
	JR Z,L09
	POP AF
	POP HL
	CALL PV1
	DEFB OSTR
	DEFM '* '
	DEFB 0
	LD A,3
	CP (IX+0DH)
	JR NZ,L10
	JR L07		;BRK-Taste
;02E4H
L12	LD HL,(ARG9)
	LD DE,(ARG2)
	LD M,E
	INC HL
	LD M,D
	JR L07
;02F0H
L09	INC C
	POP AF
	JR C,L11
	CALL PV1
	DEFB OSTR
	DEFM '> '
	DEFB 0
;02FBH
L13	PUSH BC
	LD HL,0B700H	;Cass.-Puffer
	LD DE,(ARG10)
	LD BC,80H
	LDIR
	LD (ARG10),DE
	POP BC
	LD A,0FFH
	CP (IX+2)
	JR Z,L12
	LD A,3
	CP (IX+0DH)
	JP Z,L07	;BRK-Taste
	DJNZ L10
	JR L12
;0320H
L11	CALL PV1
	DEFB OSTR
	DEFM '? '
	DEFB 0
	JR L13
;0329H
@ÿ