 ORG 65408
 LD D,1
 CALL COUNT
 LD C,L
 LD D,2
 CALL COUNT
 LD H,C
 RET
COUNT LD A,E
 OUT (58),A
 XOR A
 OUT (58),A
 LD B,20
WAIT DJNZ WAIT
 LD HL,0
PULSE INC HL
 IN A,(58)
 AND D
 JR Z,PULSE
 RET
 END
