Hi. I just finished coming up with this algorithm to find prime numbers. In this, number is the number to be checked if it's a prime. factor checker is the number to be checked if it is a factor of number. in isafactor, x is the current working number, y is the result of the integer division (isafactor is a sort of modulus/divide). I'm just wondering if this is more or less right, to be coded in ASM. It really doesn't need to be optimised at all. Also, does anyone know how to alter this / code with larger numbers than 255 (1 byte)? Do I have to write my own routines to work with words? BTW, I am coding for the PIC18F1320. -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist