INCLUDE HT48R05A-1.INC
DATA .SECTION 'DATA'
D1 DB ?
D2 DB ?
D3 DB ?
TIME0 DB ?
CNT0 DB ?
TIME1 DB ?
CNT1 DB ?
CODE .SECTION 'CODE'
	ORG 0
START:
	CLR INTC
	CLR PAC
	
LLL:
	MOV A,1
	MOV TIME0,A
LOOP0:
	MOV A,20
	MOV CNT0,A
	
	
$1:
	CLR PA0
	MOV A,TIME0
	CALL DELAY
	SET PA0
	MOV A,255
	SUB A,TIME0
	CALL DELAY
	SDZ CNT0
	JMP $1
	
	INC TIME0
	MOV A,250
	XOR A,TIME0
	SNZ Z
	JMP LOOP0

	MOV A,254
	MOV TIME1,A
LOOP1:
	MOV A,20
	MOV CNT1,A
$2:
	CLR PA0
	MOV A,TIME1
	CALL DELAY
	SET PA0
	MOV A,255
	SUB A,TIME1
	CALL DELAY
	SDZ CNT1
	JMP $2
	DEC TIME1
	SNZ Z
	JMP LOOP1
	JMP LLL	

;-----------------------------------
delay:
	
	MOV D3,A
$1:
	SDZ D3
	JMP $1
	RET
;------------------------------

END


	
