You need to use bit masks and indirect access: MAINLOOP: movlw ROL ; address of ROL movwf FSR ; prepare for indirect access movlw 1 << ROLP ; get mask for roll pin call get_pulse movlw PIT ; address of PIT movwf FSR ; prepare for indirect access movlw 1 << PITP ; get mask for pitch pin call get_pulse etc... goto MAINLOOP get_pulse: clrf INDF ; zero output value movwf MASK ; remember mask value gp_2: ; loop until selected pin is clear movf PORTA,W andwf MASK,W skpz goto gp_2 gp_3: movf PORTA,W ; loop until select pin is set andwf MASK,W skpnz goto gp_3 gp_4: incf INDF ; loop until pin is clear, counting the time as we go call pause movf PORTA,W andwf MASK,W skpz goto gp_4 return Bob Ammerman RAm Systems -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads