I have been asked by someone to help with a problem they're having with the uChip example code in this app note, which I think I've sorted. Anyhow, I'm really puzzled by their macros which seem back to front to me. Here is the macro for 8*8 unsigned multiply MULT MACRO BIT btfsc no_lsb,bit ; OK no problem here. addwf result_msb,f ; here neither. rrf result_msb,f ; this appears to be dividing to me. rrf result_lsb,f ENDM The divide routine is longer but uses rlf. Now as carry isn't used to bring the result of rrf MSB back to the top bit of the byte, I fail to see how this is a multiply. Going on further the coding of the interrupt routine seems somewhat farinacious - it has goto's that branch to goto's that call a routine, that branch back into the interrupt routine, very hard to follow. I assume they've done this for speed purposes. Example inside the interrupt. BANKSEL PIR1 btfsc INTCON,RBIF goto CHECK_FAULT ; this is outside the interrupt routine btfsc PIR1, TMR1IF goto TIMER1_OVERFLOW ; as is this RETFIE CHECK_FAULT goto NO_ACTION ; this is in this block of code call RUN_MOTOR_AGAIN goto POP_UP ; this takes us back into the interrupt routine Now, RUN_MOTOR_AGAIN itself has a couple of goto's and a call. Or am I just having an off day? Colin -- cdb, on 14/04/2009 -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist