	Title "PIC18F452 counting program"
	list p=18F452, f=inhx32
	#include <p18f452.inc>
COUNT	EQU	0X00
DVAR	EQU	0X01
DVAR2	EQU	0X02
		ORG	00H
		GOTO START
		ORG	1CH
START
		CLRF	WREG
		MOVWF	PORTB
		MOVWF	TRISB
INIT
		CLRF	COUNT
INCCOUNT
		INCF	COUNT,F
		MOVF	COUNT,W
		MOVWF	PORTB
		CALL	DELAY
		GOTO 	INCCOUNT		
DELAY
		MOVLW	0XFF
		MOVWF	DVAR2
D0
		MOVWF	DVAR
D1
		DECFSZ	DVAR,F
		GOTO	D1
		DECFSZ	DVAR2,F
		GOTO	D0
		RETURN
		END
