more easy than if then stuff...
Code:
TRISA=0    'output on all PORTA pin
TRISB=255 'Input on all PORTB pin
'
'

'
'

'
'
'
CheckingPORTA:
     PORTA=PORTB
     Return
1 line do everything