; This Programm toggles the LED ON RB.6 
;

		DEVICE	SX28L,OSC4MHZ,TURBO
		RESET	Start
;		FREQ    4_000_000

;Define all Variables
		Count1	EQU	$08 	; set variable count1 to memory location 8  with the size on one byte 
		Count2	EQU	$09 
;
		WATCH	Count1,16,UDEC  ; 16 bit in debug-mode 
;

Start		mov	rb, #%00000000	;Set port B output latch to zero
		mov	!rb,#%10111111	;Set port B.bit6 to output direction
		
Main		call	delay		;delay					
		mov	W,/RB.6		;grab inverse of RC bit7
		mov	RB.6,W		;and store it in RC bit7
		jmp	Main		;goto main				


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


Delay		clr	Count1  	;Initialize Count1, Count2	
		clr	Count2		;					

Loop		djnz	Count1,loop	;Decrement until all are zero		
		djnz	Count2,loop	;					
		RET			;then return				