*PM CLEAR ROUTINE
*A=USR(PMBASE)
PMBASL	EQU	$D4
PMBASH	EQU	$D5
	ORG	$6A0
***	TF	"D:CLEAR.OBJ"
CLEAR	PLA			; PULL # OF BYTES OFF STACK
	PLA			; PULL HI BYTE PMBASE
	STA	PMBASH
	PLA			; PULL LO BYTE PMBASE
	STA	PMBASL
	LDX	#$00		; PAGE COUNTER
AA1	LDY	#$00		; PAGE BEGINS AT 0
	LDA	#$00		; LOAD ZERO TO ERASE
AA2	STA	(PMBASL),Y	; STORE IN PM AREA
	INY			; NEXT BYTE IN MEMORY
	BNE	AA2		; DO ALL 256 BYTES
*AT 256TH BYTE WRAPS BACK TO 0 IN Y REGISTER; FALLS THROUGH
	INC	PMBASH		; DO NEXT PAGE
	INX			; UP COUNTER
	CPX	#$08		; FINISHED WITH 2K BLOCK
	BL	AA1		; NO, START NEXT 256 BYTE PAGE
	RTS			; DONE!
