C is so much easier to use for math stuff.
Like for a tacho;
rpm = (60000000 / period_us);
is one easy line in C even though rpm and period_us are 16bit variables and all the math is done in 32bit. That takes a few seconds to type in C but is a rather nasty piece fo code to make in asm.
MisterT-
Where did you get that RNG code from? It looks poor, what is the point of adding a large prime number right at the end but not blending it in to the algorithm?
You may as well just add "5" to the end result.
There is a RNG here that generates very good entropy from a simple algorithm although it is not particularly time efficient;
The Black Random number generator