> SINETBL is called, but returns after the ADDWF Is this code complete ? eg CONFIG, ORGs etc What are you doing with PCLATH ? Where are these two pieces ORGed ? > Then the code reaches the final RETLW and goes back to CALL > SINETBL, but does not call it, and ends up in a loop I don't see how RETLW goes anywhere predictable. It's a RETURN without a CALL AFAICT. Hard to tell with code missing > MOVF PORTA, 1 ; Read the contents of PORTA into itself Potential r-m-w problem http://www.piclist.com/techref/readmodwrite.htm -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist