************
* Program PULSE_2 (6811)
*
* Pulses relay number of times specified by switches.
*
* Similar to PULSE_1 except uses BSET, BCLR and I/O is PORTB and PORTC
*
* Note use of indexed input and output.
* Note use of BSET and BCLR.
*
* P. H. Anderson, 16 Oct 90, Not Checked; 15 Jan 93
************

PSCT	EQU $C000
DSCT	EQU $D000
IDSCT	EQU $D300

STACKTP 	EQU $0045
REG_BASE 	EQU $1000

PORTB	EQU $04
PORTC	EQU $03
DDRC	EQU $07

	ORG PSCT

	LDS #STACKTP
	LDY #REG_BASE

	CLR DDRC,Y
	BCLR PORTB,Y %10000000	  * ms bit to zero

	LDAA PORTC,Y		* get switches
AGN
	BSR WINK
	DECA
	BNE AGN
	SWI

WINK
* turns ms led on and off

	BSET PORTB,Y %10000000	* turn on ms bit
	BSR TIME
	BCLR PORTB,Y %10000000	* turn off ms bit
	BSR TIME
	RTS

TIME
* provides brief time delay

	PSHX
	LDX #50000
T1
	NOP
	DEX
	BNE T1
	PULX
	RTS

