;26 June 2012. Application Support, LED on-off.pes
;This simple script is used to turn on and off an LED on the PE0002
;without affecting the other port pin states

;*****Turn on/off PE0002 LED1*****
Port1cpy	word

Main
	jsr Led1On
	delay 300
	jsr Led1Off
	delay 300
	jmp Main

Led1Off
	port 1			;Ensure Port1 is default
	portr Port1cpy		;Read current setting
	and $FFFE Port1cpy	;Turn off LED1 (b0 = 0)
	portw Port1cpy
	return

Led1On
	port 1			;Ensure Port1 is default
	portr Port1cpy		;Read current setting
	or $0001 Port1cpy	;Turn on LED1 (b0 = 1)
	portw Port1cpy
	return

;*******
	