list p=16f877A ; list directive to define processor
#include <p16f877A.inc> ; processor specific variable definitions
__CONFIG _CP_OFF & _WDT_OFF & _BODEN_OFF & _PWRTE_ON & _RC_OSC & _WRT_OFF & _LVP_ON & _CPD_OFF
ORG 0x000
goto main
Main
STATUS equ 03h ; not needed, defined in INC statment
TRISA equ 85h ; not needed
TRISB equ 86h ; not needed
PORTA equ 05h ; not needed
PORTB equ 06h ; not needed
clrf PORTB ; clear the ports
clrf PORTA
movlw 02h
movwf STATUS ; goto Bank 1
movlw 03h
movwf TRISA ;set Port A to 00000011 (RA0 and RA1 are inputs)
movlw fch
movwf TRISB ;set Port B 11111100 (RB0 and RB1 are outputs)
clrf STATUS ; goto Bank 0
Start
btfss PORTA,0 ; check input pin RA0 and skip if 1
btfsc PORTA,1 ; check input pin RA1 and skip if 0
goto stop
movlw 03h
movwf PORTB ;set the outputs pins RB0 and RB1 to 1
goto start
Stop
movlw 00h
movwf PORTB ;clear Port B
goto turn ;not realy needed since it will drop thru anyways
Turn
movlw 01h
movwf PORTB ;set the outputs pin RB0 to 1
btfsc PORTA,0; check input pin RA0 and skip if 0
btfss PORTA,1; check input pin RA1 and skip if 1
goto start
goto turn
This would be easier to check if we knew what this program is intended to do. By the subroutine names, it looks like you want to start, stop and turn something. Maybe two motors on a robot?. However, the stop routine runs imediately into the turn routine, which I don't think is what u want. Also note that if RA0 and RA1 pins are switches, there is no debounce routine to wait for the switch state to settle before calling a subroutine.