#include ; --- COUNT_RB0.ASM ---- ; This program counts how many times ; RB0 is pressed and displays the result ; on PORTC ; Program org 0x800 clrf TRISA movlw 0xFF movwf TRISB clrf TRISC clrf TRISD clrf TRISE movlw 0x0F movwf ADCON1 clrf PORTC Loop1: btfsc PORTB,0 goto Loop1 Loop2: btfss PORTB,0 goto Loop2 incf PORTC,F goto Loop1 end