Hello All, I'm just starting on my first PIC project ( its starting life as a random morse code generator ) and I could use a routine to produce a random number between 0 and 45 decimal to use as a lookup variable. I have some example code written in Cvasm/Parallax assembler to do something like this but I'm not competent to successfully translate this code to MPASM with any confidence. I'm using MPASM because whatever assembler I eventually use I'll need a good understanding of MPASM to debug native code so I'd better learn MPASM syntax first. At present I'm using the timer to trip an interrupt every 1/500th second which toggles porta.0 to produce the tone on a piezo sounder if a flag is set, and not if reset. so the timer is being used, but perhaps it could be used as a seed Anyway, if you can help it would be appreciated. I brew a really mean Bitter Ale.( approx 14%pv ) Thanks... Mike W mike@corn2.freeserve.co.uk