If I understood correct, this should be it. Just an example though.



Code:
Wait:

IF PORTA.1 = 1 THEN GOTO Loop
'This is the pin you get the input signal from the other PIC.

GOTO Wait


Loop:

'Your loop code should be here....
'When the last loop index is achieved, 
'you will HIGH a pin to activate the next PIC
'and you will go back to "Wait"


GOTO loop